[xiph-commits] r12662 - icecast/trunk/libshout/src
moritz at svn.xiph.org
moritz at svn.xiph.org
Tue Mar 6 05:25:22 PST 2007
Author: moritz
Date: 2007-03-06 05:25:19 -0800 (Tue, 06 Mar 2007)
New Revision: 12662
Modified:
icecast/trunk/libshout/src/shout.c
icecast/trunk/libshout/src/theora.c
icecast/trunk/libshout/src/vorbis.c
Log:
Portability fixes for Windows and IRIX (MIPS/MIPSpro C): Include missing
headers, don't do pointer arithmetics with void*, and add some defines for
Windows. Define va_copy only if it isn't defined, yet (e.g. for MINGW32.)
ok msmith@
Modified: icecast/trunk/libshout/src/shout.c
===================================================================
--- icecast/trunk/libshout/src/shout.c 2007-03-06 13:23:40 UTC (rev 12661)
+++ icecast/trunk/libshout/src/shout.c 2007-03-06 13:25:19 UTC (rev 12662)
@@ -24,6 +24,7 @@
#include <config.h>
#endif
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -37,6 +38,14 @@
#include "shout_private.h"
#include "util.h"
+#ifdef _WIN32
+# ifndef va_copy
+# define va_copy(ap1, ap2) memcpy(&ap1, &ap2, sizeof(va_list))
+# endif
+# define vsnprintf _vsnprintf
+# define inline _inline
+#endif
+
/* -- local prototypes -- */
static int queue_data(shout_queue_t *queue, const unsigned char *data, size_t len);
static int queue_str(shout_t *self, const char *str);
@@ -1006,10 +1015,11 @@
return rc;
}
-static int try_write (shout_t *self, const void *data, size_t len)
+static int try_write (shout_t *self, const void *data_p, size_t len)
{
int ret;
size_t pos = 0;
+ unsigned char *data = (unsigned char *)data_p;
/* loop until whole buffer is written (unless it would block) */
do {
Modified: icecast/trunk/libshout/src/theora.c
===================================================================
--- icecast/trunk/libshout/src/theora.c 2007-03-06 13:23:40 UTC (rev 12661)
+++ icecast/trunk/libshout/src/theora.c 2007-03-06 13:25:19 UTC (rev 12662)
@@ -26,6 +26,7 @@
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
+#include <stdlib.h>
#include <theora/theora.h>
Modified: icecast/trunk/libshout/src/vorbis.c
===================================================================
--- icecast/trunk/libshout/src/vorbis.c 2007-03-06 13:23:40 UTC (rev 12661)
+++ icecast/trunk/libshout/src/vorbis.c 2007-03-06 13:25:19 UTC (rev 12662)
@@ -26,6 +26,7 @@
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
+#include <stdlib.h>
#include <vorbis/codec.h>
More information about the commits
mailing list