tesseract: unbreak build on modern toolchains

[ci skip]
This commit is contained in:
q66 2019-04-24 18:40:03 +02:00 committed by Helmut Pozimski
parent e0b95f0375
commit 8d470133b2

View file

@ -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 <math.h>
-#ifdef __GNUC__
-#undef gamma
-#endif
-
#include <string.h>
#include <stdio.h>
#include <stdlib.h>