]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - lib/clang/include/llvm/Support/DataTypes.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / lib / clang / include / llvm / Support / DataTypes.h
1 /* $FreeBSD$ */
2 /* include/llvm/Support/DataTypes.h.  Generated from DataTypes.h.in by configure.  */
3 /*===-- include/System/DataTypes.h - Define fixed size types -----*- C -*-===*\
4 |*                                                                            *|
5 |*                     The LLVM Compiler Infrastructure                       *|
6 |*                                                                            *|
7 |* This file is distributed under the University of Illinois Open Source      *|
8 |* License. See LICENSE.TXT for details.                                      *|
9 |*                                                                            *|
10 |*===----------------------------------------------------------------------===*|
11 |*                                                                            *|
12 |* This file contains definitions to figure out the size of _HOST_ data types.*|
13 |* This file is important because different host OS's define different macros,*|
14 |* which makes portability tough.  This file exports the following            *|
15 |* definitions:                                                               *|
16 |*                                                                            *|
17 |*   [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types*|
18 |*   [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values.     *|
19 |*                                                                            *|
20 |* No library is required when using these functions.                         *|
21 |*                                                                            *|
22 |*===----------------------------------------------------------------------===*/
23
24 /* Please leave this file C-compatible. */
25
26 #ifndef SUPPORT_DATATYPES_H
27 #define SUPPORT_DATATYPES_H
28
29 #define HAVE_SYS_TYPES_H 1
30 #define HAVE_INTTYPES_H 1
31 #define HAVE_STDINT_H 1
32 #define HAVE_UINT64_T 1
33 /* #undef HAVE_U_INT64_T */
34
35 #ifdef __cplusplus
36 #include <cmath>
37 #else
38 #include <math.h>
39 #endif
40
41 /* Note that this header's correct operation depends on __STDC_LIMIT_MACROS
42    being defined.  We would define it here, but in order to prevent Bad Things
43    happening when system headers or C++ STL headers include stdint.h before we
44    define it here, we define it on the g++ command line (in Makefile.rules). */
45 #if !defined(__STDC_LIMIT_MACROS)
46 # error "Must #define __STDC_LIMIT_MACROS before #including System/DataTypes.h"
47 #endif
48
49 #if !defined(__STDC_CONSTANT_MACROS)
50 # error "Must #define __STDC_CONSTANT_MACROS before " \
51         "#including System/DataTypes.h"
52 #endif
53
54 /* Note that <inttypes.h> includes <stdint.h>, if this is a C99 system. */
55 #ifdef HAVE_SYS_TYPES_H
56 #include <sys/types.h>
57 #endif
58
59 #ifdef HAVE_INTTYPES_H
60 #include <inttypes.h>
61 #endif
62
63 #ifdef HAVE_STDINT_H
64 #include <stdint.h>
65 #endif
66
67 #ifdef _AIX
68 #include "llvm/Support/AIXDataTypesFix.h"
69 #endif
70
71 /* Handle incorrect definition of uint64_t as u_int64_t */
72 #ifndef HAVE_UINT64_T
73 #ifdef HAVE_U_INT64_T
74 typedef u_int64_t uint64_t;
75 #else
76 # error "Don't have a definition for uint64_t on this platform"
77 #endif
78 #endif
79
80 #ifdef _OpenBSD_
81 #define INT8_MAX 127
82 #define INT8_MIN -128
83 #define UINT8_MAX 255
84 #define INT16_MAX 32767
85 #define INT16_MIN -32768
86 #define UINT16_MAX 65535
87 #define INT32_MAX 2147483647
88 #define INT32_MIN -2147483648
89 #define UINT32_MAX 4294967295U
90 #endif
91
92 /* Set defaults for constants which we cannot find. */
93 #if !defined(INT64_MAX)
94 # define INT64_MAX 9223372036854775807LL
95 #endif
96 #if !defined(INT64_MIN)
97 # define INT64_MIN ((-INT64_MAX)-1)
98 #endif
99 #if !defined(UINT64_MAX)
100 # define UINT64_MAX 0xffffffffffffffffULL
101 #endif
102
103 #if __GNUC__ > 3
104 #define END_WITH_NULL __attribute__((sentinel))
105 #else
106 #define END_WITH_NULL
107 #endif
108
109 #ifndef HUGE_VALF
110 #define HUGE_VALF (float)HUGE_VAL
111 #endif
112
113 #endif  /* SUPPORT_DATATYPES_H */