diff --git a/pkgs/games/maelstrom/c++17-fixes.diff b/pkgs/games/maelstrom/c++17-fixes.diff new file mode 100644 index 000000000000..fa43edfb6747 --- /dev/null +++ b/pkgs/games/maelstrom/c++17-fixes.diff @@ -0,0 +1,32 @@ +diff --git a/fastrand.cpp b/fastrand.cpp +index 3714f02..d1cf224 100644 +--- a/fastrand.cpp ++++ b/fastrand.cpp +@@ -30,10 +30,10 @@ Uint32 GetRandSeed(void) + Uint16 FastRandom(Uint16 range) + { + Uint16 result; +- register Uint32 calc; +- register Uint32 regD0; +- register Uint32 regD1; +- register Uint32 regD2; ++ Uint32 calc; ++ Uint32 regD0; ++ Uint32 regD1; ++ Uint32 regD2; + + #ifdef SERIOUS_DEBUG + fprintf(stderr, "FastRandom(%hd) Seed in: %lu ", range, randomSeed); +diff --git a/screenlib/SDL_FrameBuf.cpp b/screenlib/SDL_FrameBuf.cpp +index 2f7b44c..c8e394b 100644 +--- a/screenlib/SDL_FrameBuf.cpp ++++ b/screenlib/SDL_FrameBuf.cpp +@@ -555,7 +555,7 @@ static inline void memswap(Uint8 *dst, Uint8 *src, Uint8 len) + } + #else + /* Swap two buffers using a temporary variable */ +- register Uint8 tmp; ++ Uint8 tmp; + + while ( len-- ) { + tmp = *dst; diff --git a/pkgs/games/maelstrom/default.nix b/pkgs/games/maelstrom/default.nix index 45318987dca6..675a85dd8681 100644 --- a/pkgs/games/maelstrom/default.nix +++ b/pkgs/games/maelstrom/default.nix @@ -9,8 +9,12 @@ stdenv.mkDerivation rec { sha256 = "0dm0m5wd7amrsa8wnrblkv34sq4v4lglc2wfx8klfkdhyhi06s4k"; }; - # this fixes a typedef compilation error with gcc-3.x - patches = [ ./fix-compilation.patch ]; + patches = [ + # this fixes a typedef compilation error with gcc-3.x + ./fix-compilation.patch + # removes register keyword + ./c++17-fixes.diff + ]; buildInputs = [ SDL2 SDL2_net ];