WIN32, _WIN32 and option: pragma

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

WIN32, _WIN32 and option: pragma

alistairgrant
 
Hi Everyone,

Would someone mind clarifying how I should be using the windows
platform macros.  My understanding is:

- WIN32 is defined by the VM build scripts on Windows 32 bit only
- WIN64 is defined by the VM build scripts on Windows 64 bit only
- _WIN32 is defined by the compiler on Windows 32 and 64 bit.
- _WIN64 is defined by the compiler on Windows 64 bit only.

If my understanding is incorrect, please correct me.

If I want code that only runs on Windows (32 or 64 bit), I should
check if _WIN32 is defined.

The FileAttributesPlugin has a method with "<option: #WIN32>", which
causes it to only be compiled on Windows 32 bit, while I also need it on
Windows 64 bit.

"<option: #_WIN32>" isn't recognised, so the code is never generated,
and I couldn't figure out how to have #WIN32 OR #WIN64.

What's the correct solution?


Thanks!
Alistair
Reply | Threaded
Open this post in threaded view
|

Re: WIN32, _WIN32 and option: pragma

Eliot Miranda-2
 
Hi Alistair,

On Mon, Feb 5, 2018 at 6:33 PM, Alistair Grant <[hidden email]> wrote:

Hi Everyone,

Would someone mind clarifying how I should be using the windows
platform macros.  My understanding is:

- WIN32 is defined by the VM build scripts on Windows 32 bit only
- WIN64 is defined by the VM build scripts on Windows 64 bit only
- _WIN32 is defined by the compiler on Windows 32 and 64 bit.
- _WIN64 is defined by the compiler on Windows 64 bit only.

If my understanding is incorrect, please correct me.

If I want code that only runs on Windows (32 or 64 bit), I should
check if _WIN32 is defined.

The FileAttributesPlugin has a method with "<option: #WIN32>", which
causes it to only be compiled on Windows 32 bit, while I also need it on
Windows 64 bit.

"<option: #_WIN32>" isn't recognised, so the code is never generated,
and I couldn't figure out how to have #WIN32 OR #WIN64.

Sorry not to have got to this sooner, but the support is in there now.  So by all means use <option: #_WIN32> now.
 

What's the correct solution?


Thanks!
Alistair



--
_,,,^..^,,,_
best, Eliot
Reply | Threaded
Open this post in threaded view
|

Re: WIN32, _WIN32 and option: pragma

alistairgrant
 
Hi Eliot,

On 17 February 2018 at 00:10, Eliot Miranda <[hidden email]> wrote:

>
> Hi Alistair,
>
> On Mon, Feb 5, 2018 at 6:33 PM, Alistair Grant <[hidden email]> wrote:
>>
>>
>> Hi Everyone,
>>
>> Would someone mind clarifying how I should be using the windows
>> platform macros.  My understanding is:
>>
>> - WIN32 is defined by the VM build scripts on Windows 32 bit only
>> - WIN64 is defined by the VM build scripts on Windows 64 bit only
>> - _WIN32 is defined by the compiler on Windows 32 and 64 bit.
>> - _WIN64 is defined by the compiler on Windows 64 bit only.
>>
>> If my understanding is incorrect, please correct me.
>>
>> If I want code that only runs on Windows (32 or 64 bit), I should
>> check if _WIN32 is defined.
>>
>> The FileAttributesPlugin has a method with "<option: #WIN32>", which
>> causes it to only be compiled on Windows 32 bit, while I also need it on
>> Windows 64 bit.
>>
>> "<option: #_WIN32>" isn't recognised, so the code is never generated,
>> and I couldn't figure out how to have #WIN32 OR #WIN64.
>
>
> Sorry not to have got to this sooner, but the support is in there now.  So by all means use <option: #_WIN32> now.


Thanks!  I'm focusing on the in-image integration at the moment, but
I'll definitely change this back to using the option: pragma.

Cheers,
Alistair