From f348ecbd343c9ee0d706a47d697e78e1348e79c7 Mon Sep 17 00:00:00 2001 From: samehkhamis Date: Thu, 23 Jul 2015 17:17:36 -0700 Subject: [PATCH] Work under windows --- fpconv.h | 4 ++++ lua_cjson.c | 4 ++++ strbuf.h | 3 +++ 3 files changed, 11 insertions(+) diff --git a/fpconv.h b/fpconv.h index 01249088..7d8a347c 100644 --- a/fpconv.h +++ b/fpconv.h @@ -5,6 +5,10 @@ * Longest double printed with %.14g is 21 characters long: * -1.7976931348623e+308 */ # define FPCONV_G_FMT_BUFSIZE 32 +#ifdef _WIN32 +#define inline __inline +#define snprintf _snprintf +#endif #ifdef USE_INTERNAL_FPCONV static inline void fpconv_init() diff --git a/lua_cjson.c b/lua_cjson.c index c14a1c5c..fdb90d20 100644 --- a/lua_cjson.c +++ b/lua_cjson.c @@ -74,6 +74,10 @@ #define DEFAULT_DECODE_INVALID_NUMBERS 0 #endif +#ifdef _WIN32 +#define strncasecmp _strnicmp +#endif + typedef enum { T_OBJ_BEGIN, T_OBJ_END, diff --git a/strbuf.h b/strbuf.h index d861108c..17675821 100644 --- a/strbuf.h +++ b/strbuf.h @@ -24,6 +24,9 @@ #include #include +#ifdef _WIN32 +#define inline __inline +#endif /* Size: Total bytes allocated to *buf * Length: String length, excluding optional NULL terminator.