Lines 1-4
Link Here
|
1 |
--- src/cpHastySpace.c.orig 2015-01-13 01:54:11 UTC |
1 |
--- src/cpHastySpace.c.orig 2015-07-02 16:24:47 UTC |
2 |
+++ src/cpHastySpace.c |
2 |
+++ src/cpHastySpace.c |
3 |
@@ -5,8 +5,11 @@ |
3 |
@@ -5,8 +5,11 @@ |
4 |
#include <stdio.h> |
4 |
#include <stdio.h> |
Lines 14-31
Link Here
|
14 |
|
14 |
|
15 |
#include "chipmunk/chipmunk_private.h" |
15 |
#include "chipmunk/chipmunk_private.h" |
16 |
#include "chipmunk/cpHastySpace.h" |
16 |
#include "chipmunk/cpHastySpace.h" |
17 |
@@ -313,15 +316,18 @@ cpHastySpaceSetThreads(cpSpace *space, u |
17 |
@@ -314,14 +317,20 @@ cpHastySpaceSetThreads(cpSpace *space, u |
18 |
|
|
|
19 |
cpHastySpace *hasty = (cpHastySpace *)space; |
18 |
cpHastySpace *hasty = (cpHastySpace *)space; |
20 |
HaltThreads(hasty); |
19 |
HaltThreads(hasty); |
21 |
- |
20 |
|
22 |
-#ifdef __APPLE__ |
21 |
-#ifdef __APPLE__ |
23 |
+ |
|
|
24 |
if(threads == 0){ |
22 |
if(threads == 0){ |
25 |
- size_t size = sizeof(threads); |
23 |
+#ifdef __APPLE__ |
26 |
- sysctlbyname("hw.ncpu", &threads, &size, NULL, 0); |
24 |
size_t size = sizeof(threads); |
|
|
25 |
sysctlbyname("hw.ncpu", &threads, &size, NULL, 0); |
27 |
- } |
26 |
- } |
28 |
+#if defined(_SC_NPROCESSORS_ONLN) |
27 |
+#elif defined(_SC_NPROCESSORS_ONLN) |
29 |
+ threads = sysconf(_SC_NPROCESSORS_ONLN); |
28 |
+ threads = sysconf(_SC_NPROCESSORS_ONLN); |
30 |
+#elif defined(_WIN32) |
29 |
+#elif defined(_WIN32) |
31 |
+ SYSTEM_INFO siSysInfo; |
30 |
+ SYSTEM_INFO siSysInfo; |