Skip to content

Conversation

@ducalex
Copy link
Contributor

@ducalex ducalex commented Sep 30, 2025

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:

  • Function declarations now have to be full prototypes. It can be fixed by completing the prototypes in PureDOOM.h line 16482-16558 or by removing those definitions and moving the array data of state_t states[NUMSTATES] lower down, after they've been declared.
  • true/false are now keywords, so it doesn't like the typedef enum in PureDOOM.h. Removing the enum and keeping only typedef int doom_boolean is a possible fix. Another is to rely on stdbool.

#if defined(DOOM_WIN32)


#define X_OK 0
Copy link
Owner

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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!

@ColleagueRiley
Copy link
Owner

ColleagueRiley commented Sep 30, 2025

PureDOOM is a separate library so it might be worth moving the extra notes there https://github.com/Daivuk/PureDOOM/

Other than the #define X_OK 0 part, which I'm, unsure about. This looks good. It might be worth compiling PureDOOM on it's own. At some point I'd like to make another DOOM source port that uses RGFW without using PureDOOM.

@ducalex
Copy link
Contributor Author

ducalex commented Oct 1, 2025

PureDOOM is a separate library so it might be worth moving the extra notes there

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!

@ColleagueRiley
Copy link
Owner

Thanks for the explanation. It definitely seems kinda weird that puredoom is defining itself own F_OK then.

Thanks for the fixes!

@ColleagueRiley ColleagueRiley merged commit 18f1dd1 into ColleagueRiley:main Oct 1, 2025
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