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

Rename bool union member #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

a3a3el
Copy link
Contributor

@a3a3el a3a3el commented Mar 13, 2025

In C23, bool has been changed from a macro defined in <stdbool.h>, which expands to _Bool, to a keyword. The var union defined in wmgeneral.h contains a member named bool, which is, therefore, not compatible with C23. The next version of gcc defaults to C23, and so this union member will cause compilation to fail. Rename it to boolean.

Replace if (cond) { x = 1; } else { x = 0; } with x = cond;

In C23, `bool` has been changed from a macro defined in `<stdbool.h>`, which
expands to `_Bool`, to a keyword.  The `var` union defined in wmgeneral.h
contains a member named `bool`, which is, therefore, not compatible with C23.
The next version of gcc defaults to C23, and so this union member will cause
compilation to fail.  Rename it to `boolean`.

Replace `if (cond) { x = 1; } else { x = 0; }` with `x = cond;`

Signed-off-by: Jeremy Sowden <[email protected]>
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.

1 participant