llvm.org GIT mirror llvm / b5e8bc1
Support/DataTypes.h: Clean up some types and add matching (but presumably unused) code from .cmake to DataTypes.h.in so that the files are essentially in sync module differences in autoconf/cmake replacement syntax. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141702 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 9 years ago
2 changed file(s) with 92 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
1414 |* [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types*|
1515 |* [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values. *|
1616 |* *|
17 |* No library is required when using these functinons. *|
17 |* No library is required when using these functions. *|
1818 |* *|
1919 |*===----------------------------------------------------------------------===*/
2020
2121 /* Please leave this file C-compatible. */
22
23 /* Please keep this file in sync with DataTypes.h.in */
2224
2325 #ifndef SUPPORT_DATATYPES_H
2426 #define SUPPORT_DATATYPES_H
None /*===-- include/System/DataTypes.h - Define fixed size types -----*- C -*-===*\
0 /*===-- include/Support/DataTypes.h - Define fixed size types -----*- C -*-===*\
11 |* *|
22 |* The LLVM Compiler Infrastructure *|
33 |* *|
2020
2121 /* Please leave this file C-compatible. */
2222
23 /* Please keep this file in sync with DataTypes.h.cmake */
24
2325 #ifndef SUPPORT_DATATYPES_H
2426 #define SUPPORT_DATATYPES_H
2527
3537 #include
3638 #endif
3739
40 #ifndef _MSC_VER
41
3842 /* Note that this header's correct operation depends on __STDC_LIMIT_MACROS
3943 being defined. We would define it here, but in order to prevent Bad Things
4044 happening when system headers or C++ STL headers include stdint.h before we
4145 define it here, we define it on the g++ command line (in Makefile.rules). */
4246 #if !defined(__STDC_LIMIT_MACROS)
43 # error "Must #define __STDC_LIMIT_MACROS before #including System/DataTypes.h"
47 # error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
4448 #endif
4549
4650 #if !defined(__STDC_CONSTANT_MACROS)
4751 # error "Must #define __STDC_CONSTANT_MACROS before " \
48 "#including System/DataTypes.h"
52 "#including Support/DataTypes.h"
4953 #endif
5054
5155 /* Note that includes , if this is a C99 system. */
8690 #define UINT32_MAX 4294967295U
8791 #endif
8892
93 #else /* _MSC_VER */
94 /* Visual C++ doesn't provide standard integer headers, but it does provide
95 built-in data types. */
96 #include
97 #include
98 #include
99 #ifdef __cplusplus
100 #include
101 #else
102 #include
103 #endif
104 typedef __int64 int64_t;
105 typedef unsigned __int64 uint64_t;
106 typedef signed int int32_t;
107 typedef unsigned int uint32_t;
108 typedef short int16_t;
109 typedef unsigned short uint16_t;
110 typedef signed char int8_t;
111 typedef unsigned char uint8_t;
112 typedef signed int ssize_t;
113 #ifndef INT8_MAX
114 # define INT8_MAX 127
115 #endif
116 #ifndef INT8_MIN
117 # define INT8_MIN -128
118 #endif
119 #ifndef UINT8_MAX
120 # define UINT8_MAX 255
121 #endif
122 #ifndef INT16_MAX
123 # define INT16_MAX 32767
124 #endif
125 #ifndef INT16_MIN
126 # define INT16_MIN -32768
127 #endif
128 #ifndef UINT16_MAX
129 # define UINT16_MAX 65535
130 #endif
131 #ifndef INT32_MAX
132 # define INT32_MAX 2147483647
133 #endif
134 #ifndef INT32_MIN
135 /* MSC treats -2147483648 as -(2147483648U). */
136 # define INT32_MIN (-INT32_MAX - 1)
137 #endif
138 #ifndef UINT32_MAX
139 # define UINT32_MAX 4294967295U
140 #endif
141 /* Certain compatibility updates to VC++ introduce the `cstdint'
142 * header, which defines the INT*_C macros. On default installs they
143 * are absent. */
144 #ifndef INT8_C
145 # define INT8_C(C) C##i8
146 #endif
147 #ifndef UINT8_C
148 # define UINT8_C(C) C##ui8
149 #endif
150 #ifndef INT16_C
151 # define INT16_C(C) C##i16
152 #endif
153 #ifndef UINT16_C
154 # define UINT16_C(C) C##ui16
155 #endif
156 #ifndef INT32_C
157 # define INT32_C(C) C##i32
158 #endif
159 #ifndef UINT32_C
160 # define UINT32_C(C) C##ui32
161 #endif
162 #ifndef INT64_C
163 # define INT64_C(C) C##i64
164 #endif
165 #ifndef UINT64_C
166 # define UINT64_C(C) C##ui64
167 #endif
168
169 #ifndef PRIx64
170 # define PRIx64 "I64x"
171 #endif
172
173 #endif /* _MSC_VER */
174
89175 /* Set defaults for constants which we cannot find. */
90176 #if !defined(INT64_MAX)
91177 # define INT64_MAX 9223372036854775807LL