[PATCH 2/2] include: Use long for LONG type on Windows targets iff not building Wine.

Alexandre Julliard julliard at winehq.org
Wed Apr 29 15:44:06 CDT 2020


Jacek Caban <jacek at codeweavers.com> writes:

> Signed-off-by: Jacek Caban <jacek at codeweavers.com>
> ---
>
> Right now we use _MSC_VER to choose between long and int type. We
> could, however, make any other choice. With patch 1, it's possible to
> use int with MSVC (or at least clang MSVC target). It's also possible
> for any other compilers except __LP64__ to use long.
>
> This raises some questions and I wouldn't mind changing the patch. For
> example, I could change headers to always use int. The problem with
> that is that it makes us incompatible with the rest of Windows world.
>
> In the past, the choice of int for LONG was motivated by port to
> Win64, where we can't use long on UNIX side and it's nice to have the
> same time on all targets.
>
> This patch is a compromise: it always uses int for Wine itself, so as
> far as building Wine is considered, it's consistent among
> compilers. Outside Wine, it uses long on Windows targets, where the
> code is most likely to depend on underlying type. And it keeps using
> int for non-Windows targets, so nothing changes for non-PE winelib.
>
> If there is a need for int LONG on Windows targets, we could introduce
> a macro to change that choice. I could also imagine revisiting the
> choice for PE parts of Wine itself, but it would be a lot of work.

All of these options are of course possible, but it doesn't seem to me
that any of them has a clear advantage over what we are doing now. Are
there real problems with the current approach that we need to address?

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list