From 39b763713cdc656911944ea56225f77e9f27d4e3 Mon Sep 17 00:00:00 2001 From: Jerome Lambourg Date: Wed, 14 Nov 2018 11:41:04 +0000 Subject: [PATCH] [Ada] Do not include crt_externs.h on iOS 2018-11-14 Jerome Lambourg gcc/ada/ * env.c: Do not include crt_externs.h on iOS, as it does not exist there. This is also true for the iPhone Simulator SDK. From-SVN: r266118 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/env.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a0df31f6cce..dbd7ee3a0c6 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-11-14 Jerome Lambourg + + * env.c: Do not include crt_externs.h on iOS, as it does not + exist there. This is also true for the iPhone Simulator SDK. + 2018-11-14 Ed Schonberg * exp_ch7.adb (Check_Unnesting_In_Declarations): New procedure diff --git a/gcc/ada/env.c b/gcc/ada/env.c index b6ab097fcfb..61193f43961 100644 --- a/gcc/ada/env.c +++ b/gcc/ada/env.c @@ -50,9 +50,12 @@ #include #endif -#if defined (__APPLE__) && !(defined (__arm__) || defined (__arm64__)) +#if defined (__APPLE__) \ + && !(defined (__arm__) \ + || defined (__arm64__) \ + || defined (__IOS_SIMULATOR__)) /* On Darwin, _NSGetEnviron must be used for shared libraries; but it is not - available on iOS. */ + available on iOS (on device or on simulator). */ #include #endif @@ -211,7 +214,10 @@ __gnat_environ (void) #elif defined (__sun__) extern char **_environ; return _environ; -#elif defined (__APPLE__) && !(defined (__arm__) || defined (__arm64__)) +#elif defined (__APPLE__) \ + && !(defined (__arm__) \ + || defined (__arm64__) \ + || defined (__IOS_SIMULATOR__)) return *_NSGetEnviron (); #elif ! (defined (__vxworks)) extern char **environ; -- 2.30.2