summaryrefslogtreecommitdiff
path: root/ptw32_getprocessors.c
diff options
context:
space:
mode:
Diffstat (limited to 'ptw32_getprocessors.c')
-rw-r--r--ptw32_getprocessors.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/ptw32_getprocessors.c b/ptw32_getprocessors.c
index 01dfa3a..bfaa82d 100644
--- a/ptw32_getprocessors.c
+++ b/ptw32_getprocessors.c
@@ -53,15 +53,20 @@
* newly initialised spinlocks will notice.
*/
int
-ptw32_getprocessors(int * count)
+ptw32_getprocessors (int *count)
{
DWORD_PTR vProcessCPUs;
DWORD_PTR vSystemCPUs;
int result = 0;
- if (GetProcessAffinityMask(GetCurrentProcess(),
- &vProcessCPUs,
- &vSystemCPUs))
+#if defined(NEED_PROCESS_AFFINITY_MASK)
+
+ *count = 1;
+
+#else
+
+ if (GetProcessAffinityMask (GetCurrentProcess (),
+ &vProcessCPUs, &vSystemCPUs))
{
DWORD_PTR bit;
int CPUs = 0;
@@ -80,5 +85,7 @@ ptw32_getprocessors(int * count)
result = EAGAIN;
}
- return(result);
+#endif
+
+ return (result);
}