fix build

This commit is contained in:
Aleksandr Proklov 2021-09-25 11:40:40 +09:00
parent 8c88000d31
commit 7cb97cc604
2 changed files with 53 additions and 0 deletions

View file

@ -0,0 +1,51 @@
# backportd patch from 8.0
# https://github.com/php/php-src/commit/b3646440b1808abf0874b6f89027ce53ec5da03f
diff -ruN a/ext/gd/gd.c b/ext/gd/gd.c
--- a/ext/gd/gd.c 2021-09-21 20:23:13.000000000 +0900
+++ b/ext/gd/gd.c 2021-09-25 11:37:30.869225981 +0900
@@ -97,6 +97,11 @@
#include "gd_ctx.c"
+/* don't used libgd constants, not used, so going to be removed */
+#define PHP_GD_FLIP_HORIZONTAL 1
+#define PHP_GD_FLIP_VERTICAL 2
+#define PHP_GD_FLIP_BOTH 3
+
/* as it is not really public, duplicate declaration here to avoid
pointless warnings */
int overflow2(int a, int b);
@@ -1137,9 +1142,9 @@
/* GD2 image format types */
REGISTER_LONG_CONSTANT("IMG_GD2_RAW", GD2_FMT_RAW, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_GD2_COMPRESSED", GD2_FMT_COMPRESSED, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_FLIP_HORIZONTAL", GD_FLIP_HORINZONTAL, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_FLIP_VERTICAL", GD_FLIP_VERTICAL, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_FLIP_BOTH", GD_FLIP_BOTH, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_FLIP_HORIZONTAL", PHP_GD_FLIP_HORINZONTAL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_FLIP_VERTICAL", PHP_GD_FLIP_VERTICAL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_FLIP_BOTH", PHP_GD_FLIP_BOTH, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_EFFECT_REPLACE", gdEffectReplace, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_EFFECT_ALPHABLEND", gdEffectAlphaBlend, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_EFFECT_NORMAL", gdEffectNormal, CONST_CS | CONST_PERSISTENT);
@@ -4696,15 +4701,15 @@
}
switch (mode) {
- case GD_FLIP_VERTICAL:
+ case PHP_GD_FLIP_VERTICAL:
gdImageFlipVertical(im);
break;
- case GD_FLIP_HORINZONTAL:
+ case PHP_GD_FLIP_HORINZONTAL:
gdImageFlipHorizontal(im);
break;
- case GD_FLIP_BOTH:
+ case PHP_GD_FLIP_BOTH:
gdImageFlipBoth(im);
break;

View file

@ -80,6 +80,7 @@ Patch113: php-libc-client.diff
Patch114: php-no_pam_in_c-client.diff Patch114: php-no_pam_in_c-client.diff
# Fix bugs # Fix bugs
Patch121: php-bug43221.diff Patch121: php-bug43221.diff
Patch122: php-not-use-libgd-const.patch
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
@ -1274,6 +1275,7 @@ fi
# upstream fixes # upstream fixes
%patch121 -p0 -b .bug43221.droplet %patch121 -p0 -b .bug43221.droplet
%patch122 -p1
cp %{SOURCE2} maxlifetime cp %{SOURCE2} maxlifetime
cp %{SOURCE3} php.crond cp %{SOURCE3} php.crond