void-packages/srcpkgs/tesseract/patches/gamma.patch
Đoàn Trần Công Danh 4f75cf25fd srcpkgs/t*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

40 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>