Prevent the use of windowsx.h with Wine source.
Robert Shearman
rob at codeweavers.com
Sun Mar 19 06:41:15 CST 2006
Mike McCormack wrote:
>
> Robert Shearman wrote:
>
>> Why don't we fix the macros as suggested by Francois, rather than
>> preventing its use? It seems like a big waste of time to have submitted
>> all of the patches to the files using windowsx.h when fixing the macros
>> is necessary for Winelib anyway.
>
>
> No, it's not a waste of time. Having warning free Wine source code is
> far more important than any warnings that might be in 3rd party
> winelib code.
>
> Francois' solution is still not perfect, as it requires use of a
> non-portable C construct.
We're trying to work around GCC warnings that probably aren't generated
using any other compiler so using non-portable C constructs is perfectly
fine. Here is Francois' solution again:
> +#ifndef WINE_CAST
> +# if __GNUC__
> +# define WINE_CAST(ctype, val) ({ctype r=(ctype)(val);r;})
> +# else
> +# define WINE_CAST(ctype, val) ((ctype)(val))
> +# endif
> +#endif
> +
> + #define Header_SetImageList(hwnd,himl) \
> - (HIMAGELIST)SNDMSGA((hwnd),HDM_SETIMAGELIST,0,(LPARAM)himl)
> + WINE_CAST(HIMAGELIST,
> SNDMSGA((hwnd),HDM_SETIMAGELIST,0,(LPARAM)himl))
> +
It seemed to be ignored by both you and Alexandre last time it was sent,
and all of your patches applied anyway despite objections from several
developers.
--
Rob Shearman
More information about the wine-devel
mailing list