A few MacOS X portability fixes
authorLennart Poettering <lennart@poettering.net>
Thu, 5 Feb 2009 23:25:47 +0000 (00:25 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 5 Feb 2009 23:25:47 +0000 (00:25 +0100)
Based on patches contributed by "Tron".

See bug #478.

src/pulsecore/core-util.c
src/pulsecore/proplist-util.c

index b7ebdeb..ad6c6ca 100644 (file)
 #include <samplerate.h>
 #endif
 
+#ifdef __APPLE__
+#include <xlocale.h>
+#endif
+
 #include <pulse/xmalloc.h>
 #include <pulse/util.h>
 #include <pulse/utf8.h>
index c09c8af..8a447cf 100644 (file)
 #include <locale.h>
 #include <dlfcn.h>
 
+#ifdef __APPLE__
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
+#elif !HAVE_DECL_ENVIRON
+extern char **environ;
+#endif
+
 #include <pulse/proplist.h>
 #include <pulse/utf8.h>
 #include <pulse/xmalloc.h>
@@ -37,9 +44,6 @@
 #include "proplist-util.h"
 
 void pa_init_proplist(pa_proplist *p) {
-#if !HAVE_DECL_ENVIRON
-    extern char **environ;
-#endif
     char **e;
     const char *pp;