Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use _WIN32 instead of _MSC_VER #270

Merged
merged 1 commit into from
Jan 28, 2023
Merged

Conversation

giordano
Copy link
Contributor

This macro should check that the target is Windows, not that the compiler is Microsoft Visual Studio Code, which would prevent compilation with MinGW.

There are other instances of _MSC_VER which look suspiciously wrong, but this is the only one I found strictly necessary to compile libucl with MinGW.

This macro should check that the target is Windows, not that the compiler is Microsoft Visual Studio Code, which would prevent compilation with MinGW.
@vstakhov
Copy link
Owner

Is _WIN32 defined on 64 bit windows platforms?

@giordano
Copy link
Contributor Author

It is:

_WIN32 Defined as 1 when the compilation target is 32-bit ARM, 64-bit ARM, x86, or x64. Otherwise, undefined.

That's the only macro that should be used to test a Windows target. _MSC_VER is only reliably defined by Visual Studio Code, it may not be defined by other compilers targeting Windows.

@vstakhov vstakhov merged commit c837438 into vstakhov:master Jan 28, 2023
@giordano giordano deleted the patch-1 branch January 28, 2023 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants