From 8f9a0dd2be9ad06e798ee0b8eba5df5944395a9d Mon Sep 17 00:00:00 2001 From: Tyler Kaminski Date: Thu, 1 Jan 2026 09:35:17 -0800 Subject: [PATCH] xonotic: fix build with c23 --- pkgs/games/xonotic/default.nix | 2 + pkgs/games/xonotic/fix-build-with-c23.patch | 43 +++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 pkgs/games/xonotic/fix-build-with-c23.patch diff --git a/pkgs/games/xonotic/default.nix b/pkgs/games/xonotic/default.nix index d012dc1f899d..7632190672b7 100644 --- a/pkgs/games/xonotic/default.nix +++ b/pkgs/games/xonotic/default.nix @@ -91,6 +91,8 @@ let hash = "sha256-i5KseBz/SuicEhoj6s197AWiqr7azMI6GdGglYtAEqg="; }; + patches = [ ./fix-build-with-c23.patch ]; + nativeBuildInputs = [ unzip ]; buildInputs = [ libjpeg diff --git a/pkgs/games/xonotic/fix-build-with-c23.patch b/pkgs/games/xonotic/fix-build-with-c23.patch new file mode 100644 index 000000000000..ce540aa92f5a --- /dev/null +++ b/pkgs/games/xonotic/fix-build-with-c23.patch @@ -0,0 +1,43 @@ +--- + dpsoftrast.c | 4 ---- + qtypes.h | 7 +------ + 2 files changed, 1 insertion(+), 10 deletions(-) + +diff --git a/dpsoftrast.c b/dpsoftrast.c +index fff29b8..1eda341 100644 +--- a/dpsoftrast.c ++++ b/dpsoftrast.c +@@ -10,10 +10,6 @@ + #pragma warning(disable : 4324) + #endif + +-#ifndef __cplusplus +-typedef qboolean bool; +-#endif +- + #define ALIGN_SIZE 16 + #define ATOMIC_SIZE 4 + +diff --git a/qtypes.h b/qtypes.h +index 6c09614..e6e277b 100644 +--- a/qtypes.h ++++ b/qtypes.h +@@ -2,14 +2,9 @@ + #ifndef QTYPES_H + #define QTYPES_H + +-#undef true +-#undef false ++#include + +-#ifndef __cplusplus +-typedef enum qboolean_e {false, true} qboolean; +-#else + typedef bool qboolean; +-#endif + + #ifndef NULL + #define NULL ((void *)0) +-- +2.50.1 +