gallium/gallivm: enable linking lp_bld_printf function with C++ code
[mesa.git] / src / util / u_string.h
index 5fea8f17e737409f0736191a351a83cc1a051802..cd21f9d1af1b0dbffece986054a444498502978f 100644 (file)
@@ -50,7 +50,7 @@
 extern "C" {
 #endif
 
-#ifndef _GNU_SOURCE
+#if !defined(_GNU_SOURCE) || defined(__APPLE__)
 
 #define strchrnul util_strchrnul
 static inline char *
@@ -110,7 +110,10 @@ util_asprintf(char **str, const char *fmt, ...)
    return ret;
 }
 
+#ifndef strcasecmp
 #define strcasecmp stricmp
+#endif
+
 #define strdup _strdup
 
 #endif