diff options
author | ichenq <ichenq@gmail.com> | 2014-12-29 05:54:47 +0300 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2016-08-24 14:34:50 +0300 |
commit | bb8472269063a8e9b7abd95f414cc957a51c15ec (patch) | |
tree | 2ff4e912fc3b0d4276f7de6a7e1ec3961d2d2983 | |
parent | 7d9d5a6a1fba1a704a6db5377d3e22bdf9ad580c (diff) |
CJSON_EXPORT for msvc
-rw-r--r-- | lua_cjson.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lua_cjson.c b/lua_cjson.c index 8f74a3d..22f33f1 100644 --- a/lua_cjson.c +++ b/lua_cjson.c @@ -54,6 +54,12 @@ #define CJSON_VERSION "2.1devel" #endif +#ifdef _MSC_VER +#define CJSON_EXPORT __declspec(dllexport) +#else +#define CJSON_EXPORT extern +#endif + /* Workaround for Solaris platforms missing isinf() */ #if !defined(isinf) && (defined(USE_INTERNAL_ISINF) || defined(MISSING_ISINF)) #define isinf(x) (!isnan(x) && isnan((x) - (x))) @@ -1407,7 +1413,7 @@ static int lua_cjson_safe_new(lua_State *l) return 1; } -int luaopen_cjson(lua_State *l) +CJSON_EXPORT int luaopen_cjson(lua_State *l) { lua_cjson_new(l); @@ -1421,7 +1427,7 @@ int luaopen_cjson(lua_State *l) return 1; } -int luaopen_cjson_safe(lua_State *l) +CJSON_EXPORT int luaopen_cjson_safe(lua_State *l) { lua_cjson_safe_new(l); |