|
@@ -38,6 +38,10 @@
|
|
|
#include <dlfcn.h>
|
|
#include <dlfcn.h>
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+#ifdef __APPLE__
|
|
|
|
|
+#include <crt_externs.h>
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: P3DSession::Constructor
|
|
// Function: P3DSession::Constructor
|
|
|
// Access: Public
|
|
// Access: Public
|
|
@@ -792,8 +796,12 @@ start_p3dpython(P3DInstance *inst) {
|
|
|
// "environ" is a keyword. (!)
|
|
// "environ" is a keyword. (!)
|
|
|
extern char **_environ;
|
|
extern char **_environ;
|
|
|
char **global_environ = _environ;
|
|
char **global_environ = _environ;
|
|
|
|
|
+#elif defined(__APPLE__)
|
|
|
|
|
+ // Apple doesn't guarantee that environ is available for shared
|
|
|
|
|
+ // libraries, but provides _NSGetEnviron().
|
|
|
|
|
+ char **global_environ = *_NSGetEnviron();
|
|
|
#else
|
|
#else
|
|
|
- // Posix doesn't have an underscore.
|
|
|
|
|
|
|
+ // Posix is straightforward.
|
|
|
extern char **environ;
|
|
extern char **environ;
|
|
|
char **global_environ = environ;
|
|
char **global_environ = environ;
|
|
|
#endif // _WIN32
|
|
#endif // _WIN32
|