ObjFW  Diff

Differences From Artifact [163a46eba3]:

To Artifact [254f78a8f6]:


23
24
25
26
27
28
29







30
31
32
33
34
35
36
#include "unistd_wrapper.h"

#include "platform.h"

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








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








>
>
>
>
>
>
>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#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"

366
367
368
369
370
371
372
373
374
375
376
377
378








379
380
381
382
383
384
	return x86_cpuid(0, 0).eax >= 7 && (x86_cpuid(7, 0).ebx & (1 << 5));
}
#endif

#if defined(OF_POWERPC) || defined(OF_POWERPC64)
+ (bool)supportsAltiVec
{
# ifdef OF_MACOS
	int name[2] = { CTL_HW, HW_VECTORUNIT }, value = 0;
	size_t length = sizeof(value);

	if (sysctl(name, 2, &value, &length, NULL, 0) == 0)
		return value;








# endif

	return false;
}
#endif
@end







|





>
>
>
>
>
>
>
>






373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
	return x86_cpuid(0, 0).eax >= 7 && (x86_cpuid(7, 0).ebx & (1 << 5));
}
#endif

#if defined(OF_POWERPC) || defined(OF_POWERPC64)
+ (bool)supportsAltiVec
{
# if defined(OF_MACOS)
	int name[2] = { CTL_HW, HW_VECTORUNIT }, value = 0;
	size_t length = sizeof(value);

	if (sysctl(name, 2, &value, &length, NULL, 0) == 0)
		return value;
# elif defined(OF_MORPHOS)
	uint32_t supportsAltiVec;

	if (NewGetSystemAttrs(&supportsAltiVec, sizeof(supportsAltiVec),
	    SYSTEMINFOTYPE_PPC_ALTIVEC, TAG_DONE) > 0)
		return supportsAltiVec;

	return false;
# endif

	return false;
}
#endif
@end