Bug 581478: undef strdup before (re)defining it in mozalloc_macro_wrappers.h. r=glandium
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 25 Jul 2013 18:14:41 -0700
changeset 140058 924c4d59db8b27892cfcdff998c97ec0111a4689
parent 140057 91bc683b2f45e0c0b2a45aae70da4ff009f7588b
child 140059 7d9fad4b940ffb5275ef427ba3ecb1e5c37deed8
push id31585
push userdholbert@mozilla.com
push dateFri, 26 Jul 2013 01:15:26 +0000
treeherdermozilla-inbound@924c4d59db8b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs581478
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 581478: undef strdup before (re)defining it in mozalloc_macro_wrappers.h. r=glandium
memory/mozalloc/mozalloc_macro_wrappers.h
--- a/memory/mozalloc/mozalloc_macro_wrappers.h
+++ b/memory/mozalloc/mozalloc_macro_wrappers.h
@@ -19,16 +19,21 @@
 #define free(_) moz_free(_)
 
 #define malloc(_) moz_malloc(_)
 
 #define calloc(_, __) moz_calloc(_, __)
 
 #define realloc(_, __) moz_realloc(_, __)
 
+/*
+ * Note: on some platforms, strdup may be a macro instead of a function.
+ * So we have to #undef it to avoid build warnings about redefining it.
+ */
+#undef strdup
 #define strdup(_) moz_strdup(_)
 
 #if defined(HAVE_STRNDUP)
 #define strndup(_, __) moz_strndup(_, __)
 #endif
 
 #if defined(HAVE_POSIX_MEMALIGN)
 #define posix_memalign(_, __, ___) moz_posix_memalign(_, __, ___)