summaryrefslogtreecommitdiff
path: root/gcc/ada/env.c
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-01 22:23:04 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-01 22:23:04 +0000
commit2be44f9a01cf345b4aa4077fd5016f6b3883be4e (patch)
treeb382ba84d2ce61564962972bc5eb8444535302d3 /gcc/ada/env.c
parent10494d65ed148c0b31cc6e4f1682ea9c869c094e (diff)
downloadgcc-2be44f9a01cf345b4aa4077fd5016f6b3883be4e.tar.gz
PR ada/33857
* env.c: Always include crt_externs.h if __APPLE__ is defined. (__gnat_setenv): Use setenv instead of putenv if __APPLE__ is defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133806 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/env.c')
-rw-r--r--gcc/ada/env.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ada/env.c b/gcc/ada/env.c
index 01c25d6753f..2b708c31790 100644
--- a/gcc/ada/env.c
+++ b/gcc/ada/env.c
@@ -41,10 +41,6 @@
#include <unixio.h>
#endif
-#if defined (__APPLE__)
-#include <crt_externs.h>
-#endif
-
#if defined (__MINGW32__)
#include <stdlib.h>
#endif
@@ -61,6 +57,10 @@ extern char** ppGlobalEnviron;
#include "system.h"
#endif /* IN_RTS */
+#if defined (__APPLE__)
+#include <crt_externs.h>
+#endif
+
#include "env.h"
void
@@ -166,7 +166,7 @@ __gnat_setenv (char *name, char *value)
LIB$SIGNAL (status);
}
-#elif defined (__vxworks) && defined (__RTP__)
+#elif (defined (__vxworks) && defined (__RTP__)) || defined (__APPLE__)
setenv (name, value, 1);
#else
@@ -178,7 +178,7 @@ __gnat_setenv (char *name, char *value)
sprintf (expression, "%s=%s", name, value);
putenv (expression);
#if (defined (__FreeBSD__) && (__FreeBSD__ < 7)) \
- || defined (__APPLE__) || defined (__MINGW32__) \
+ || defined (__MINGW32__) \
||(defined (__vxworks) && ! defined (__RTP__))
/* On some systems like FreeBSD 6.x and earlier, MacOS X and Windows,
putenv is making a copy of the expression string so we can free