Skip to content

Commit

Permalink
Fix environ for Apple.
Browse files Browse the repository at this point in the history
On Apple systems, define environ by using _NSGetEnviron() from
crt_externs.h.
  • Loading branch information
barracuda156 authored and michaelonken committed Dec 17, 2024
1 parent 1ca045a commit f4d8777
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ofstd/libsrc/ofstub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ static OFString getLastErrorString()
return OFString();
}

#elif defined(__APPLE__)

#include <crt_externs.h>
#define environ (*_NSGetEnviron())

#else /* _WIN32 */

extern char** environ; // required to exist by the Single Unix Specification
Expand Down

0 comments on commit f4d8777

Please sign in to comment.