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

41 lines
851 B
Diff
Raw Normal View History

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>