diff --git a/NEWS b/NEWS index ae3cae760320..dfbb312863a4 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,11 @@ PHP NEWS . Fixed bug GH-22121 (Double free in gdImageSetStyle() after overflow-triggered early return). (iliaal) +- Lexbor: + . Define LEXBOR_STATIC in ext/lexbor/config.w32 so consumers of the + bundled lexbor headers (ext/uri etc.) do not see LXB_API as + __declspec(dllimport) on Windows static builds. (Luther Monson) + - Zlib: . Fixed memory leak if deflate initialization fails and there is a dict. (ndossche) diff --git a/ext/lexbor/config.w32 b/ext/lexbor/config.w32 index e75798e06187..288d37dec62a 100644 --- a/ext/lexbor/config.w32 +++ b/ext/lexbor/config.w32 @@ -27,4 +27,11 @@ ADD_FLAG("CFLAGS_LEXBOR", "/D LEXBOR_BUILDING /utf-8"); AC_DEFINE("HAVE_LEXBOR", 1, "Define to 1 if the PHP extension 'lexbor' is available."); +// PHP bundles lexbor statically (EXTENSION above, false /* never shared */), +// so consumers of lexbor headers (e.g. ext/uri) must not see LXB_API as +// __declspec(dllimport) on Windows. AC_DEFINE places LEXBOR_STATIC in +// main/config.w.h so every PHP source file picks it up before including +// lexbor headers via php.h. +AC_DEFINE("LEXBOR_STATIC", 1, "Define to 1 to disable dllimport on lexbor headers for PHP's static bundle."); + PHP_INSTALL_HEADERS("ext/lexbor", "php_lexbor.h lexbor/");