ObjFW  Check-in [e73d0702d0]

Overview
Comment:OFSystemInfo: Do not use sysctl to get CPU vendor

The sysctl name is specific to x86 on macOS and NetBSD, so cannot be
used for other architectures and the CPU vendor on x86 can just be
obtained via cpuid.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e73d0702d0a502eac0b419b2580da67dd16e79eac7dec38d4c577523a82e3345
User & Date: js on 2020-11-02 01:11:34
Other Links: manifest | tags
Context
2020-11-02
22:13
OFString+PathAdditions: Fix typo check-in: 1042afedd9 user: js tags: trunk
01:11
OFSystemInfo: Do not use sysctl to get CPU vendor check-in: e73d0702d0 user: js tags: trunk
00:56
OFSystemInfo: Minor cleanup check-in: 9903dedecb user: js tags: trunk
Changes

Modified src/OFSystemInfo.m from [a8432f0c63] to [97e07274dd].

564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
		buffer[i++] = regs.eax;
		buffer[i++] = regs.ebx;
		buffer[i++] = regs.ecx;
		buffer[i++] = regs.edx;
	}

	return [OFString stringWithCString: (char *)buffer
				  encoding: OF_STRING_ENCODING_ASCII];
#elif defined(OF_MACOS) || defined(OF_NETBSD)
	char value[256];
	size_t length = sizeof(value);

# if defined(OF_MACOS)
	if (sysctlbyname("machdep.cpu.brand_string",
# elif defined(OF_NETBSD)
	if (sysctlbyname("machdep.cpu_brand",
# endif
	    &value, &length, NULL, 0) != 0)
		return nil;

	return [OFString stringWithCString: value
				  encoding: OF_STRING_ENCODING_ASCII];
#elif defined(OF_AMIGAOS4)
	CONST_STRPTR model, version;

	GetCPUInfoTags(GCIT_ModelString, &model,
	    GCIT_VersionString, &version, TAG_END);








<
<
<
<
<
<
<
<
<
<
<
<
<
<







564
565
566
567
568
569
570














571
572
573
574
575
576
577
		buffer[i++] = regs.eax;
		buffer[i++] = regs.ebx;
		buffer[i++] = regs.ecx;
		buffer[i++] = regs.edx;
	}

	return [OFString stringWithCString: (char *)buffer














				  encoding: OF_STRING_ENCODING_ASCII];
#elif defined(OF_AMIGAOS4)
	CONST_STRPTR model, version;

	GetCPUInfoTags(GCIT_ModelString, &model,
	    GCIT_VersionString, &version, TAG_END);