diff --git a/ext/gd/config.w32 b/ext/gd/config.w32 index 8fe44def2b4f..541d5f51e0e2 100644 --- a/ext/gd/config.w32 +++ b/ext/gd/config.w32 @@ -33,7 +33,7 @@ if (PHP_GD != "no") { CHECK_LIB("User32.lib", "gd", PHP_GD); CHECK_LIB("Gdi32.lib", "gd", PHP_GD); - EXTENSION("gd", "gd.c", null, "-Iext/gd/libgd", "php_gd2.dll"); + EXTENSION("gd", "gd.c", null, "-Iext/gd/libgd"); ADD_SOURCES("ext/gd/libgd", "gd2copypal.c gd.c \ gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \ gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gd_gif_out.c gdhelpers.c gd_io.c gd_io_dp.c \ @@ -43,6 +43,7 @@ if (PHP_GD != "no") { gd_crop.c gd_interpolation.c gd_matrix.c gd_bmp.c gd_tga.c", "gd"); AC_DEFINE('HAVE_LIBGD', 1, 'GD support'); ADD_FLAG("CFLAGS_GD", " \ +/D PHP_GD_EXPORTS=1 \ /D HAVE_GD_DYNAMIC_CTX_EX=1 \ /D HAVE_GD_BUNDLED=1 \ /D HAVE_GD_GD2 \ diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 7d415137bd3e..156f1b541fea 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -178,7 +178,7 @@ static zend_always_inline php_gd_image_object* php_gd_exgdimage_from_zobj_p(zend * Converts an extension GdImage instance contained within a zval into the gdImagePtr * for use with library APIs */ -static zend_always_inline gdImagePtr php_gd_libgdimageptr_from_zval_p(zval* zp) +PHP_GD_API gdImagePtr php_gd_libgdimageptr_from_zval_p(zval* zp) { return php_gd_exgdimage_from_zobj_p(Z_OBJ_P(zp))->image; } diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h index ffb6f60b755d..387346727621 100644 --- a/ext/gd/php_gd.h +++ b/ext/gd/php_gd.h @@ -51,7 +51,11 @@ #define PHP_IMG_TGA 128 #ifdef PHP_WIN32 -# define PHP_GD_API __declspec(dllexport) +# ifdef PHP_GD_EXPORTS +# define PHP_GD_API __declspec(dllexport) +# else +# define PHP_GD_API __declspec(dllimport) +# endif #elif defined(__GNUC__) && __GNUC__ >= 4 # define PHP_GD_API __attribute__ ((visibility("default"))) #else @@ -77,6 +81,8 @@ PHP_MINIT_FUNCTION(gd); PHP_MSHUTDOWN_FUNCTION(gd); PHP_RSHUTDOWN_FUNCTION(gd); +PHP_GD_API struct gdImageStruct *php_gd_libgdimageptr_from_zval_p(zval* zp); + #else #define phpext_gd_ptr NULL diff --git a/php.ini-development b/php.ini-development index 4acfa89a197c..5471728ce0bf 100644 --- a/php.ini-development +++ b/php.ini-development @@ -901,7 +901,7 @@ default_socket_timeout = 60 ;extension=ffi ;extension=ftp ;extension=fileinfo -;extension=gd2 +;extension=gd ;extension=gettext ;extension=gmp ;extension=intl diff --git a/php.ini-production b/php.ini-production index 2fdcdc0e5d3d..08fc7557384b 100644 --- a/php.ini-production +++ b/php.ini-production @@ -903,7 +903,7 @@ default_socket_timeout = 60 ;extension=ffi ;extension=ftp ;extension=fileinfo -;extension=gd2 +;extension=gd ;extension=gettext ;extension=gmp ;extension=intl diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 2f2c01e47dc4..e71757748fda 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -2026,9 +2026,6 @@ function generate_tmp_php_ini() var directive = (extensions_enabled[i][2] ? 'zend_extension' : 'extension'); var ext_name = extensions_enabled[i][0]; - if ("gd" == ext_name) { - ext_name = "gd2"; - } if (!is_on_exclude_list_for_test_ini(ext_list, ext_name)) { INI.WriteLine(directive + "=php_" + ext_name + ".dll");