morphologica icon indicating copy to clipboard operation
morphologica copied to clipboard

replace __WIN__ with WIN32

Open niclar opened this issue 2 years ago • 3 comments

-Would you consider replacing the "WIN" define with the standard "WIN32" instead ?

niclar avatar Mar 15 '22 15:03 niclar

I would consider this. However, I'm not very knowledgeable about Windows. A quick google suggests that WIN32 is defined whether you're compiling 32 or 64 bit Windows. Right? Is it safe to use the WIN32 definition as just meaning "this is Windows" and you have to use an alternative test if you want to determine whether it's a 32 or 64 bit compilation?

sebjameswml avatar Mar 15 '22 16:03 sebjameswml

Yes WIN32 is defined for both so that's the pragmatic way

niclar avatar Mar 15 '22 16:03 niclar

I'm thinking about this one. Right now I have a scheme where I use cmake to probe the host OS and then I define a tag accordingly. What you suggest is pragmatic, and means that the code could be used on Windows without the developer needing to define an extra label when calling their compiler, but if I were to make the change, then I should consider whether to use #ifdef APPLE on MacOS and what I should do on Linux/BSD.

sebjameswml avatar Mar 15 '22 17:03 sebjameswml

I am happy with using WIN as a tag for Windows.

sebjameswml avatar Feb 01 '23 14:02 sebjameswml