Ticket #9428: parsers_patch_extract.cpp

File parsers_patch_extract.cpp, 727 bytes (added by Jan Rosendahl <jan.rosendahl@…>, 9 years ago)
Line 
1// It appears that on Mac OS X the 'environ' variable is not
2// available to dynamically linked libraries.
3// ...
4#if defined(__APPLE__) && defined(__DYNAMIC__)
5// The proper include for this is crt_externs.h, however it's not
6// available on iOS. The right replacement is not known. See
7// ...
8extern "C" { extern char ***_NSGetEnviron(void); }
9#define environ (*_NSGetEnviron())
10#else
11#if defined(__MWERKS__)
12#include <crtl.h>
13#else
14#if !defined(_WIN32) || defined(__COMO_VERSION__)
15extern char** environ;
16#else
17// SMAL patch for MinGW
18// Seems as it should be #include <stdlib.h> but that does not work.
19#if defined(_WIN32) && defined(__MINGW32__)
20extern char** environ;
21#endif
22#endif
23#endif
24#endif