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:
-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);