diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2018-12-23 12:51:52 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2018-12-23 12:51:52 +0000 |
commit | 3f5c0b6bb14d84fb8aa7e1369d70594cbb8333cb (patch) | |
tree | eb98c7dbadcf7b79ec0c0ae5c844bb3c5f9ad834 /gcc/ada/adaint.c | |
parent | b5327e50d5b571bc095f60c7ccebd2840178e130 (diff) | |
download | gcc-3f5c0b6bb14d84fb8aa7e1369d70594cbb8333cb.zip gcc-3f5c0b6bb14d84fb8aa7e1369d70594cbb8333cb.tar.gz gcc-3f5c0b6bb14d84fb8aa7e1369d70594cbb8333cb.tar.bz2 |
Fix Ada bootstrap for Darwin9 and earlier.
2018-12-23 Iain Sandoe <iain@sandoe.co.uk>
gcc/ada/
* adaint.c [__APPLE__] (__gnat_lwp_self): Ensure that the system
interface used is available on the target.
From-SVN: r267374
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r-- | gcc/ada/adaint.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 88500a6..cc143cf 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -3239,9 +3239,13 @@ __gnat_lwp_self (void) #endif #if defined (__APPLE__) -#include <mach/thread_info.h> -#include <mach/mach_init.h> -#include <mach/thread_act.h> +# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060 +# include <mach/thread_info.h> +# include <mach/mach_init.h> +# include <mach/thread_act.h> +# else +# include <pthread.h> +# endif /* System-wide thread identifier. Note it could be truncated on 32 bit hosts. @@ -3249,6 +3253,7 @@ __gnat_lwp_self (void) void * __gnat_lwp_self (void) { +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060 thread_identifier_info_data_t data; mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT; kern_return_t kret; @@ -3259,6 +3264,9 @@ __gnat_lwp_self (void) return (void *)(uintptr_t)data.thread_id; else return 0; +#else + return (void *)pthread_mach_thread_np (pthread_self ()); +#endif } #endif |