Skip to content

Commit

Permalink
Allow PHP_CURL_APIs to be imported by DLLs
Browse files Browse the repository at this point in the history
Closes GH-6438.
  • Loading branch information
cmb69 committed Nov 24, 2020
1 parent e589609 commit bf24475
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/curl/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 5 additions & 1 deletion ext/curl/php_curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf24475

Please sign in to comment.