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

Jacek Caban jacek at codeweavers.com
Tue Apr 28 14:08:39 CDT 2020


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.


  include/guiddef.h | 2 +-
  include/ntdef.h   | 2 +-
  include/windef.h  | 4 ++--
  include/winnt.h   | 2 +-
  4 files changed, 5 insertions(+), 5 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-include-Use-long-for-LONG-type-on-Windows-targets-iff-.txt
Type: text/x-patch
Size: 2167 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200428/eb237162/attachment.bin>


More information about the wine-devel mailing list