From 1e7dbdbea8e62a04b2e3fdcd237bf04ae8f76db2 Mon Sep 17 00:00:00 2001 From: hans Date: Wed, 15 Feb 2012 22:09:31 +0000 Subject: Fix build on SunOS. --- audio/mad123/patches/patch-aa | 13 +++++++++- audio/mad123/patches/patch-ab | 44 +++++++++++++++++++++++++++++--- audio/mad123/patches/patch-mp3__stream.c | 16 ++++++++++++ 3 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 audio/mad123/patches/patch-mp3__stream.c (limited to 'audio/mad123/patches') diff --git a/audio/mad123/patches/patch-aa b/audio/mad123/patches/patch-aa index 4d0684a8ab9..0e56b9851bf 100644 --- a/audio/mad123/patches/patch-aa +++ b/audio/mad123/patches/patch-aa @@ -1,4 +1,4 @@ -$NetBSD: patch-aa,v 1.1 2005/11/11 18:58:18 joerg Exp $ +$NetBSD: patch-aa,v 1.2 2012/02/15 22:09:31 hans Exp $ --- mad123.c.orig 2005-11-11 18:19:59.000000000 +0000 +++ mad123.c @@ -10,3 +10,14 @@ $NetBSD: patch-aa,v 1.1 2005/11/11 18:58:18 joerg Exp $ #include #include #include +@@ -33,6 +34,10 @@ + #include + #include + ++#ifdef __sun ++#include ++#endif ++ + #include "audio_dev.h" + #include "mp3_stream.h" + diff --git a/audio/mad123/patches/patch-ab b/audio/mad123/patches/patch-ab index c01c28464ec..fab7aa2f342 100644 --- a/audio/mad123/patches/patch-ab +++ b/audio/mad123/patches/patch-ab @@ -1,4 +1,4 @@ -$NetBSD: patch-ab,v 1.2 2012/02/05 20:39:50 sbd Exp $ +$NetBSD: patch-ab,v 1.3 2012/02/15 22:09:31 hans Exp $ --- audio_dev.c.orig 2004-09-22 09:23:43.000000000 +0000 +++ audio_dev.c @@ -12,7 +12,18 @@ $NetBSD: patch-ab,v 1.2 2012/02/05 20:39:50 sbd Exp $ #include #include #include -@@ -43,6 +45,10 @@ +@@ -35,6 +35,10 @@ + #include + #include + ++#ifdef __sun ++#include ++#endif ++ + #include "audio_dev.h" + + #if (BYTE_ORDER == BIG_ENDIAN) +@@ -43,6 +47,10 @@ #undef WORDS_BIGENDIAN #endif @@ -23,7 +34,25 @@ $NetBSD: patch-ab,v 1.2 2012/02/05 20:39:50 sbd Exp $ #define PCM_BUFFSIZE ((sizeof(((struct mad_pcm *)0)->samples) / \ sizeof(mad_fixed_t)) * 2) struct pcm_data { -@@ -97,8 +103,12 @@ static void audio_convert_dither(unsigne +@@ -58,7 +66,7 @@ struct pcm_data { + #define PCM_LOW_WATER 32 + struct pcm_buffer { + volatile int pb_command; +- u_int64_t pb_playsamples; ++ uint64_t pb_playsamples; + int pb_rate; + int pb_nchannels; + volatile int pb_purge; +@@ -74,7 +82,7 @@ struct audio_dev_ctx { + int ac_paused; + int ac_peerread; + int ac_peerwrite; +- u_int64_t ac_buffersamples; ++ uint64_t ac_buffersamples; + void (*ac_readcallback)(void *); + void *ac_cbarg; + struct pcm_buffer *ac_pcm; +@@ -97,8 +105,12 @@ static void audio_convert_dither(unsigne static const struct audio_dev_backend *audio_dev_backends[] = { @@ -36,3 +65,12 @@ $NetBSD: patch-ab,v 1.2 2012/02/05 20:39:50 sbd Exp $ #ifndef NOARTS &audio_dev_arts, #endif +@@ -326,7 +338,7 @@ audio_dev_output(struct audio_dev_ctx *a + pd->pd_len = len; + + written /= pd->pd_nchannels; +- written /= sizeof(u_int16_t); ++ written /= sizeof(uint16_t); + ac->ac_pcm->pb_playsamples += written; + + return ((rv >= 0) ? 0 : -1); diff --git a/audio/mad123/patches/patch-mp3__stream.c b/audio/mad123/patches/patch-mp3__stream.c new file mode 100644 index 00000000000..33678b511ba --- /dev/null +++ b/audio/mad123/patches/patch-mp3__stream.c @@ -0,0 +1,16 @@ +$NetBSD: patch-mp3__stream.c,v 1.1 2012/02/15 22:09:31 hans Exp $ + +--- mp3_stream.c.orig 2004-10-21 11:11:42.000000000 +0200 ++++ mp3_stream.c 2012-01-11 19:53:46.065401047 +0100 +@@ -41,6 +41,11 @@ + #endif /* NOTAGLIB */ + #include /* Move *after* curl.h, 'cos it's braindamaged */ + ++#ifdef __sun ++#define madvise posix_madvise ++#define MAP_FILE 0 ++#endif ++ + #include "mp3_stream.h" + + static void *mps_file_open(const char *, int); -- cgit v1.2.3