ObjFW  Diff

Differences From Artifact [46e156926e]:

To Artifact [b1d4d96275]:


21
22
23
24
25
26
27



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50

#include <limits.h>	/* include any libc header to get the libc defines */

#include "unistd_wrapper.h"

#include "platform.h"




#ifdef OF_MACOS
# include <sys/sysctl.h>
#endif

#ifdef OF_MORPHOS
# define BOOL EXEC_BOOL
# include <exec/system.h>
# include <proto/exec.h>
# undef BOOL
#endif

#import "OFSystemInfo.h"
#import "OFString.h"
#import "OFArray.h"
#import "OFDictionary.h"

#import "OFApplication.h"

#import "OFNotImplementedException.h"

#if defined(OF_MACOS) || defined(OF_IOS)
# ifdef HAVE_SYSDIR_H
#  include <sysdir.h>
# endif







>
>
>












|


>
|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

#include <limits.h>	/* include any libc header to get the libc defines */

#include "unistd_wrapper.h"

#include "platform.h"

#ifdef HAVE_SYS_UTSNAME_H
# include <sys/utsname.h>
#endif
#ifdef OF_MACOS
# include <sys/sysctl.h>
#endif

#ifdef OF_MORPHOS
# define BOOL EXEC_BOOL
# include <exec/system.h>
# include <proto/exec.h>
# undef BOOL
#endif

#import "OFSystemInfo.h"
#import "OFApplication.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFLocalization.h"
#import "OFString.h"

#import "OFNotImplementedException.h"

#if defined(OF_MACOS) || defined(OF_IOS)
# ifdef HAVE_SYSDIR_H
#  include <sysdir.h>
# endif
166
167
168
169
170
171
172






































































173
174
175
176
177
178
179
	return pageSize;
}

+ (size_t)numberOfCPUs
{
	return numberOfCPUs;
}







































































#ifdef OF_HAVE_FILES
+ (OFString *)userDataPath
{
# if defined(OF_MACOS) || defined(OF_IOS)
	char pathC[PATH_MAX];
	OFMutableString *path;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
	return pageSize;
}

+ (size_t)numberOfCPUs
{
	return numberOfCPUs;
}

+ (OFString *)operatingSystemName
{
#if defined(OF_IOS)
	return @"iOS";
#elif defined(OF_MACOS)
	return @"macOS";
#elif defined(OF_WINDOWS)
	return @"Windows";
#elif defined(OF_ANDROID)
	return @"Android";
#elif defined(OF_MORPHOS)
	return @"MorphOS";
#elif defined(OF_AMIGAOS4)
	return @"AmigaOS 4";
#elif defined(OF_WII)
	return @"Nintendo Wii";
#elif defined(NINTENDO_3DS)
	return @"Nintendo 3DS";
#elif defined(OF_NINTENDO_DS)
	return @"Nintendo DS";
#elif defined(OF_PSP)
	return @"PlayStation Portable";
#elif defined(OF_MSDOS)
	return @"MS-DOS";
#elif defined(HAVE_SYS_UTSNAME_H) && defined(HAVE_UNAME)
	struct utsname u;

	if (uname(&u) != 0)
		return nil;

	return [OFString stringWithCString: u.sysname
				  encoding: [OFLocalization encoding]];
#else
	return nil;
#endif
}

+ (OFString *)operatingSystemVersion
{
#if defined(OF_IOS) || defined(OF_MACOS)
	/* TODO */
	return nil;
#elif defined(OF_WINDOWS)
	/* TODO */
	return nil;
#elif defined(OF_ANDROID)
	/* TODO */
	return nil;
#elif defined(OF_MORPHOS)
	/* TODO */
	return nil;
#elif defined(OF_AMIGAOS4)
	/* TODO */
	return nil;
#elif defined(OF_WII) || defined(NINTENDO_3DS) || defined(OF_NINTENDO_DS) || \\
    defined(OF_PSP) || defined(OF_MSDOS)
	return nil;
#elif defined(HAVE_SYS_UTSNAME_H) && defined(HAVE_UNAME)
	struct utsname u;

	if (uname(&u) != 0)
		return nil;

	return [OFString stringWithCString: u.release
				  encoding: [OFLocalization encoding]];
#else
	return nil;
#endif
}

#ifdef OF_HAVE_FILES
+ (OFString *)userDataPath
{
# if defined(OF_MACOS) || defined(OF_IOS)
	char pathC[PATH_MAX];
	OFMutableString *path;