[MacPorts] #54068: mozjs17 @17.0.0_5 won't build (on PPC Tiger, Mac OS X 10.4.11) because sys/sysctl.h does not provide _SC_NPROCESSORS_ONLN but HW_NCPU

MacPorts noreply at macports.org
Sun Apr 30 22:20:33 UTC 2017


#54068: mozjs17  @17.0.0_5 won't build (on PPC Tiger, Mac OS X 10.4.11) because
sys/sysctl.h does not provide _SC_NPROCESSORS_ONLN but HW_NCPU
------------------------+-------------------
  Reporter:  ballapete  |      Owner:
      Type:  defect     |     Status:  new
  Priority:  Normal     |  Milestone:
 Component:  ports      |    Version:  2.4.1
Resolution:             |   Keywords:
      Port:  mozjs17    |
------------------------+-------------------

Comment (by ballapete):

 Changing the block to

 {{{
 static unsigned
 GetCPUCount()
 {
     static unsigned ncpus = 0;
     if (ncpus == 0) {
 # ifdef XP_WIN
         SYSTEM_INFO sysinfo;
         GetSystemInfo(&sysinfo);
         ncpus = unsigned(sysinfo.dwNumberOfProcessors);
 # elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
         long n = sysconf(HW_NCPU);
         ncpus = (n > 0) ? unsigned(n) : 1;
 # else
         long n = sysconf(_SC_NPROCESSORS_ONLN);
         ncpus = (n > 0) ? unsigned(n) : 1;
 # endif
     }
     return ncpus;
 }
 #endif /* JS_THREADSAFE */
 }}}

 should work – but sys/sysctl.h is never included! Maybe sys/sysctl.h could
 be included here:

 {{{
    96   #ifdef XP_WIN
    97   # include "jswin.h"
    98   #else
    99   # include <unistd.h>
   100   #endif
 }}}

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


More information about the macports-tickets mailing list