From 8d470133b2a7e7a376171d9b75b77fd0f8bd7d50 Mon Sep 17 00:00:00 2001 From: q66 Date: Wed, 24 Apr 2019 18:40:03 +0200 Subject: [PATCH] tesseract: unbreak build on modern toolchains [ci skip] --- srcpkgs/tesseract/patches/gamma.patch | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 srcpkgs/tesseract/patches/gamma.patch diff --git a/srcpkgs/tesseract/patches/gamma.patch b/srcpkgs/tesseract/patches/gamma.patch new file mode 100644 index 00000000000..a0440b81e6b --- /dev/null +++ b/srcpkgs/tesseract/patches/gamma.patch @@ -0,0 +1,40 @@ +This is backported from upstream as redefining the name like that breaks +compilation on various modern toolchains. Remove if/when a new release is made. +--- src/engine/main.cpp ++++ src/engine/main.cpp +@@ -508,10 +508,10 @@ static void setgamma(int val) + } + + static int curgamma = 100; +-VARFP(gamma, 30, 100, 300, ++VARFNP(gamma, reqgamma, 30, 100, 300, + { +- if(initing || gamma == curgamma) return; +- curgamma = gamma; ++ if(initing || reqgamma == curgamma) return; ++ curgamma = reqgamma; + setgamma(curgamma); + }); + +--- src/shared/cube.h ++++ src/shared/cube.h +@@ -3,19 +3,11 @@ + + #define _FILE_OFFSET_BITS 64 + +-#ifdef __GNUC__ +-#define gamma __gamma +-#endif +- + #ifdef WIN32 + #define _USE_MATH_DEFINES + #endif + #include + +-#ifdef __GNUC__ +-#undef gamma +-#endif +- + #include + #include + #include