Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpx/lua-cjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorichenq <ichenq@gmail.com>2014-12-29 05:54:47 +0300
committerMark Pulford <mark@kyne.com.au>2016-08-24 14:34:50 +0300
commitbb8472269063a8e9b7abd95f414cc957a51c15ec (patch)
tree2ff4e912fc3b0d4276f7de6a7e1ec3961d2d2983
parent7d9d5a6a1fba1a704a6db5377d3e22bdf9ad580c (diff)
CJSON_EXPORT for msvc
-rw-r--r--lua_cjson.c10
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);