mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 19:21:04 +00:00
maelstrom: remove register keyword; fix clang
c++17 doesn't support register keyword. patch out the few uses of it.
This commit is contained in:
parent
89ece45c32
commit
f1644ee95e
32
pkgs/games/maelstrom/c++17-fixes.diff
Normal file
32
pkgs/games/maelstrom/c++17-fixes.diff
Normal file
|
@ -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;
|
|
@ -9,8 +9,12 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "0dm0m5wd7amrsa8wnrblkv34sq4v4lglc2wfx8klfkdhyhi06s4k";
|
sha256 = "0dm0m5wd7amrsa8wnrblkv34sq4v4lglc2wfx8klfkdhyhi06s4k";
|
||||||
};
|
};
|
||||||
|
|
||||||
# this fixes a typedef compilation error with gcc-3.x
|
patches = [
|
||||||
patches = [ ./fix-compilation.patch ];
|
# this fixes a typedef compilation error with gcc-3.x
|
||||||
|
./fix-compilation.patch
|
||||||
|
# removes register keyword
|
||||||
|
./c++17-fixes.diff
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = [ SDL2 SDL2_net ];
|
buildInputs = [ SDL2 SDL2_net ];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue