diff options
Diffstat (limited to 'games-action/openlierox/files/openlierox-0.58_rc3-fix-c++14.patch')
-rw-r--r-- | games-action/openlierox/files/openlierox-0.58_rc3-fix-c++14.patch | 215 |
1 files changed, 215 insertions, 0 deletions
diff --git a/games-action/openlierox/files/openlierox-0.58_rc3-fix-c++14.patch b/games-action/openlierox/files/openlierox-0.58_rc3-fix-c++14.patch new file mode 100644 index 000000000000..a90716142e07 --- /dev/null +++ b/games-action/openlierox/files/openlierox-0.58_rc3-fix-c++14.patch @@ -0,0 +1,215 @@ +static_assert is a reserved keyword in C++14 now. + +--- a/include/CGameScript.h ++++ b/include/CGameScript.h +@@ -40,7 +40,7 @@ + // current most recent version + #define GS_VERSION 8 + +-static_assert(GS_VERSION - GS_FIRST_SUPPORTED_VERSION + 1 == sizeof(GS_MinLxVersion)/sizeof(Version), GS_MinLxVersion__sizecheck); ++static_openlierox_assert(GS_VERSION - GS_FIRST_SUPPORTED_VERSION + 1 == sizeof(GS_MinLxVersion)/sizeof(Version), GS_MinLxVersion__sizecheck); + + // Error codes + #define GSE_OK 1 +--- a/include/EndianSwap.h ++++ b/include/EndianSwap.h +@@ -23,7 +23,7 @@ + + template <int n> + void ByteSwap(unsigned char * b) { +- static_assert(n == 1 || n % 2 == 0, n_must_be_equal); ++ static_openlierox_assert(n == 1 || n % 2 == 0, n_must_be_equal); + for(int i = 0; i < n/2; ++i) { + std::swap(b[i], b[n - i - 1]); + } +@@ -57,8 +57,8 @@ + + template <int size, int nmemb, typename T> + static size_t fwrite_endian_compat_wrapper(FILE* stream, T d) { +- static_assert(nmemb == 1, nmemb__equals1); +- static_assert(size == sizeof(T), size__mismatch); ++ static_openlierox_assert(nmemb == 1, nmemb__equals1); ++ static_openlierox_assert(size == sizeof(T), size__mismatch); + EndianSwap(d); + return fwrite(&d, sizeof(T), 1, stream); + } +@@ -69,8 +69,8 @@ + + template <int size, int nmemb, typename T> + static size_t fread_compat_wrapper(FILE* stream, T& d) { +- static_assert(nmemb == 1, nmemb__equals1); +- static_assert(size == sizeof(T), size__mismatch); ++ static_openlierox_assert(nmemb == 1, nmemb__equals1); ++ static_openlierox_assert(size == sizeof(T), size__mismatch); + return fread(&d, sizeof(T), 1, stream); + } + +--- a/include/ProjAction.h ++++ b/include/ProjAction.h +@@ -125,7 +125,7 @@ + __TRL_UBOUND = INT_MAX // force enum to be of size int + }; + +-static_assert(sizeof(Proj_TrailType) == sizeof(int), Proj_TrailType__SizeCheck); ++static_openlierox_assert(sizeof(Proj_TrailType) == sizeof(int), Proj_TrailType__SizeCheck); + + + struct Proj_Trail { +@@ -176,7 +176,7 @@ + __PJ_UBOUND = INT_MAX // force enum to be of size int + }; + +-static_assert(sizeof(Proj_ActionType) == sizeof(int), Proj_ActionType__SizeCheck); ++static_openlierox_assert(sizeof(Proj_ActionType) == sizeof(int), Proj_ActionType__SizeCheck); + + + struct ProjCollisionType; +@@ -379,7 +379,7 @@ + __PET_LBOUND = INT_MIN, + __PET_UBOUND = INT_MAX + } type; +- static_assert(sizeof(Type) == sizeof(int), Proj_Event_Type__SizeCheck); ++ static_openlierox_assert(sizeof(Type) == sizeof(int), Proj_Event_Type__SizeCheck); + + Proj_Event(Type t = PET_UNSET) : type(t) {} + Proj_TimerEvent timer; +--- a/include/ProjectileDesc.h ++++ b/include/ProjectileDesc.h +@@ -60,7 +60,7 @@ + ATT_QUADRATIC, // The force fades out using the inverse quadratic function + }; + +-static_assert(sizeof(Proj_GfxType) == sizeof(int), Proj_Type__SizeCheck); ++static_openlierox_assert(sizeof(Proj_GfxType) == sizeof(int), Proj_Type__SizeCheck); + + + // Animation types +@@ -73,7 +73,7 @@ + __ANI_UBOUND = INT_MAX, + }; + +-static_assert(sizeof(Proj_AnimType) == sizeof(int), Proj_AnimType__SizeCheck); ++static_openlierox_assert(sizeof(Proj_AnimType) == sizeof(int), Proj_AnimType__SizeCheck); + + + +--- a/include/StaticAssert.h ++++ b/include/StaticAssert.h +@@ -10,11 +10,11 @@ + #ifndef __OLX__STATICASSERT_H__ + #define __OLX__STATICASSERT_H__ + +-template <bool b> class static_assert_failure; +-template <> class static_assert_failure<true> { char foo; }; +-template <int s> class static_assert_test{}; ++template <bool b> class static_openlierox_assert_failure; ++template <> class static_openlierox_assert_failure<true> { char foo; }; ++template <int s> class static_openlierox_assert_test{}; + +-#define static_assert(X, desc) \ +- typedef static_assert_test< (int)sizeof(static_assert_failure< (bool)(X) >) > static_assert_typedef_##desc; ++#define static_openlierox_assert(X, desc) \ ++ typedef static_openlierox_assert_test< (int)sizeof(static_openlierox_assert_failure< (bool)(X) >) > static_assert_typedef_##desc; + + #endif +--- a/include/WeaponDesc.h ++++ b/include/WeaponDesc.h +@@ -34,7 +34,7 @@ + __WCL_UBOUND = INT_MAX, + }; + +-static_assert(sizeof(Wpn_Class) == sizeof(int), Wpn_Class__SizeCheck); ++static_openlierox_assert(sizeof(Wpn_Class) == sizeof(int), Wpn_Class__SizeCheck); + + // Weapon types + enum Wpn_Type { +@@ -46,7 +46,7 @@ + __WPN_UBOUND = INT_MAX + }; + +-static_assert(sizeof(Wpn_Type) == sizeof(int), Wpn_Type__SizeCheck); ++static_openlierox_assert(sizeof(Wpn_Type) == sizeof(int), Wpn_Type__SizeCheck); + + + // Special Weapons +@@ -58,7 +58,7 @@ + __SPC_UBOUND = INT_MAX + }; + +-static_assert(sizeof(Wpn_Special) == sizeof(int), Wpn_Special__SizeCheck); ++static_openlierox_assert(sizeof(Wpn_Special) == sizeof(int), Wpn_Special__SizeCheck); + + + +--- a/src/client/DeprecatedGUI/Menu_FloatingOptions.cpp ++++ b/src/client/DeprecatedGUI/Menu_FloatingOptions.cpp +@@ -134,7 +134,7 @@ + }; + + static const int sFloatingOpt_InputNames__size = sizeof(sFloatingOpt_InputNames) / sizeof(std::string); +-static_assert( sFloatingOpt_InputNames__size == __SIN_PLY_BOTTOM - 5, inputopts__sizecheck ); ++static_openlierox_assert( sFloatingOpt_InputNames__size == __SIN_PLY_BOTTOM - 5, inputopts__sizecheck ); + + + /////////////////// +--- a/src/client/Options.cpp ++++ b/src/client/Options.cpp +@@ -51,11 +51,11 @@ + const std::string gen_keys[] = {"Chat", "ShowScore", "ShowHealth", "ShowSettings", "TakeScreenshot", "ViewportManager", "SwitchMode", "ToggleTopBar", "TeamChat", "IrcChat", "Console"}; + const std::string gen_def[] = {"i", "tab", "h", "space", "F12", "F2", "F5", "F8", "o", "F4", "F3"}; + +-static_assert( sizeof(ply_keys) / sizeof(std::string) == __SIN_PLY_BOTTOM, ply_keys__sizecheck ); +-static_assert( sizeof(ply_def1) / sizeof(std::string) == __SIN_PLY_BOTTOM, ply_def1__sizecheck ); +-static_assert( sizeof(ply_def2) / sizeof(std::string) == __SIN_PLY_BOTTOM, ply_def2__sizecheck ); +-static_assert( sizeof(gen_keys) / sizeof(std::string) == __SIN_GENERAL_BOTTOM, gen_keys__sizecheck ); +-static_assert( sizeof(gen_def) / sizeof(std::string) == __SIN_GENERAL_BOTTOM, gen_def__sizecheck ); ++static_openlierox_assert( sizeof(ply_keys) / sizeof(std::string) == __SIN_PLY_BOTTOM, ply_keys__sizecheck ); ++static_openlierox_assert( sizeof(ply_def1) / sizeof(std::string) == __SIN_PLY_BOTTOM, ply_def1__sizecheck ); ++static_openlierox_assert( sizeof(ply_def2) / sizeof(std::string) == __SIN_PLY_BOTTOM, ply_def2__sizecheck ); ++static_openlierox_assert( sizeof(gen_keys) / sizeof(std::string) == __SIN_GENERAL_BOTTOM, gen_keys__sizecheck ); ++static_openlierox_assert( sizeof(gen_def) / sizeof(std::string) == __SIN_GENERAL_BOTTOM, gen_def__sizecheck ); + + static const Version defaultMinVersion("OpenLieroX/0.58_rc1"); + +--- a/src/common/CScriptableVars.cpp ++++ b/src/common/CScriptableVars.cpp +@@ -32,7 +32,7 @@ + {"Race", "Race gamemode settings"}, + }; + +-static_assert( sizeof(GameInfoGroupDescriptions) / (sizeof(char*) * 2) == GIG_Size, GIG_desc__sizecheck ); ++static_openlierox_assert( sizeof(GameInfoGroupDescriptions) / (sizeof(char*) * 2) == GIG_Size, GIG_desc__sizecheck ); + + + std::string AdvancedLevelDescription(AdvancedLevel l) { +--- a/src/common/FeatureList.cpp ++++ b/src/common/FeatureList.cpp +@@ -114,7 +114,7 @@ + Feature::Unset() + }; + +-static_assert(__FTI_BOTTOM == sizeof(featureArray)/sizeof(Feature) - 1, featureArray__sizecheck); ++static_openlierox_assert(__FTI_BOTTOM == sizeof(featureArray)/sizeof(Feature) - 1, featureArray__sizecheck); + + + +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -135,12 +135,12 @@ + static void DoSystemChecks() { + // sadly, these sizeof are directly used in CGameScript.cpp/CMap.cpp + // TODO: fix this issue +- static_assert(sizeof(char) == 1, sizeof_char__equals1); +- static_assert(sizeof(short) == 2, sizeof_short__equals2); +- static_assert(sizeof(int) == 4, sizeof_int__equals4); +- static_assert(sizeof(float) == 4, sizeof_float__equals4); ++ static_openlierox_assert(sizeof(char) == 1, sizeof_char__equals1); ++ static_openlierox_assert(sizeof(short) == 2, sizeof_short__equals2); ++ static_openlierox_assert(sizeof(int) == 4, sizeof_int__equals4); ++ static_openlierox_assert(sizeof(float) == 4, sizeof_float__equals4); + // sometimes the return value of SendMessage is used as a pointer +- static_assert(sizeof(DWORD) == sizeof(void*), sizeof_dword__equals_p); ++ static_openlierox_assert(sizeof(DWORD) == sizeof(void*), sizeof_dword__equals_p); + } + + |