summaryrefslogtreecommitdiff
path: root/user/php7/libgd-unused-constants.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/php7/libgd-unused-constants.patch')
-rw-r--r--user/php7/libgd-unused-constants.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/user/php7/libgd-unused-constants.patch b/user/php7/libgd-unused-constants.patch
new file mode 100644
index 000000000..2b5ef2f83
--- /dev/null
+++ b/user/php7/libgd-unused-constants.patch
@@ -0,0 +1,51 @@
+Backport of https://github.com/php/php-src/commit/b3646440b1808abf0874b6f89027ce53ec5da03f
+
+Affects libgd <= 2.3.3
+
+See also https://github.com/libgd/libgd/commit/f4bc1f5c26925548662946ed7cfa473c190a104a
+
+--- php-7.4.29/ext/gd/gd.c 2022-04-12 10:55:40.000000000 +0000
++++ php-7.4.29/ext/gd/gd.c 2022-05-27 16:40:42.048499508 +0000
+@@ -90,6 +90,10 @@ static int le_gd, le_gd_font;
+ #ifndef M_PI
+ #define M_PI 3.14159265358979323846
+ #endif
++/* 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
+
+ #ifdef HAVE_GD_FREETYPE
+ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int, int);
+@@ -1137,9 +1141,9 @@ PHP_MINIT_FUNCTION(gd)
+ /* 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_HORIZONTAL, 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 +4700,15 @@ PHP_FUNCTION(imageflip)
+ }
+
+ switch (mode) {
+- case GD_FLIP_VERTICAL:
++ case PHP_GD_FLIP_VERTICAL:
+ gdImageFlipVertical(im);
+ break;
+
+- case GD_FLIP_HORINZONTAL:
++ case PHP_GD_FLIP_HORIZONTAL:
+ gdImageFlipHorizontal(im);
+ break;
+
+- case GD_FLIP_BOTH:
++ case PHP_GD_FLIP_BOTH:
+ gdImageFlipBoth(im);
+ break;
+