LLVM API Documentation
00001 /* include/llvm/System/DataTypes.h. Generated from DataTypes.h.in by configure. */ 00002 /*===-- include/System/DataTypes.h - Define fixed size types -----*- C -*-===*\ 00003 |* *| 00004 |* The LLVM Compiler Infrastructure *| 00005 |* *| 00006 |* This file is distributed under the University of Illinois Open Source *| 00007 |* License. See LICENSE.TXT for details. *| 00008 |* *| 00009 |*===----------------------------------------------------------------------===*| 00010 |* *| 00011 |* This file contains definitions to figure out the size of _HOST_ data types.*| 00012 |* This file is important because different host OS's define different macros,*| 00013 |* which makes portability tough. This file exports the following *| 00014 |* definitions: *| 00015 |* *| 00016 |* [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types*| 00017 |* [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values. *| 00018 |* *| 00019 |* No library is required when using these functions. *| 00020 |* *| 00021 |*===----------------------------------------------------------------------===*/ 00022 00023 /* Please leave this file C-compatible. */ 00024 00025 #ifndef SUPPORT_DATATYPES_H 00026 #define SUPPORT_DATATYPES_H 00027 00028 #define HAVE_SYS_TYPES_H 1 00029 #define HAVE_INTTYPES_H 1 00030 #define HAVE_STDINT_H 1 00031 #define HAVE_UINT64_T 1 00032 /* #undef HAVE_U_INT64_T */ 00033 00034 #ifdef __cplusplus 00035 #include <cmath> 00036 #else 00037 #include <math.h> 00038 #endif 00039 00040 /* Note that this header's correct operation depends on __STDC_LIMIT_MACROS 00041 being defined. We would define it here, but in order to prevent Bad Things 00042 happening when system headers or C++ STL headers include stdint.h before we 00043 define it here, we define it on the g++ command line (in Makefile.rules). */ 00044 #if !defined(__STDC_LIMIT_MACROS) 00045 # error "Must #define __STDC_LIMIT_MACROS before #including System/DataTypes.h" 00046 #endif 00047 00048 #if !defined(__STDC_CONSTANT_MACROS) 00049 # error "Must #define __STDC_CONSTANT_MACROS before " \ 00050 "#including System/DataTypes.h" 00051 #endif 00052 00053 /* Note that <inttypes.h> includes <stdint.h>, if this is a C99 system. */ 00054 #ifdef HAVE_SYS_TYPES_H 00055 #include <sys/types.h> 00056 #endif 00057 00058 #ifdef HAVE_INTTYPES_H 00059 #include <inttypes.h> 00060 #endif 00061 00062 #ifdef HAVE_STDINT_H 00063 #include <stdint.h> 00064 #endif 00065 00066 #ifdef _AIX 00067 #include "llvm/System/AIXDataTypesFix.h" 00068 #endif 00069 00070 /* Handle incorrect definition of uint64_t as u_int64_t */ 00071 #ifndef HAVE_UINT64_T 00072 #ifdef HAVE_U_INT64_T 00073 typedef u_int64_t uint64_t; 00074 #else 00075 # error "Don't have a definition for uint64_t on this platform" 00076 #endif 00077 #endif 00078 00079 #ifdef _OpenBSD_ 00080 #define INT8_MAX 127 00081 #define INT8_MIN -128 00082 #define UINT8_MAX 255 00083 #define INT16_MAX 32767 00084 #define INT16_MIN -32768 00085 #define UINT16_MAX 65535 00086 #define INT32_MAX 2147483647 00087 #define INT32_MIN -2147483648 00088 #define UINT32_MAX 4294967295U 00089 #endif 00090 00091 /* Set defaults for constants which we cannot find. */ 00092 #if !defined(INT64_MAX) 00093 # define INT64_MAX 9223372036854775807LL 00094 #endif 00095 #if !defined(INT64_MIN) 00096 # define INT64_MIN ((-INT64_MAX)-1) 00097 #endif 00098 #if !defined(UINT64_MAX) 00099 # define UINT64_MAX 0xffffffffffffffffULL 00100 #endif 00101 00102 #if __GNUC__ > 3 00103 #define END_WITH_NULL __attribute__((sentinel)) 00104 #else 00105 #define END_WITH_NULL 00106 #endif 00107 00108 #ifndef HUGE_VALF 00109 #define HUGE_VALF (float)HUGE_VAL 00110 #endif 00111 00112 #endif /* SUPPORT_DATATYPES_H */