ObjFW  Diff

Differences From Artifact [3f56016e9e]:

To Artifact [3a242f30a6]:


549
550
551
552
553
554
555
















556
557
558
559
560
561
562
563
#else
	return nil;
#endif
}

+ (OFString *)CPUModel
{
















#if 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",







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|







549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
#else
	return nil;
#endif
}

+ (OFString *)CPUModel
{
#if defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
	uint32_t buffer[12];
	size_t i;

	i = 0;
	for (uint32_t eax = 0x80000002; eax <= 0x80000004; eax++) {
		struct x86_regs regs = x86_cpuid(eax, 0);

		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",