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

Fix Windows build with MSVC 19.41 #2065

Merged
merged 1 commit into from
Sep 6, 2024
Merged

Conversation

svenvh
Copy link
Member

@svenvh svenvh commented Sep 2, 2024

Include cmath instead of math.h in C++ mode under MSVC, to avoid
build errors inside the header. Ideally we would not condition this
on _MSC_VER, but issue 1833 currently prevents doing so.

Include `cmath` instead of `math.h` in C++ mode under MSVC, to avoid
build errors inside the header.  Ideally we would not condition this
on `_MSC_VER`, but issue 1833 currently prevents doing so.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
@svenvh svenvh changed the title [WIP] Debug Windows build Fix Windows build with MSVC 19.41 Sep 2, 2024
@svenvh svenvh marked this pull request as ready for review September 2, 2024 09:15
Copy link
Contributor

@delecui delecui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix works fine for me.
I was evaluating removing the macros like isinf, isnan, and other ones from compat.h that conflict with cmath in MSVC 19.41.
However, this fix is more concise and safer.

@svenvh
Copy link
Member Author

svenvh commented Sep 3, 2024

I was evaluating removing the macros like isinf, isnan, and other ones from compat.h that conflict with cmath in MSVC 19.41.

As I don't have access to an MSVC environment, I wasn't quite sure what was causing the trouble (so my fix was a shot in the dark essentially). Good to know that those macros are the culprit, we should prioritize #1833 then.

@bashbaug bashbaug linked an issue Sep 3, 2024 that may be closed by this pull request
Copy link
Contributor

@bashbaug bashbaug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

#1833 is already on Mobica's backlog so hopefully this is a short-term fix and we can include cmath unconditionally soon.

@bashbaug
Copy link
Contributor

bashbaug commented Sep 3, 2024

I think we should merge this ASAP to unblock CI builds. @lakshmih and others, any concerns?

@svenvh
Copy link
Member Author

svenvh commented Sep 6, 2024

Merging to get CI back to green. If any concerns/issues are reported post-merge, we can consider reverting and investigate an alternative solution.

@svenvh svenvh merged commit ce68069 into KhronosGroup:main Sep 6, 2024
7 checks passed
@svenvh svenvh deleted the win-build branch September 6, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows CI builds are failing
3 participants