[PATCH 2/2] include: Use long for LONG type on Windows targets iff not building Wine.
Chip Davis
cdavis at codeweavers.com
Tue Apr 28 15:50:34 CDT 2020
April 28, 2020 2:39 PM, "Alex Henrie" <alexhenrie24 at gmail.com> wrote:
> On Tue, Apr 28, 2020 at 1:16 PM Chip Davis <cdavis at codeweavers.com> wrote:
>
>> April 28, 2020 2:15 PM, "Alex Henrie" <alexhenrie24 at gmail.com> wrote:
>>
>> This might be a dumb question, but why not define LONG to be int32_t
>> on all platforms?
>>
>> Uhh, because 'int32_t' isn't necessarily 'long' on Windows?
>
> According to MSDN, LONG is a 32-bit signed integer.[1] Is the problem
> that if a program uses LONG in a function declaration and then long in
> the function definition, it wouldn't compile if LONG is defined to be
> int, even on a 32-bit MSVC-like platform where both int and long
> represent 32-bit signed integers?
Pretty much. Well that, and you'll see warnings if you use an expression of type 'LONG' with a printf(3) format spec like "%ld".
>
> -Alex
>
> [1] https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
Chip
More information about the wine-devel
mailing list