Define macros from inttypes.h when not available

This commit is contained in:
James Myatt
2015-03-04 10:45:36 +00:00
parent 9be71700eb
commit 720d566d03
+6 -15
View File
@@ -4,25 +4,16 @@
#include "json_config.h"
#if defined(_MSC_VER) && _MSC_VER <= 1700
#ifdef JSON_C_HAVE_INTTYPES_H
/* inttypes.h includes stdint.h */
#include <inttypes.h>
#else
#include <stdint.h>
/* 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"
#else
#ifdef JSON_C_HAVE_INTTYPES_H
#include <inttypes.h>
#endif
/* inttypes.h includes stdint.h */
#endif
#endif