Skip to content

Shifts __cplusplus check to a higher level for bool type define. Fixes raymath floating point comparison issues. Adds missing default define for RAYMATH_USE_SIMD_INTRINSICS#5804

Open
lamweilun wants to merge 4 commits intoraysan5:masterfrom
lamweilun:dev/weilun/missing_defined_check

Conversation

@lamweilun
Copy link
Copy Markdown
Contributor

@lamweilun lamweilun commented Apr 25, 2026

The main reason for this change is that, C++ compilers, or at least g++ and clang++ from my own testing, defines STDC but not STDC_VERSION. And when compiling with -Wundef, it would trigger an error when its checking for STDC_VERSION.

This change basically says, check if you're a C++ compiler first before even entering any of the bool type definition since C++ has bool as a built-in type.

@lamweilun lamweilun changed the title Adds a missing macro definition check Adds a missing macro definition check for __STDC_VERSION__ Apr 25, 2026
@lamweilun lamweilun changed the title Adds a missing macro definition check for __STDC_VERSION__ Shifts __cplusplus check to a higher level for bool define Apr 25, 2026
@lamweilun
Copy link
Copy Markdown
Contributor Author

lamweilun commented Apr 25, 2026

I have also bolted on some additional fixes for raymath, mostly its with the floating point comparison fixes. Also there's a missing base define for RAYMATH_USE_SIMD_INTRINSICS, so I added one for it

@lamweilun lamweilun changed the title Shifts __cplusplus check to a higher level for bool define Shifts __cplusplus check to a higher level for bool define. Fixes raymath floating point comparison issues Apr 26, 2026
@lamweilun lamweilun changed the title Shifts __cplusplus check to a higher level for bool define. Fixes raymath floating point comparison issues Shifts __cplusplus check to a higher level for bool type define.Fixes raymath floating point comparison issues. Fixes Apr 26, 2026
@lamweilun lamweilun changed the title Shifts __cplusplus check to a higher level for bool type define.Fixes raymath floating point comparison issues. Fixes Shifts __cplusplus check to a higher level for bool type define. Fixes raymath floating point comparison issues. Adds missing default define for RAYMATH_USE_SIMD_INTRINSICS Apr 26, 2026
@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Apr 27, 2026

@lamweilun Please, could you split those changes into two separate PRs, also, raymath convention is avoiding functions calling other functions, please, review that, thanks!

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.

2 participants