summaryrefslogtreecommitdiff
path: root/ext/json
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2009-06-30 17:52:21 +0000
committerStanislav Malyshev <stas@php.net>2009-06-30 17:52:21 +0000
commit2361b4ea2a640fe11c615fdeac6e8b27f86340a0 (patch)
tree23de9869bed305b0010ba4c69b8b2160552a299e /ext/json
parentb4a43d0d9461b0c915d98bf9c86070640f529db7 (diff)
downloadphp-git-2361b4ea2a640fe11c615fdeac6e8b27f86340a0.tar.gz
fix json shared build on Windows
Diffstat (limited to 'ext/json')
-rw-r--r--ext/json/json.c4
-rw-r--r--ext/json/php_json.h10
2 files changed, 10 insertions, 4 deletions
diff --git a/ext/json/json.c b/ext/json/json.c
index 73bb079620..5077dac562 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -411,7 +411,7 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR
}
/* }}} */
-PHPAPI void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */
+PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */
{
switch (Z_TYPE_P(val))
{
@@ -467,7 +467,7 @@ PHPAPI void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC) /*
}
/* }}} */
-PHPAPI void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, long depth TSRMLS_DC) /* {{{ */
+PHP_JSON_API void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, long depth TSRMLS_DC) /* {{{ */
{
int utf16_len;
zval *z;
diff --git a/ext/json/php_json.h b/ext/json/php_json.h
index 3207acd048..d5ff03cd79 100644
--- a/ext/json/php_json.h
+++ b/ext/json/php_json.h
@@ -27,6 +27,12 @@
extern zend_module_entry json_module_entry;
#define phpext_json_ptr &json_module_entry
+#if defined(PHP_WIN32) && defined(JSON_EXPORTS)
+#define PHP_JSON_API __declspec(dllexport)
+#else
+#define PHP_JSON_API PHPAPI
+#endif
+
#ifdef ZTS
#include "TSRM.h"
#endif
@@ -41,8 +47,8 @@ ZEND_END_MODULE_GLOBALS(json)
# define JSON_G(v) (json_globals.v)
#endif
-PHPAPI void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC);
-PHPAPI void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, long depth TSRMLS_DC);
+PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC);
+PHP_JSON_API void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, long depth TSRMLS_DC);
#endif /* PHP_JSON_H */