Index: src/OFSystemInfo.h ================================================================== --- src/OFSystemInfo.h +++ src/OFSystemInfo.h @@ -84,11 +84,11 @@ * * @return The vendor of the CPU */ + (nullable OFString*)CPUVendor; -#if defined(OF_X86_64_ASM) || defined(OF_X86_ASM) || defined(DOXYGEN) +#if defined(OF_X86_64) || defined(OF_X86) || defined(DOXYGEN) /*! * @brief Returns whether the CPU supports MMX. * * @note This method is only available on x86 and x86_64. * Index: src/OFSystemInfo.m ================================================================== --- src/OFSystemInfo.m +++ src/OFSystemInfo.m @@ -45,39 +45,32 @@ #endif #ifdef OF_QNX # include #endif -#if defined(OF_X86_64_ASM) || defined(OF_X86_ASM) +#if defined(OF_X86_64) || defined(OF_X86) struct x86_regs { uint32_t eax, ebx, ecx, edx; }; #endif static size_t pageSize; static size_t numberOfCPUs; -#if defined(OF_X86_64_ASM) +#if defined(OF_X86_64) || defined(OF_X86) static OF_INLINE struct x86_regs OF_CONST_FUNC x86_cpuid(uint32_t eax, uint32_t ecx) { struct x86_regs regs; +# if defined(OF_X86_64_ASM) __asm__( "cpuid" : "=a"(regs.eax), "=b"(regs.ebx), "=c"(regs.ecx), "=d"(regs.edx) : "a"(eax), "c"(ecx) ); - - return regs; -} -#elif defined(OF_X86_ASM) -static OF_INLINE struct x86_regs OF_CONST_FUNC -x86_cpuid(uint32_t eax, uint32_t ecx) -{ - struct x86_regs regs; - +# elif deifned(OF_X86_ASM) /* * This workaround is required by GCC when using -fPIC, as ebx is a * special register in PIC code. Yes, GCC is indeed not able to just * push a register onto the stack before the __asm__ block and to pop * it afterwards. @@ -88,10 +81,13 @@ "movl %%ebx, %1\n\t" "popl %%ebx" : "=a"(regs.eax), "=r"(regs.ebx), "=c"(regs.ecx), "=d"(regs.edx) : "a"(eax), "c"(ecx) ); +# else + memset(®s, 0, sizeof(regs)); +# endif return regs; } #endif @@ -323,11 +319,11 @@ #else return nil; #endif } -#if defined(OF_X86_64_ASM) || defined(OF_X86_ASM) +#if defined(OF_X86_64) || defined(OF_X86) + (bool)supportsMMX { return (x86_cpuid(1, 0).edx & (1 << 23)); } Index: src/resolver.m ================================================================== --- src/resolver.m +++ src/resolver.m @@ -21,12 +21,13 @@ #include #include #include #include -#import "macros.h" #import "resolver.h" + +#import "macros.h" #if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS) # include "threading.h" #endif