Skip to content

Commit bf24475

Browse files
committed
Allow PHP_CURL_APIs to be imported by DLLs
Closes GH-6438.
1 parent e589609 commit bf24475

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ext/curl/config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (PHP_CURL != "no") {
2828
) {
2929
EXTENSION("curl", "interface.c multi.c share.c curl_file.c");
3030
AC_DEFINE('HAVE_CURL', 1, 'Have cURL library');
31-
ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB");
31+
ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB /D PHP_CURL_EXPORTS=1");
3232
PHP_INSTALL_HEADERS("ext/curl", "php_curl.h");
3333
// TODO: check for curl_version_info
3434
} else {

ext/curl/php_curl.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
#include "php.h"
2222

2323
#ifdef PHP_WIN32
24-
# define PHP_CURL_API __declspec(dllexport)
24+
# ifdef PHP_CURL_EXPORTS
25+
# define PHP_CURL_API __declspec(dllexport)
26+
# else
27+
# define PHP_CURL_API __declspec(dllimport)
28+
# endif
2529
#elif defined(__GNUC__) && __GNUC__ >= 4
2630
# define PHP_CURL_API __attribute__ ((visibility("default")))
2731
#else

0 commit comments

Comments
 (0)