Fix compilation on gcc13#1
Conversation
| #if defined(DOOM_WIN32) | ||
|
|
||
|
|
||
| #define X_OK 0 |
There was a problem hiding this comment.
The mismatch causes a compilation warning on mingw64 when it is redefined from 1 to 0.
X_OK is meant to be used as a bitmask so it doesn't make sense to be 0 and I have also confimed that it has a value of 1 on other operating systems, as well as in mingw's and cygwin's compat library.
The man also states:
The constants F_OK, R_OK, W_OK, and X_OK and the expressions R_OK|W_OK, R_OK|X_OK, and R_OK|W_OK|X_OK shall all have distinct values.
That being said it isn't used by PureDOOM.h, and it's just a warning (and presumably only present on mingw, not msvc). So I can undo the change if you prefer!
|
PureDOOM is a separate library so it might be worth moving the extra notes there https://github.com/Daivuk/PureDOOM/ Other than the |
Yeah that is fair enough, I shouldn't have modified a dependency. Especially that it isn't necessary to fix the build issue, the Makefile change alone is enough. I'll consider sending that line to PureDOOM instead! |
|
Thanks for the explanation. It definitely seems kinda weird that puredoom is defining itself own F_OK then. Thanks for the fixes! |
The project fails to build on gcc13 (and possibly recent clang too) because they now default to std23.
This patch adds compiler flags to build in c99 mode. This is the easier fix and it is in line with RGFW's goal of having c99 as a baseline.
But if you prefer I can also fix the issues in DOOM directly instead:
typedef int doom_booleanis a possible fix. Another is to rely on stdbool.