diff options
Diffstat (limited to '')
-rw-r--r-- | lua-cjson-2.1devel-1.rockspec | 2 | ||||
-rw-r--r-- | lua_cjson.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lua-cjson-2.1devel-1.rockspec b/lua-cjson-2.1devel-1.rockspec index 154e333..d614d05 100644 --- a/lua-cjson-2.1devel-1.rockspec +++ b/lua-cjson-2.1devel-1.rockspec | |||
@@ -47,7 +47,7 @@ build = { | |||
47 | -- Override default build options (per platform) | 47 | -- Override default build options (per platform) |
48 | platforms = { | 48 | platforms = { |
49 | win32 = { modules = { cjson = { defines = { | 49 | win32 = { modules = { cjson = { defines = { |
50 | "DISABLE_INVALID_NUMBERS" | 50 | "DISABLE_INVALID_NUMBERS", "USE_INTERNAL_ISINF" |
51 | } } } } | 51 | } } } } |
52 | }, | 52 | }, |
53 | copy_directories = { "tests" } | 53 | copy_directories = { "tests" } |
diff --git a/lua_cjson.c b/lua_cjson.c index 1695979..89cba6d 100644 --- a/lua_cjson.c +++ b/lua_cjson.c | |||
@@ -54,6 +54,16 @@ | |||
54 | #define CJSON_VERSION "2.1devel" | 54 | #define CJSON_VERSION "2.1devel" |
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | #ifdef _MSC_VER | ||
58 | #define snprintf sprintf_s | ||
59 | |||
60 | #ifndef isnan | ||
61 | #include <float.h> | ||
62 | #define isnan(x) _isnan(x) | ||
63 | #endif | ||
64 | |||
65 | #endif | ||
66 | |||
57 | /* Workaround for Solaris platforms missing isinf() */ | 67 | /* Workaround for Solaris platforms missing isinf() */ |
58 | #if !defined(isinf) && (defined(USE_INTERNAL_ISINF) || defined(MISSING_ISINF)) | 68 | #if !defined(isinf) && (defined(USE_INTERNAL_ISINF) || defined(MISSING_ISINF)) |
59 | #define isinf(x) (!isnan(x) && isnan((x) - (x))) | 69 | #define isinf(x) (!isnan(x) && isnan((x) - (x))) |