diff options
author | Charles Forsyth <charles.forsyth@gmail.com> | 2017-04-15 15:35:40 +0100 |
---|---|---|
committer | Charles Forsyth <charles.forsyth@gmail.com> | 2017-04-15 15:35:40 +0100 |
commit | 9f87c1613c0385e8264a2e5eca8f503cc446fbf1 (patch) | |
tree | 1cf6c12718d911236d7c8dff41b81d4d97d38dfa | |
parent | 128369f1bb02022b2f5f59fca37f2025c49e2651 (diff) |
MS include files now #define environ,
which messes up its use as field of struct, so undef it,
unless needed for Windows interface, as controlled by INFERNO_KEEPENVIRON.
Only rc and mk need extern char**environ
-rwxr-xr-x | Nt/386/include/lib9.h | 4 | ||||
-rw-r--r-- | utils/mk/Nt.c | 1 | ||||
-rw-r--r-- | utils/rcsh/rc.h | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/Nt/386/include/lib9.h b/Nt/386/include/lib9.h index d10c51ed..fd48f043 100755 --- a/Nt/386/include/lib9.h +++ b/Nt/386/include/lib9.h @@ -16,7 +16,11 @@ #define strtod infstrtod #define strtoll infstrtoll #define strtoull infstrtoull +#ifndef INFERNO_KEEPENVIRON +/* environ is perfectly legal as the name of a local, field name or struct, but windows redefines it */ +/* the extern char** environ is only needed by two programs, so #undef it for everything else */ #undef environ +#endif /* do-it-yourself isinf and isnan */ #ifndef isnan diff --git a/utils/mk/Nt.c b/utils/mk/Nt.c index c2250762..93955f9a 100644 --- a/utils/mk/Nt.c +++ b/utils/mk/Nt.c @@ -1,3 +1,4 @@ +#define INFERNO_KEEPENVIRON #include "mk.h" #include <signal.h> #include <sys/utime.h> diff --git a/utils/rcsh/rc.h b/utils/rcsh/rc.h index f7d56746..d01150a6 100644 --- a/utils/rcsh/rc.h +++ b/utils/rcsh/rc.h @@ -1,3 +1,4 @@ +#define INFERNO_KEEPENVIRON #include <lib9.h> #define Lock Rclock |