1 //===-- include/Support/DataTypes.h - Define fixed size types ---*- C++ -*-===//
3 // This file contains definitions to figure out the size of _HOST_ data types.
4 // This file is important because different host OS's define different macros,
5 // which makes portability tough. This file exports the following definitions:
7 // ENDIAN_LITTLE : is #define'd if the host is little endian
8 // int64_t : is a typedef for the signed 64 bit system type
9 // uint64_t : is a typedef for the unsigned 64 bit system type
10 // INT64_MAX : is a #define specifying the max value for int64_t's
12 // No library is required when using these functinons.
14 //===----------------------------------------------------------------------===//
16 #ifndef SUPPORT_DATATYPES_H
17 #define SUPPORT_DATATYPES_H
19 #include "Config/config.h"
21 #define __STDC_LIMIT_MACROS 1
23 #ifdef HAVE_INTTYPES_H
27 #ifdef HAVE_SYS_TYPES_H
28 #include <sys/types.h>
31 #if (defined(ENDIAN_LITTLE) && defined(ENDIAN_BIG))
32 #error "Cannot define both ENDIAN_LITTLE and ENDIAN_BIG!"
35 #if (!defined(ENDIAN_LITTLE) && !defined(ENDIAN_BIG))
36 #error "include/Support/DataTypes.h could not determine endianness!"
39 #if !defined(INT64_MAX)
40 /* We couldn't determine INT64_MAX; default it. */
41 #define INT64_MAX 9223372036854775807LL
43 #if !defined(UINT64_MAX)
44 #define UINT64_MAX 0xffffffffffffffffULL
47 #endif /* SUPPORT_DATATYPES_H */