File php8-gd-removed-unused-constants.patch of Package php8

Index: php-8.0.10/ext/gd/gd.c
===================================================================
--- php-8.0.10.orig/ext/gd/gd.c	2021-08-24 17:40:40.000000000 +0200
+++ php-8.0.10/ext/gd/gd.c	2021-09-23 13:43:51.490658267 +0200
@@ -95,6 +95,10 @@ static int le_gd_font;
 #define GD_FLIP_HORIZONTAL GD_FLIP_HORINZONTAL
 #endif
 
+#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);
 #endif
@@ -350,9 +354,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_HORIZONTAL, 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);
@@ -3526,15 +3530,15 @@ PHP_FUNCTION(imageflip)
 	im = php_gd_libgdimageptr_from_zval_p(IM);
 
 	switch (mode) {
-		case GD_FLIP_VERTICAL:
+		case PHP_GD_FLIP_VERTICAL:
 			gdImageFlipVertical(im);
 			break;
 
-		case GD_FLIP_HORIZONTAL:
+		case PHP_GD_FLIP_HORIZONTAL:
 			gdImageFlipHorizontal(im);
 			break;
 
-		case GD_FLIP_BOTH:
+		case PHP_GD_FLIP_BOTH:
 			gdImageFlipBoth(im);
 			break;
 
openSUSE Build Service is sponsored by