From bf244757eeaf9940928b044faebeb20d7f677844 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 19 Nov 2020 15:42:01 +0100 Subject: Allow PHP_CURL_APIs to be imported by DLLs Closes GH-6438. --- ext/curl/config.w32 | 2 +- ext/curl/php_curl.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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 -- cgit v1.2.1