]> granicus.if.org Git - php/commitdiff
Allow PHP_CURL_APIs to be imported by DLLs
authorChristoph M. Becker <cmbecker69@gmx.de>
Thu, 19 Nov 2020 14:42:01 +0000 (15:42 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Tue, 24 Nov 2020 13:12:39 +0000 (14:12 +0100)
Closes GH-6438.

ext/curl/config.w32
ext/curl/php_curl.h

index 9402e5b3ec8017e5e6d58c7c2cea7dc85a059e95..f722c5faca5e3e356e14bb4623b5f956debb54f6 100644 (file)
@@ -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 {
index ebb56278aa24fd8d67b65704df3d693370f62a7a..88806262eceb90aa8504abcdeedf89c226d81193 100644 (file)
 #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