void-packages/srcpkgs/tesseract/patches/gamma.patch

41 lines
859 B
Diff

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.
--- a/src/engine/main.cpp
+++ b/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);
});
--- a/src/shared/cube.h
+++ b/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>