From fd35fd98035735bc91c55d14832461e41dd0e193 Mon Sep 17 00:00:00 2001 From: spacewander Date: Tue, 31 Jan 2017 13:09:55 +0800 Subject: feature: supports MS C compiler older than VC2012. Signed-off-by: Yichun Zhang (agentzh) --- lua_cjson.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lua_cjson.c') 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 @@ #define CJSON_VERSION "2.1devel" #endif +#ifdef _MSC_VER +#define snprintf sprintf_s + +#ifndef isnan +#include +#define isnan(x) _isnan(x) +#endif + +#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))) -- cgit v1.2.3-55-g6feb