Skip to content

Commit 037e8d5

Browse files
committed
Export php_gd_libgdimageptr_from_zval_p()
Some extension may need to retrieve the `gdImagePtr` from an `GdImage` object; thus, we export the respective function. To not being forced to include gd.h in php_gd.h, we use the opaque `struct gdImageStruct *` as return type.
1 parent 2ad75ba commit 037e8d5

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

ext/gd/gd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static zend_always_inline php_gd_image_object* php_gd_exgdimage_from_zobj_p(zend
178178
* Converts an extension GdImage instance contained within a zval into the gdImagePtr
179179
* for use with library APIs
180180
*/
181-
static zend_always_inline gdImagePtr php_gd_libgdimageptr_from_zval_p(zval* zp)
181+
inline gdImagePtr php_gd_libgdimageptr_from_zval_p(zval* zp)
182182
{
183183
return php_gd_exgdimage_from_zobj_p(Z_OBJ_P(zp))->image;
184184
}

ext/gd/php_gd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ PHP_MINIT_FUNCTION(gd);
7777
PHP_MSHUTDOWN_FUNCTION(gd);
7878
PHP_RSHUTDOWN_FUNCTION(gd);
7979

80+
PHP_GD_API struct gdImageStruct *php_gd_libgdimageptr_from_zval_p(zval* zp);
81+
8082
#else
8183

8284
#define phpext_gd_ptr NULL

0 commit comments

Comments
 (0)