diff --git a/CMakeLists.txt b/CMakeLists.txt index 696b276..07aab7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,14 +74,14 @@ check_type_size (__int32 __INT32) check_type_size ("long" LONG_INT) check_type_size ("int" INT) -if (HAVE___INT32) +if (HAVE_INT32_T) + set (JSON_INT32 int32_t) +elseif (HAVE___INT32) set (JSON_INT32 __int32) elseif (HAVE_LONG AND (${LONG_INT} EQUAL 4)) set (JSON_INT32 long) elseif (HAVE_INT AND (${INT} EQUAL 4)) set (JSON_INT32 int) -elseif (HAVE_INT32_T) - set (JSON_INT32 int32_t) else () message (FATAL_ERROR "Could not detect a valid 32 bit integer type") endif () diff --git a/config.h.cmake b/config.h.cmake index c4e5a33..6f854ec 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -1,7 +1,20 @@ /* Reduced down to the defines that are actually used in the code */ -/* Define to 1 if you have the header file. */ +/* Define to 1 if you have the (and friends) header file. */ #cmakedefine HAVE_INTTYPES_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 + +/* We must include this here, as in (eg) utf.h it will want to use + the integer type, which in MSVC2010 will be in stdint.h + (there is no inttypes.h in MSVC2010) */ +#if defined(HAVE_STDINT_H) +# include +#elif defined(HAVE_INTTYPES_H) +# include +#elif defined(HAVE_SYS_TYPES_H) +# include +#endif /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LOCALE_H 1