ObjFW  Check-in [3d1d05df3c]

Overview
Comment:Get the number of CPUs on QNX.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3d1d05df3c2a7b374d98b085324a86e098067014d94ade2d5f0ce249077e351f
User & Date: js on 2012-07-11 13:56:05
Other Links: manifest | tags
Context
2012-07-11
21:13
AS_IF does not allow empty bodies in old versions. check-in: 58d05c6704 user: js tags: trunk
13:56
Get the number of CPUs on QNX. check-in: 3d1d05df3c user: js tags: trunk
09:20
objfw-config: Make sure there always is a space. check-in: fb807e2e3c user: js tags: trunk
Changes

Modified src/OFObject.m from [fd16b773e1] to [64a1864a0a].

21
22
23
24
25
26
27




28
29
30
31
32
33
34
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38







+
+
+
+







#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <unistd.h>

#include <assert.h>

#ifdef __QNX__
# include <sys/syspage.h>
#endif

#import "OFObject.h"
#import "OFAutoreleasePool.h"

#import "OFAllocFailedException.h"
#import "OFEnumerationMutationException.h"
#import "OFInitializationFailedException.h"
213
214
215
216
217
218
219




220
221
222
223
224
225
226
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234







+
+
+
+







	}

#if defined(_WIN32)
	SYSTEM_INFO si;
	GetSystemInfo(&si);
	of_pagesize = si.dwPageSize;
	of_num_cpus = si.dwNumberOfProcessors;
#elif defined(__QNX__)
	if ((of_pagesize = sysconf(_SC_PAGESIZE)) < 1)
		of_pagesize = 4096;
	of_num_cpus = _syspage_ptr->num_cpu;
#else
# ifdef _SC_PAGESIZE
	if ((of_pagesize = sysconf(_SC_PAGESIZE)) < 1)
# endif
		of_pagesize = 4096;
# ifdef _SC_NPROCESSORS_CONF
	if ((of_num_cpus = sysconf(_SC_NPROCESSORS_CONF)) < 1)