Added support for standard 64-bit integer type.
This commit is contained in:
parent
86f0e14ea5
commit
5084db331c
@ -17,6 +17,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6 FATAL_ERROR)
|
|||||||
INCLUDE(cmake/Utils.cmake)
|
INCLUDE(cmake/Utils.cmake)
|
||||||
|
|
||||||
INCLUDE(CheckIncludeFiles)
|
INCLUDE(CheckIncludeFiles)
|
||||||
|
INCLUDE(CheckIncludeFileCxx)
|
||||||
INCLUDE(CheckFunctionExists)
|
INCLUDE(CheckFunctionExists)
|
||||||
INCLUDE(CheckSymbolExists)
|
INCLUDE(CheckSymbolExists)
|
||||||
INCLUDE(CheckTypeSize)
|
INCLUDE(CheckTypeSize)
|
||||||
@ -448,6 +449,8 @@ ELSE(BIGENDIAN EQUAL 0)
|
|||||||
ENDIF(BIGENDIAN EQUAL 0)
|
ENDIF(BIGENDIAN EQUAL 0)
|
||||||
|
|
||||||
|
|
||||||
|
CHECK_INCLUDE_FILE_CXX(cstdint VMIME_HAVE_CSTDINT)
|
||||||
|
|
||||||
CHECK_TYPE_SIZE("char" SIZEOF_CHAR)
|
CHECK_TYPE_SIZE("char" SIZEOF_CHAR)
|
||||||
CHECK_TYPE_SIZE("short" SIZEOF_SHORT)
|
CHECK_TYPE_SIZE("short" SIZEOF_SHORT)
|
||||||
CHECK_TYPE_SIZE("int" SIZEOF_INT)
|
CHECK_TYPE_SIZE("int" SIZEOF_INT)
|
||||||
@ -455,6 +458,11 @@ CHECK_TYPE_SIZE("long" SIZEOF_LONG)
|
|||||||
CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
|
CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
|
||||||
CHECK_TYPE_SIZE("__int64" SIZEOF___INT64)
|
CHECK_TYPE_SIZE("__int64" SIZEOF___INT64)
|
||||||
|
|
||||||
|
SET(CMAKE_EXTRA_INCLUDE_FILES cstdint)
|
||||||
|
CHECK_TYPE_SIZE("int64_t" SIZEOF_INT64_T)
|
||||||
|
SET(CMAKE_EXTRA_INCLUDE_FILES)
|
||||||
|
|
||||||
|
|
||||||
IF(SIZEOF_CHAR EQUAL 1)
|
IF(SIZEOF_CHAR EQUAL 1)
|
||||||
SET(VMIME_8BIT_TYPE "char")
|
SET(VMIME_8BIT_TYPE "char")
|
||||||
ELSE()
|
ELSE()
|
||||||
@ -494,10 +502,14 @@ ELSE()
|
|||||||
IF(SIZEOF_LONG_LONG EQUAL 8)
|
IF(SIZEOF_LONG_LONG EQUAL 8)
|
||||||
SET(VMIME_64BIT_TYPE "long long")
|
SET(VMIME_64BIT_TYPE "long long")
|
||||||
ELSE()
|
ELSE()
|
||||||
IF(SIZEOF___INT64 EQUAL 8)
|
IF(SIZEOF_INT64_T EQUAL 8)
|
||||||
SET(VMIME_64BIT_TYPE "__int64")
|
SET(VMIME_64BIT_TYPE "int64_t")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(FATAL_ERROR "Cannot determine 64-bit type")
|
IF(SIZEOF___INT64 EQUAL 8)
|
||||||
|
SET(VMIME_64BIT_TYPE "__int64")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(FATAL_ERROR "Cannot determine 64-bit type")
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@ -895,7 +907,7 @@ ELSE()
|
|||||||
|
|
||||||
SET(
|
SET(
|
||||||
CMAKE_CXX_FLAGS
|
CMAKE_CXX_FLAGS
|
||||||
"${CMAKE_CXX_FLAGS} -D_REENTRANT=1 -W -Wall -ansi -pedantic -Wpointer-arith -Wold-style-cast -Wconversion -Wcast-align"
|
"${CMAKE_CXX_FLAGS} -D_REENTRANT=1 -W -Wall -ansi -pedantic -Wpointer-arith -Wold-style-cast -Wconversion -Wcast-align -Wno-long-long"
|
||||||
CACHE STRING
|
CACHE STRING
|
||||||
"g++ Compiler Flags"
|
"g++ Compiler Flags"
|
||||||
FORCE
|
FORCE
|
||||||
|
@ -28,6 +28,11 @@
|
|||||||
#define VMIME_BYTE_ORDER_LITTLE_ENDIAN @VMIME_BYTE_ORDER_LITTLE_ENDIAN@
|
#define VMIME_BYTE_ORDER_LITTLE_ENDIAN @VMIME_BYTE_ORDER_LITTLE_ENDIAN@
|
||||||
|
|
||||||
// Generic types
|
// Generic types
|
||||||
|
#cmakedefine01 VMIME_HAVE_CSTDINT
|
||||||
|
#if VMIME_HAVE_CSTDINT
|
||||||
|
# include <cstdint>
|
||||||
|
#endif
|
||||||
|
|
||||||
// -- 8-bit
|
// -- 8-bit
|
||||||
typedef signed @VMIME_8BIT_TYPE@ vmime_int8;
|
typedef signed @VMIME_8BIT_TYPE@ vmime_int8;
|
||||||
typedef unsigned @VMIME_8BIT_TYPE@ vmime_uint8;
|
typedef unsigned @VMIME_8BIT_TYPE@ vmime_uint8;
|
||||||
|
Loading…
Reference in New Issue
Block a user