Skip to content

Fix: Don't try to redefine bool on C99 and higher #99

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

Merged
merged 1 commit into from
May 15, 2025

Conversation

thrimbor
Copy link
Member

Fixes compiler errors on newer GCC, where bool is treated as a keyword.

@@ -369,7 +369,9 @@
#endif


#if ! defined( __cplusplus ) && ! defined( bool )
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <stdbool.h>
Copy link
Member

@mborgerson mborgerson May 15, 2025

Choose a reason for hiding this comment

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

Why not just drop all the checks and just use stdbool.h? Do we care about supporting ancient C versions?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know how the situation is on Windows/MSVC, I know it didn't support modernish C versions in the past, so this was the easiest thing to do without having to fire up a Windows installation.

Copy link
Member

Choose a reason for hiding this comment

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

CI builds on Windows with msvc

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like it works

Copy link
Member

Choose a reason for hiding this comment

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

Awesome, thx

@mborgerson mborgerson merged commit b72e5b6 into XboxDev:master May 15, 2025
8 checks passed
@thrimbor thrimbor deleted the bool_fix branch May 15, 2025 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants