diff options
author | Petri Lehtinen <petri@digip.org> | 2014-04-30 12:06:03 +0300 |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2014-04-30 12:06:03 +0300 |
commit | 5b88cc5ded24fd9802358a03794054485fb523f8 (patch) | |
tree | 74fc204f9611ad49d341589167f44a6064567db7 | |
parent | a425f8c650028921adab64b59e7c22fe0635f879 (diff) | |
parent | db285b37649ffffabbb767029d4ca83af2e6f83d (diff) | |
download | jansson-5b88cc5ded24fd9802358a03794054485fb523f8.zip jansson-5b88cc5ded24fd9802358a03794054485fb523f8.tar.gz jansson-5b88cc5ded24fd9802358a03794054485fb523f8.tar.bz2 |
Merge branch '2.6'
-rw-r--r-- | CMakeLists.txt | 30 | ||||
-rw-r--r-- | cmake/jansson_private_config.h.cmake | 10 | ||||
-rw-r--r-- | configure.ac | 2 |
3 files changed, 40 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index edd202c..91aa11a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,10 +149,12 @@ else () message (FATAL_ERROR "Could not detect a valid 32-bit integer type") endif () -check_type_size (uint32_t UINT32_T) -check_type_size (__uint32 __UINT32) check_type_size ("unsigned long" UNSIGNED_LONG_INT) check_type_size ("unsigned int" UNSIGNED_INT) +check_type_size ("unsigned short" UNSIGNED_SHORT) + +check_type_size (uint32_t UINT32_T) +check_type_size (__uint32 __UINT32) if (HAVE_UINT32_T) set (JSON_UINT32 uint32_t) elseif (HAVE___UINT32) @@ -165,6 +167,30 @@ else () message (FATAL_ERROR "Could not detect a valid unsigned 32-bit integer type") endif () +check_type_size (uint16_t UINT16_T) +check_type_size (__uint16 __UINT16) +if (HAVE_UINT16_T) + set (JSON_UINT16 uint16_t) +elseif (HAVE___UINT16) + set (JSON_UINT16 __uint16) +elseif (HAVE_UNSIGNED_INT AND (${UNSIGNED_INT} EQUAL 2)) + set (JSON_UINT16 "unsigned int") +elseif (HAVE_UNSIGNED_SHORT AND (${UNSIGNED_SHORT} EQUAL 2)) + set (JSON_UINT16 "unsigned short") +else () + message (FATAL_ERROR "Could not detect a valid unsigned 16-bit integer type") +endif () + +check_type_size (uint8_t UINT8_T) +check_type_size (__uint8 __UINT8) +if (HAVE_UINT8_T) + set (JSON_UINT8 uint8_t) +elseif (HAVE___UINT8) + set (JSON_UINT8 __uint8) +else () + set (JSON_UINT8 "unsigned char") +endif () + # Check for ssize_t and SSIZE_T existance. check_type_size(ssize_t SSIZE_T) check_type_size(SSIZE_T UPPERCASE_SSIZE_T) diff --git a/cmake/jansson_private_config.h.cmake b/cmake/jansson_private_config.h.cmake index b27b9a3..16e7eb7 100644 --- a/cmake/jansson_private_config.h.cmake +++ b/cmake/jansson_private_config.h.cmake @@ -31,6 +31,16 @@ # define uint32_t @JSON_UINT32@ #endif +#cmakedefine HAVE_UINT16_T 1 +#ifndef HAVE_UINT16_T +# define uint16_t @JSON_UINT16@ +#endif + +#cmakedefine HAVE_UINT8_T 1 +#ifndef HAVE_UINT8_T +# define uint8_t @JSON_UINT8@ +#endif + #cmakedefine HAVE_SSIZE_T 1 #ifndef HAVE_SSIZE_T diff --git a/configure.ac b/configure.ac index cc7aec5..b3f36d1 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,8 @@ AC_CHECK_HEADERS([endian.h fcntl.h locale.h sched.h unistd.h sys/param.h sys/sta # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_INT32_T AC_TYPE_UINT32_T +AC_TYPE_UINT16_T +AC_TYPE_UINT8_T AC_TYPE_LONG_LONG_INT AC_C_INLINE |