]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix Ada boostrap for Darwin9 and earlier.
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 24 Dec 2018 13:35:32 +0000 (13:35 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Mon, 24 Dec 2018 13:35:32 +0000 (13:35 +0000)
2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

* adaint.c [__APPLE__] (__gnat_lwp_self): Ensure that the system
interface used is available on the target.

From-SVN: r267410

gcc/ada/ChangeLog
gcc/ada/adaint.c

index 3e319373f5dc9578c2396319c117ae0370beb835..ca2802672207e8f9b1ddb5c2950afd80e2a6b7ca 100644 (file)
@@ -1,3 +1,8 @@
+2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * adaint.c [__APPLE__] (__gnat_lwp_self): Ensure that the system
+       interface used is available on the target.
+
 2018-12-06  Release Manager
 
        * GCC 7.4.0 released.
index bff875a6822fd7746235fcfac9537ea92facc696..0915a3ffc4511531caf220f34d141fc034ac89da 100644 (file)
@@ -3174,9 +3174,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.
@@ -3184,6 +3188,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;
@@ -3194,6 +3199,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