Fix MSVC compilation error in types.hpp#35
Open
Snesnopic wants to merge 2 commits into
Open
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Hi, I'm using kanzi-cpp as a library in my project, and in the Windows runners, where I use MSVC and compile kanzi as a static library, I get this error:
I've cloned your repository and took a look in types.hpp: you have written this comment
but haven't applied the _MSVC_LANG checks in lines 31 (which imports cstddef) and 209 (which creates the byte macro). I've added these checks and the libkanzi target now compiles without this error.
Also, there is a similar problem when trying to compile with ARM64 as target on MSVC:
It is trying to use an intrinsic, defined like this
even though we are on ARM; the problem is still in types.hpp, line 49
where it is assumed that, since we are on Windows, then we must be on x86_64. A similar thing happens in the #if right below this; I fixed this by adding a check to see if _M_X64 (and _MIX86 under it) are actually defined, and libkanzi now compiles with no problems on my two Windows runners.