4 # define WIN32_LEAN_AND_MEAN
6 #elif defined(hpux) || defined(__hpux) || defined(_hpux)
7 # include <sys/pstat.h>
11 * By doing this in two steps we can at least get
12 * the function to be somewhat coherent, even
13 * with this disgusting nest of #ifdefs.
15 #ifndef _SC_NPROCESSORS_ONLN
16 # ifdef _SC_NPROC_ONLN
17 # define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN
18 # elif defined _SC_CRAY_NCPU
19 # define _SC_NPROCESSORS_ONLN _SC_CRAY_NCPU
25 #ifdef _SC_NPROCESSORS_ONLN
33 if ((int)info
.dwNumberOfProcessors
> 0)
34 return (int)info
.dwNumberOfProcessors
;
35 #elif defined(hpux) || defined(__hpux) || defined(_hpux)
36 struct pst_dynamic psd
;
38 if (!pstat_getdynamic(&psd
, sizeof(psd
), (size_t)1, 0))
39 return (int)psd
.psd_proc_cnt
;
42 #ifdef _SC_NPROCESSORS_ONLN
43 if ((ncpus
= (long)sysconf(_SC_NPROCESSORS_ONLN
)) > 0)