kernel32: implement CPU detection for OpenBSD

Rob Shearman robertshearman at gmail.com
Sat Jan 3 05:43:09 CST 2009


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



More information about the wine-devel mailing list