Skip to content

Commit f56d6b6

Browse files
author
Garrett Serack
committed
- Updated fix for bug #48911 (embed sapi misses SAPI_API)
#- Windows didn't need SAPI_API
1 parent f8ee7db commit f56d6b6

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

sapi/embed/php_embed.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static int php_embed_startup(sapi_module_struct *sapi_module)
108108
return SUCCESS;
109109
}
110110

111-
extern SAPI_API sapi_module_struct php_embed_module = {
111+
extern EMBED_SAPI_API sapi_module_struct php_embed_module = {
112112
"embed", /* name */
113113
"PHP Embedded Library", /* pretty name */
114114

@@ -152,7 +152,7 @@ static const zend_function_entry additional_functions[] = {
152152
{NULL, NULL, NULL}
153153
};
154154

155-
SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC)
155+
EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC)
156156
{
157157
zend_llist global_vars;
158158
#ifdef ZTS
@@ -217,7 +217,7 @@ SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC)
217217
return SUCCESS;
218218
}
219219

220-
SAPI_API void php_embed_shutdown(TSRMLS_D)
220+
EMBED_SAPI_API void php_embed_shutdown(TSRMLS_D)
221221
{
222222
php_request_shutdown((void *) 0);
223223
php_module_shutdown(TSRMLS_C);

sapi/embed/php_embed.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,16 @@
5757
php_embed_shutdown(TSRMLS_C); \
5858
}
5959

60+
#ifndef PHP_WIN32
61+
#define EMBED_SAPI_API SAPI_API
62+
#else
63+
#define EMBED_SAPI_API
64+
#endif
65+
6066
BEGIN_EXTERN_C()
61-
SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC);
62-
SAPI_API void php_embed_shutdown(TSRMLS_D);
63-
extern SAPI_API sapi_module_struct php_embed_module;
67+
EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC);
68+
EMBED_SAPI_API void php_embed_shutdown(TSRMLS_D);
69+
extern EMBED_SAPI_API sapi_module_struct php_embed_module;
6470
END_EXTERN_C()
6571

6672

0 commit comments

Comments
 (0)