diff options
| author | Jakob Kaivo <jkk@ung.org> | 2019-02-27 21:21:54 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2019-02-27 21:21:54 -0500 |
| commit | 522160fc703e1a6e271fc011646f098fefaf56d6 (patch) | |
| tree | 4bb2cbbccf680a0a1f4ce407c2fdb7f6bc0a1141 | |
| parent | 4922f9cd5f507d9206b37333437c3397df07164a (diff) | |
only reference environ if we are building POSIX
| -rw-r--r-- | src/stdlib/getenv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/stdlib/getenv.c b/src/stdlib/getenv.c index edf5c4f9..e5129dc4 100644 --- a/src/stdlib/getenv.c +++ b/src/stdlib/getenv.c @@ -5,6 +5,7 @@ char * getenv(const char * name) { + #ifdef _POSIX_SOURCE extern char **environ; int i = 0; @@ -13,6 +14,9 @@ char * getenv(const char * name) return environ[i]; i++; } + #else + (void)name; + #endif return NULL; } |
