for some reason, "char **environ" cannot be extern'ed when building a library on Mac OS X. The patch below uses the suggested workaround according to the man page (using _NSGetEnviron()). --- dbus-sysdeps.c 2008-01-14 20:51:51.000000000 +0100 +++ dbus-sysdeps.c.new 2008-02-22 22:12:34.000000000 +0100 @@ -47,6 +47,11 @@ #include <errno.h> #endif +#ifdef __APPLE__ +/* needed for _NSGetEnviron */ +#include <crt_externs.h> +#endif + _DBUS_DEFINE_GLOBAL_LOCK (win_fds); _DBUS_DEFINE_GLOBAL_LOCK (sid_atom_cache); _DBUS_DEFINE_GLOBAL_LOCK (system_users); @@ -191,7 +196,12 @@ if (clearenv () != 0) rc = FALSE; #else +#ifdef __APPLE__ +/* On Mac OS X, environ can't be accessed directly - use _NSGetEnviron() instead */ + char **environ = *_NSGetEnviron(); +#else extern char **environ; +#endif if (environ != NULL) environ[0] = NULL;
AH_VERBATIM in the in bug 14260 is a cleaner way of dealing with this *** This bug has been marked as a duplicate of bug 14260 ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.