Skip to content

[build] Shift __cplusplus check to a higher level for bool type define#5804

Merged
raysan5 merged 5 commits into
raysan5:masterfrom
lamweilun:dev/weilun/missing_defined_check
Apr 29, 2026
Merged

[build] Shift __cplusplus check to a higher level for bool type define#5804
raysan5 merged 5 commits into
raysan5: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 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!

@lamweilun lamweilun changed the title 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 Shifts __cplusplus check to a higher level for bool type define Apr 28, 2026
@lamweilun
Copy link
Copy Markdown
Contributor Author

@raysan5 Thanks for the review. I have kept this to just the shifting of the C++ check

@raysan5 raysan5 changed the title Shifts __cplusplus check to a higher level for bool type define [build] Shift __cplusplus check to a higher level for bool type define Apr 28, 2026
@raysan5 raysan5 merged commit d768dae into raysan5:master Apr 29, 2026
16 checks passed
@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Apr 29, 2026

@lamweilun thanks for the review... wondering why it was not reported before...

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