summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2013-04-08 19:42:27 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2013-04-12 23:05:58 +0100
commit3c1d9c6d41e4f209af5be1baa933234d6ef51560 (patch)
tree90ff53a3023322dd9658792903f0796f1e555384
parentff292d530c126191bf220f70a8d114aa8f54e4b9 (diff)
printf: fix alloca use for windows with mingw32
Don't use just GLIB_HAVE_ALLOCA_H to check if alloca is available, that's just for the header. GLib may define alloca for us otherwise too irrespective of GLIB_HAVE_ALLOCA_H. Fixes compiler warning with mingw32: gst/printf/vasnprintf.c:73:0: warning: "alloca" redefined
-rw-r--r--gst/printf/README4
-rw-r--r--gst/printf/vasnprintf.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/gst/printf/README b/gst/printf/README
index ebfed9b3f..c8eac3815 100644
--- a/gst/printf/README
+++ b/gst/printf/README
@@ -47,8 +47,8 @@ This was imported from GLib's gnulib subdirectory.
g-gnulib.h and _g_gnulib namespace has been changed to gst-printf.h and
__gst_printf namespace for GStreamer. Also #define HAVE_SNPRINTF 0 has
-been changed to #undef HAVE_SNPRINTF, and HAVE_ALLOCA has been changed to
-GLIB_HAVE_ALLOCA_H
+been changed to #undef HAVE_SNPRINTF, and HAVE_ALLOCA has been replaced
+by an #if defined(alloca) || defined(GLIB_HAVE_ALLOCA_H)
printf-extension.[ch] were added to provide support for custom pointer
arguments (e.g. caps, events, etc.)
diff --git a/gst/printf/vasnprintf.c b/gst/printf/vasnprintf.c
index 1cc5c0d4f..7f3d9e2f2 100644
--- a/gst/printf/vasnprintf.c
+++ b/gst/printf/vasnprintf.c
@@ -67,7 +67,7 @@ local_wcslen (const wchar_t * s)
/* For those losing systems which don't have 'alloca' we have to add
some additional code emulating it. */
-#ifdef GLIB_HAVE_ALLOCA_H
+#if defined (alloca) || defined (GLIB_HAVE_ALLOCA_H)
# define freea(p) /* nothing */
#else
# define alloca(n) malloc (n)