From d26669d0410fbc299a78a56055f09ce4e74d0aa5 Mon Sep 17 00:00:00 2001 From: Garux Date: Sat, 4 Apr 2020 21:46:39 +0300 Subject: [PATCH] try to fix MAC compilation #40 : probably more elegant 'environ' variable access --- radiant/mainframe.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index e00bd393..14bac918 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -671,11 +671,10 @@ void Exit(){ #include #else #include -#endif -// Apple may not provide the environ global variable -#if defined(__APPLE__) && !defined(environ) - #include - #define environ (*_NSGetEnviron()) +/* According to the Single Unix Specification, environ is not + * in any system header, although unistd.h often declares it. + */ +extern char **environ; #endif void Radiant_Restart(){ ConfirmModified( "Restart Radiant" ); // user can choose to not save, it's ok