kernel32: implement CPU detection for OpenBSD

Austin English austinenglish at gmail.com
Sat Jan 3 11:43:13 CST 2009


On Sat, Jan 3, 2009 at 5:43 AM, Rob Shearman <robertshearman at gmail.com> wrote:
> 2009/1/3 Austin English <austinenglish at gmail.com>:
>> diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c
>> index 63ca277..10a8e87 100644
>> --- a/dlls/kernel32/cpu.c
>> +++ b/dlls/kernel32/cpu.c
>> @@ -544,7 +544,7 @@ VOID WINAPI GetSystemInfo(
>>       }
>>       fclose (f);
>>       }
>> -#elif defined (__NetBSD__)
>> +#elif defined (__NetBSD__) || defined(__OpenBSD__)
>>          {
>>               int mib[2];
>>               int value[2];
>
> Why not just do something like the following:
> #ifdef __OpenBSD___
> size_t value[2];
> #else
> int value[2];
> #endif
>
> And then you wouldn't have to ifdef each sysctl call.
>
>> @@ -557,31 +557,55 @@ VOID WINAPI GetSystemInfo(
>>  #ifdef CPU_FPU_PRESENT
>>               mib[1] = CPU_FPU_PRESENT;
>>               value[1] = sizeof(int);
>> -             if (sysctl(mib, 2, value, value+1, NULL, 0) >= 0)
>> +#ifdef __OpenBSD__
>> +             if (sysctl(mib, 2, value, (size_t *)(value+1), NULL, 0) >= 0) {
>> +#else
>> +             if (sysctl(mib, 2, value, value+1, NULL, 0) >= 0) {
>> +#endif
> ...
>
> --
> Rob Shearman
>

Good catch! It was late and I was working on getting patches from
their port in upstream. I'll work on a new one.

-- 
-Austin



More information about the wine-devel mailing list