diff --git a/srcpkgs/ufoai/patches/fix-gcc6.patch b/srcpkgs/ufoai/patches/fix-gcc6.patch new file mode 100644 index 00000000000..4c507af8c0e --- /dev/null +++ b/srcpkgs/ufoai/patches/fix-gcc6.patch @@ -0,0 +1,39 @@ +With gcc6 this logic error needs to be fixed. I think +the intention here was to continue, if FS_CheckFile() fails. + +--- src/client/battlescape/events/e_main.cpp 2014-06-05 06:18:39.000000000 +0200 ++++ src/client/battlescape/events/e_main.cpp 2017-01-25 16:18:47.764221448 +0100 +@@ -221,7 +221,7 @@ + return sound; + + for (int i = 1; i <= 99; i++) { +- if (!FS_CheckFile("sounds/%s%02i", sound, i) == -1) ++ if (!FS_CheckFile("sounds/%s%02i", sound, i)) + continue; + sound[length] = '\0'; + Q_strcat(sound, size, "%02i", rand() % i + 1); + +With gcc6 the checks for narrowing integer types are very strict. +Explicitly cast the flag combinations to int. +--- src/client/battlescape/cl_particle.cpp 2014-06-05 06:18:39.000000000 +0200 ++++ src/client/battlescape/cl_particle.cpp 2017-01-25 16:23:44.737146135 +0100 +@@ -144,12 +144,17 @@ + V_UNTYPED, V_UNTYPED, V_UNTYPED, + V_VECS, V_VECS, + V_VECS, V_VECS, +- PTL_ONLY_ONE_TYPE | V_FLOAT, PTL_ONLY_ONE_TYPE | V_FLOAT, PTL_ONLY_ONE_TYPE | V_FLOAT, ++ static_cast(PTL_ONLY_ONE_TYPE | V_FLOAT), ++ static_cast(PTL_ONLY_ONE_TYPE | V_FLOAT), ++ static_cast(PTL_ONLY_ONE_TYPE | V_FLOAT), + V_VECS, V_VECS, + 0, 0, 0, + + 0, +- PTL_ONLY_ONE_TYPE | V_STRING, PTL_ONLY_ONE_TYPE | V_STRING, PTL_ONLY_ONE_TYPE | V_STRING, PTL_ONLY_ONE_TYPE | V_STRING ++ static_cast(PTL_ONLY_ONE_TYPE | V_STRING), ++ static_cast(PTL_ONLY_ONE_TYPE | V_STRING), ++ static_cast(PTL_ONLY_ONE_TYPE | V_STRING), ++ static_cast(PTL_ONLY_ONE_TYPE | V_STRING) + }; + CASSERT(lengthof(pc_types) == PC_NUM_PTLCMDS); + diff --git a/srcpkgs/ufoai/patches/sdl2_gl_macros.patch b/srcpkgs/ufoai/patches/sdl2_gl_macros.patch new file mode 100644 index 00000000000..4675b56b6fc --- /dev/null +++ b/srcpkgs/ufoai/patches/sdl2_gl_macros.patch @@ -0,0 +1,15 @@ +--- src/client/renderer/r_program.h 2014-06-05 06:18:39.000000000 +0200 ++++ src/client/renderer/r_program.h 2017-01-25 16:15:42.467269009 +0100 +@@ -30,8 +30,12 @@ + char name[MAX_QPATH]; + } r_shader_t; + ++#if !defined(GL_UNIFORM) + #define GL_UNIFORM 1 ++#endif ++#if !defined(GL_ATTRIBUTE) + #define GL_ATTRIBUTE 2 ++#endif + /* program variables */ + typedef struct r_progvar_s { + GLint type;