mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-22 11:31:05 +08:00
Darwin, libgfortran : Do not use environ directly from the library.
On macOS / Darwin, the environ variable can be used directly in the code of an executable, but cannot be used in the code of a shared library (i.e. libgfortran.dylib), in this case. In such cases, the function _NSGetEnviron should be called to get the address of 'environ'. libgfortran/ChangeLog: * intrinsics/execute_command_line.c (environ): Use _NSGetEnviron to get the environment pointer on Darwin.
This commit is contained in:
parent
93f1186f7d
commit
a345413076
@ -34,7 +34,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
#endif
|
||||
#ifdef HAVE_POSIX_SPAWN
|
||||
#include <spawn.h>
|
||||
# ifdef __APPLE__
|
||||
# include <crt_externs.h>
|
||||
# define environ (*_NSGetEnviron ())
|
||||
# else
|
||||
extern char **environ;
|
||||
# endif
|
||||
#endif
|
||||
#if defined(HAVE_POSIX_SPAWN) || defined(HAVE_FORK)
|
||||
#include <signal.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user