| 48 | #endif |
| 49 | |
| 50 | static INLINE int NumProcs(void) |
| 51 | { |
| 52 | #ifdef _WIN32 |
| 53 | |
| 54 | DWORD_PTR ProcAff, SysAff, i; int count = 0; |
| 55 | if(!GetProcessAffinityMask(GetCurrentProcess(), &ProcAff, &SysAff)) |
| 56 | return 1; |
| 57 | for(i = 0; i < sizeof(long *) * 8; i++) |
| 58 | if(ProcAff & (1LL << i)) count++; |
| 59 | return count; |
| 60 | |
| 61 | #elif defined(__APPLE__) |
| 62 | |
| 63 | return 1; |
| 64 | |
| 65 | #else |
| 66 | |
| 67 | long count = 1; |
| 68 | if((count = sysconf(_SC_NPROCESSORS_CONF)) != -1) return (int)count; |
| 69 | else return 1; |
| 70 | |
| 71 | #endif |
| 72 | } |
| 73 | |
| 74 | #define BYTESWAP(i) \ |
| 75 | ( (((i) & 0xff000000) >> 24) | \ |
no outgoing calls