| 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 | // ...
|
|---|
| 8 | extern "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__)
|
|---|
| 15 | extern 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__)
|
|---|
| 20 | extern char** environ;
|
|---|
| 21 | #endif
|
|---|
| 22 | #endif
|
|---|
| 23 | #endif
|
|---|
| 24 | #endif
|
|---|