Skip to content

Commit

Permalink
Use dllimport correctly in php_psr.h
Browse files Browse the repository at this point in the history
hopefully
  • Loading branch information
jbboehr committed Apr 4, 2021
1 parent 65cf194 commit c136d91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ ARG_ENABLE("psr", "Enable psr support", "no");
if (PHP_PSR != "no") {
AC_DEFINE("HAVE_PSR", 1, "Have PSR Support");
EXTENSION("psr", "php_psr.c psr_cache.c psr_container.c psr_http_message.c psr_link.c psr_log.c psr_simple_cache.c psr_http_server_handler.c psr_http_server_middleware.c psr_http_factory.c psr_http_client.c psr_event_dispatcher.c");
ADD_FLAG("CFLAGS_PSR", "/D PHP_PSR_EXPORTS=1");
PHP_INSTALL_HEADERS("ext\\psr", "php_psr.h psr_cache.h psr_container.h psr_http_message.h psr_link.h psr_log.h psr_simple_cache.h psr_http_server_handler.h psr_http_server_middleware.h psr_http_factory.h psr_http_client.h psr_event_dispatcher.h")
}
12 changes: 9 additions & 3 deletions php_psr.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
#include "TSRM.h"
#endif

#if defined(PHP_WIN32) && defined(PSR_EXPORTS)
#define PHP_PSR_API __declspec(dllexport)
#ifdef PHP_WIN32
# ifdef PHP_PSR_EXPORTS
# define PHP_PSR_API __declspec(dllexport)
# else
# define PHP_PSR_API __declspec(dllimport)
# endif
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_PSR_API __attribute__ ((visibility("default")))
#else
#define PHP_PSR_API PHPAPI
# define PHP_PSR_API
#endif

#define PHP_PSR_NAME "psr"
Expand Down

0 comments on commit c136d91

Please sign in to comment.