From: James Myatt Date: Thu, 5 Feb 2015 15:58:12 +0000 (+0000) Subject: Define macros from inttypes.h when not available X-Git-Tag: json-c-0.13-20171207~193^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=720d566d03e23418b7bb3cff2f74ef7d95c6a459;p=thirdparty%2Fjson-c.git Define macros from inttypes.h when not available --- diff --git a/json_inttypes.h b/json_inttypes.h index 9de8d246..e86f4ccf 100644 --- a/json_inttypes.h +++ b/json_inttypes.h @@ -4,24 +4,15 @@ #include "json_config.h" -#if defined(_MSC_VER) && _MSC_VER <= 1700 - -/* Anything less than Visual Studio C++ 10 is missing stdint.h and inttypes.h */ -typedef __int32 int32_t; -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX ((int32_t)_I32_MAX) -typedef __int64 int64_t; -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX ((int64_t)_I64_MAX) -#define PRId64 "I64d" -#define SCNd64 "I64d" +#ifdef JSON_C_HAVE_INTTYPES_H +/* inttypes.h includes stdint.h */ +#include #else +#include -#ifdef JSON_C_HAVE_INTTYPES_H -#include -#endif -/* inttypes.h includes stdint.h */ +#define PRId64 "I64d" +#define SCNd64 "I64d" #endif