Skip to content

Commit 6572c00

Browse files
committed
Merge branch 'PHP-7.4' of git.php.net:/php-src into PHP-7.4
2 parents 23bb9f4 + d3d3404 commit 6572c00

File tree

3 files changed

+12
-31
lines changed

3 files changed

+12
-31
lines changed

ext/gd/config.m4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ AC_DEFUN([PHP_GD_FREETYPE2],[
109109
PHP_EVAL_LIBLINE($FREETYPE2_LIBS, GD_SHARED_LIBADD)
110110
AC_DEFINE(HAVE_LIBFREETYPE, 1, [ ])
111111
AC_DEFINE(HAVE_GD_FREETYPE, 1, [ ])
112-
AC_DEFINE(ENABLE_GD_TTF, 1, [ ])
113112
fi
114113
])
115114

ext/gd/gd.c

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,9 @@ static int le_gd, le_gd_font;
6868
#include <gdfontl.h> /* 4 Large font */
6969
#include <gdfontg.h> /* 5 Giant font */
7070

71-
#ifdef ENABLE_GD_TTF
72-
# ifdef HAVE_LIBFREETYPE
73-
# include <ft2build.h>
74-
# include FT_FREETYPE_H
75-
# endif
71+
#if HAVE_LIBFREETYPE
72+
# include <ft2build.h>
73+
# include FT_FREETYPE_H
7674
#endif
7775

7876
#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
@@ -83,7 +81,7 @@ static int le_gd, le_gd_font;
8381
#define M_PI 3.14159265358979323846
8482
#endif
8583

86-
#ifdef ENABLE_GD_TTF
84+
#if HAVE_LIBFREETYPE
8785
static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int, int);
8886
#endif
8987

@@ -724,7 +722,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_imagegetclip, 0)
724722
ZEND_ARG_INFO(0, im)
725723
ZEND_END_ARG_INFO()
726724

727-
#ifdef ENABLE_GD_TTF
728725
#if HAVE_LIBFREETYPE
729726
ZEND_BEGIN_ARG_INFO_EX(arginfo_imageftbbox, 0, 0, 4)
730727
ZEND_ARG_INFO(0, size)
@@ -745,7 +742,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_imagefttext, 0, 0, 8)
745742
ZEND_ARG_INFO(0, text)
746743
ZEND_ARG_INFO(0, extrainfo) /* ARRAY_INFO(0, extrainfo, 0) */
747744
ZEND_END_ARG_INFO()
748-
#endif
749745

750746
ZEND_BEGIN_ARG_INFO(arginfo_imagettfbbox, 0)
751747
ZEND_ARG_INFO(0, size)
@@ -991,7 +987,7 @@ static const zend_function_entry gd_functions[] = {
991987
PHP_FE(imagegetclip, arginfo_imagegetclip)
992988
PHP_FE(imagedashedline, arginfo_imagedashedline)
993989

994-
#ifdef ENABLE_GD_TTF
990+
#if HAVE_LIBFREETYPE
995991
PHP_FE(imagettfbbox, arginfo_imagettfbbox)
996992
PHP_FE(imagettftext, arginfo_imagettftext)
997993
#if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE
@@ -1284,9 +1280,8 @@ PHP_MINFO_FUNCTION(gd)
12841280
#endif
12851281
#endif
12861282

1287-
#ifdef ENABLE_GD_TTF
1288-
php_info_print_table_row(2, "FreeType Support", "enabled");
12891283
#if HAVE_LIBFREETYPE
1284+
php_info_print_table_row(2, "FreeType Support", "enabled");
12901285
php_info_print_table_row(2, "FreeType Linkage", "with freetype");
12911286
{
12921287
char tmp[256];
@@ -1300,9 +1295,6 @@ PHP_MINFO_FUNCTION(gd)
13001295
#endif
13011296
php_info_print_table_row(2, "FreeType Version", tmp);
13021297
}
1303-
#else
1304-
php_info_print_table_row(2, "FreeType Linkage", "with unknown library");
1305-
#endif
13061298
#endif
13071299

13081300
php_info_print_table_row(2, "GIF Read Support", "enabled");
@@ -1358,13 +1350,9 @@ PHP_FUNCTION(gd_info)
13581350

13591351
add_assoc_string(return_value, "GD Version", PHP_GD_VERSION_STRING);
13601352

1361-
#ifdef ENABLE_GD_TTF
1362-
add_assoc_bool(return_value, "FreeType Support", 1);
13631353
#if HAVE_LIBFREETYPE
1354+
add_assoc_bool(return_value, "FreeType Support", 1);
13641355
add_assoc_string(return_value, "FreeType Linkage", "with freetype");
1365-
#else
1366-
add_assoc_string(return_value, "FreeType Linkage", "with unknown library");
1367-
#endif
13681356
#else
13691357
add_assoc_bool(return_value, "FreeType Support", 0);
13701358
#endif
@@ -3977,14 +3965,14 @@ PHP_FUNCTION(imagegetclip)
39773965
}
39783966
/* }}} */
39793967

3980-
#ifdef ENABLE_GD_TTF
3968+
#if HAVE_LIBFREETYPE
39813969
#define TTFTEXT_DRAW 0
39823970
#define TTFTEXT_BBOX 1
39833971
#endif
39843972

3985-
#ifdef ENABLE_GD_TTF
3973+
#if HAVE_LIBFREETYPE
39863974

3987-
#if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE
3975+
#if HAVE_GD_FREETYPE
39883976
/* {{{ proto array imageftbbox(float size, float angle, string font_file, string text [, array extrainfo])
39893977
Give the bounding box of a text using fonts via freetype2 */
39903978
PHP_FUNCTION(imageftbbox)
@@ -4000,7 +3988,7 @@ PHP_FUNCTION(imagefttext)
40003988
php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 1);
40013989
}
40023990
/* }}} */
4003-
#endif /* HAVE_GD_FREETYPE && HAVE_LIBFREETYPE */
3991+
#endif /* HAVE_GD_FREETYPE */
40043992

40053993
/* {{{ proto array imagettfbbox(float size, float angle, string font_file, string text)
40063994
Give the bounding box of a text using TrueType fonts */
@@ -4103,7 +4091,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
41034091
}
41044092
}
41054093
/* }}} */
4106-
#endif /* ENABLE_GD_TTF */
4094+
#endif /* HAVE_LIBFREETYPE */
41074095

41084096
/* {{{ proto bool image2wbmp(resource im [, string filename [, int foreground]])
41094097
Output WBMP image to browser or file */

ext/gd/php_gd.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020
#ifndef PHP_GD_H
2121
#define PHP_GD_H
2222

23-
#if HAVE_LIBFREETYPE
24-
# ifndef ENABLE_GD_TTF
25-
# define ENABLE_GD_TTF
26-
# endif
27-
#endif
28-
2923
#if defined(HAVE_LIBGD) || defined(HAVE_GD_BUNDLED)
3024

3125
/* open_basedir and safe_mode checks */

0 commit comments

Comments
 (0)