Skip to content

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

Merged
mborgerson merged 1 commit into
XboxDev:masterfrom
thrimbor:bool_fix
May 15, 2025
Merged

Fix: Don't try to redefine bool on C99 and higher#99
mborgerson merged 1 commit into
XboxDev:masterfrom
thrimbor:bool_fix

Conversation

@thrimbor

Copy link
Copy Markdown
Member

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

Comment thread extract-xiso.c

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

@mborgerson mborgerson May 15, 2025

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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