Ticket #782 (closed bug: worksforme)
src/pmc/env.t confuses compiler specific and platform specific macros
Reported by: | moritz | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | core | Version: | 1.3.0 |
Severity: | medium | Keywords: | build, macos, clang |
Cc: | Language: | ||
Patch status: | Platform: | linux |
Description
From src/pmc/env.pmc (lines 23 and onwards)
/* array of environment variables, speced in POSIX.1, but not in ISO-C MS C compilers know about environ, as it is declared in stdlib.h. OS X doesn't allow access to "environ" from within shared libraries. */ #ifndef WIN32 # ifdef __APPLE_CC__ # include <crt_externs.h> # define environ (*_NSGetEnviron()) # else /* !__APPLE_CC__ */ extern char **environ; # endif /* __APPLE_CC__ */ #endif /* !WIN32 */
This causes build failures on linux with clang (a llvm frontend) which sets the APPLE_CC macro, but doesn't provide crt_externs.h
It seems that it would be more appropriate to check for being on MacOS than checking a vendor specific macro.
Change History
Note: See
TracTickets for help on using
tickets.