[MacPorts] #64906: fixing Ruby for PowerPC

MacPorts noreply at macports.org
Sat Apr 16 03:15:20 UTC 2022


#64906: fixing Ruby for PowerPC
-----------------------------+-------------------------------------------
  Reporter:  barracuda156    |      Owner:  kimuraw
      Type:  defect          |     Status:  closed
  Priority:  Normal          |  Milestone:
 Component:  ports           |    Version:  2.7.2
Resolution:  wontfix         |   Keywords:  powerpc, leopard, snowleopard
      Port:  ruby27, ruby30  |
-----------------------------+-------------------------------------------

Comment (by barracuda156):

 Replying to [comment:15 kencu]:
 > Or this should work:

 Thank you! Trying now.

 P. S. I made initially this, and it did build, but I was suspecting it is
 wrong:


 {{{
 #if defined(RB_THREAD_T_HAS_NATIVE_ID) || defined(__APPLE__)
 static VALUE
 native_thread_native_thread_id(rb_thread_t *target_th)
 {
 #ifdef RB_THREAD_T_HAS_NATIVE_ID
     int tid = target_th->tid;
     if (tid == 0) return Qnil;
     return INT2FIX(tid);
 #elif defined(__APPLE__)
         uint64_t tid;
         #if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
                 tid = pthread_mach_thread_np(pthread_self());
         #elif MAC_OS_X_VERSION_MIN_REQUIRED < 1060
                 if (&pthread_threadid_np) {
                         int e = pthread_threadid_np(target_th->thread_id,
 &tid);
                         if (e != 0) rb_syserr_fail(e,
 "pthread_threadid_np");
                 } else {
                         tid = pthread_mach_thread_np(pthread_self());
                 }
         #else
                 int e = pthread_threadid_np(target_th->thread_id, &tid);
                 if (e != 0) rb_syserr_fail(e, "pthread_threadid_np");
         #endif
     return ULL2NUM((unsigned long long)tid);
 #endif
 }
 # define USE_NATIVE_THREAD_NATIVE_THREAD_ID 1
 #else
 # define USE_NATIVE_THREAD_NATIVE_THREAD_ID 0
 #endif
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/64906#comment:16>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list