From: Christoph M. Becker Date: Thu, 19 Nov 2020 14:42:01 +0000 (+0100) Subject: Allow PHP_CURL_APIs to be imported by DLLs X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf244757eeaf9940928b044faebeb20d7f677844;p=php Allow PHP_CURL_APIs to be imported by DLLs Closes GH-6438. --- diff --git a/ext/curl/config.w32 b/ext/curl/config.w32 index 9402e5b3ec..f722c5faca 100644 --- a/ext/curl/config.w32 +++ b/ext/curl/config.w32 @@ -28,7 +28,7 @@ if (PHP_CURL != "no") { ) { EXTENSION("curl", "interface.c multi.c share.c curl_file.c"); AC_DEFINE('HAVE_CURL', 1, 'Have cURL library'); - ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB"); + ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB /D PHP_CURL_EXPORTS=1"); PHP_INSTALL_HEADERS("ext/curl", "php_curl.h"); // TODO: check for curl_version_info } else { diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index ebb56278aa..88806262ec 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -21,7 +21,11 @@ #include "php.h" #ifdef PHP_WIN32 -# define PHP_CURL_API __declspec(dllexport) +# ifdef PHP_CURL_EXPORTS +# define PHP_CURL_API __declspec(dllexport) +# else +# define PHP_CURL_API __declspec(dllimport) +# endif #elif defined(__GNUC__) && __GNUC__ >= 4 # define PHP_CURL_API __attribute__ ((visibility("default"))) #else