Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/int_types.h
+++ new/usr/src/uts/common/sys/int_types.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 + *
23 25 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 26 * Use is subject to license terms.
25 27 */
26 28
27 29 #ifndef _SYS_INT_TYPES_H
28 30 #define _SYS_INT_TYPES_H
29 31
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 32 /*
33 33 * This file, <sys/int_types.h>, is part of the Sun Microsystems implementation
34 34 * of <inttypes.h> defined in the ISO C standard, ISO/IEC 9899:1999
35 35 * Programming language - C.
36 36 *
37 37 * Programs/Modules should not directly include this file. Access to the
38 38 * types defined in this file should be through the inclusion of one of the
39 39 * following files:
40 40 *
41 41 * <sys/types.h> Provides only the "_t" types defined in this
42 42 * file which is a subset of the contents of
43 43 * <inttypes.h>. (This can be appropriate for
44 44 * all programs/modules except those claiming
45 45 * ANSI-C conformance.)
46 46 *
47 47 * <sys/inttypes.h> Provides the Kernel and Driver appropriate
48 48 * components of <inttypes.h>.
49 49 *
50 50 * <inttypes.h> For use by applications.
51 51 *
52 52 * See these files for more details.
53 53 */
54 54
55 55 #include <sys/feature_tests.h>
56 56
57 57 #ifdef __cplusplus
58 58 extern "C" {
59 59 #endif
60 60
61 61 /*
62 62 * Basic / Extended integer types
63 63 *
64 64 * The following defines the basic fixed-size integer types.
65 65 *
66 66 * Implementations are free to typedef them to Standard C integer types or
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
67 67 * extensions that they support. If an implementation does not support one
68 68 * of the particular integer data types below, then it should not define the
69 69 * typedefs and macros corresponding to that data type. Note that int8_t
70 70 * is not defined in -Xs mode on ISAs for which the ABI specifies "char"
71 71 * as an unsigned entity because there is no way to define an eight bit
72 72 * signed integral.
73 73 */
74 74 #if defined(_CHAR_IS_SIGNED)
75 75 typedef char int8_t;
76 76 #else
77 -#if defined(__STDC__)
78 77 typedef signed char int8_t;
79 78 #endif
80 -#endif
81 79 typedef short int16_t;
82 80 typedef int int32_t;
83 81 #ifdef _LP64
84 82 #define _INT64_TYPE
85 83 typedef long int64_t;
86 84 #else /* _ILP32 */
87 85 #if defined(_LONGLONG_TYPE)
88 86 #define _INT64_TYPE
89 87 typedef long long int64_t;
90 88 #endif
91 89 #endif
92 90
93 91 typedef unsigned char uint8_t;
94 92 typedef unsigned short uint16_t;
95 93 typedef unsigned int uint32_t;
96 94 #ifdef _LP64
97 95 typedef unsigned long uint64_t;
98 96 #else /* _ILP32 */
99 97 #if defined(_LONGLONG_TYPE)
100 98 typedef unsigned long long uint64_t;
101 99 #endif
102 100 #endif
103 101
104 102 /*
105 103 * intmax_t and uintmax_t are to be the longest (in number of bits) signed
106 104 * and unsigned integer types supported by the implementation.
107 105 */
108 106 #if defined(_INT64_TYPE)
109 107 typedef int64_t intmax_t;
110 108 typedef uint64_t uintmax_t;
111 109 #else
112 110 typedef int32_t intmax_t;
113 111 typedef uint32_t uintmax_t;
114 112 #endif
115 113
116 114 /*
117 115 * intptr_t and uintptr_t are signed and unsigned integer types large enough
118 116 * to hold any data pointer; that is, data pointers can be assigned into or
119 117 * from these integer types without losing precision.
120 118 */
121 119 #if defined(_LP64) || defined(_I32LPx)
122 120 typedef long intptr_t;
123 121 typedef unsigned long uintptr_t;
124 122 #else
125 123 typedef int intptr_t;
↓ open down ↓ |
35 lines elided |
↑ open up ↑ |
126 124 typedef unsigned int uintptr_t;
127 125 #endif
128 126
129 127 /*
130 128 * The following define the fastest integer types that can hold the
131 129 * specified number of bits.
132 130 */
133 131 #if defined(_CHAR_IS_SIGNED)
134 132 typedef char int_fast8_t;
135 133 #else
136 -#if defined(__STDC__)
137 134 typedef signed char int_fast8_t;
138 135 #endif
139 -#endif
140 136 typedef int int_fast16_t;
141 137 typedef int int_fast32_t;
142 138 #ifdef _LP64
143 139 typedef long int_fast64_t;
144 140 #else /* _ILP32 */
145 141 #if defined(_LONGLONG_TYPE)
146 142 typedef long long int_fast64_t;
147 143 #endif
148 144 #endif
149 145
150 146 typedef unsigned char uint_fast8_t;
151 147 typedef unsigned int uint_fast16_t;
152 148 typedef unsigned int uint_fast32_t;
153 149 #ifdef _LP64
154 150 typedef unsigned long uint_fast64_t;
155 151 #else /* _ILP32 */
156 152 #if defined(_LONGLONG_TYPE)
157 153 typedef unsigned long long uint_fast64_t;
↓ open down ↓ |
8 lines elided |
↑ open up ↑ |
158 154 #endif
159 155 #endif
160 156
161 157 /*
162 158 * The following define the smallest integer types that can hold the
163 159 * specified number of bits.
164 160 */
165 161 #if defined(_CHAR_IS_SIGNED)
166 162 typedef char int_least8_t;
167 163 #else
168 -#if defined(__STDC__)
169 164 typedef signed char int_least8_t;
170 165 #endif
171 -#endif
172 166 typedef short int_least16_t;
173 167 typedef int int_least32_t;
174 168 #ifdef _LP64
175 169 typedef long int_least64_t;
176 170 #else /* _ILP32 */
177 171 #if defined(_LONGLONG_TYPE)
178 172 typedef long long int_least64_t;
179 173 #endif
180 174 #endif
181 175
182 176 typedef unsigned char uint_least8_t;
183 177 typedef unsigned short uint_least16_t;
184 178 typedef unsigned int uint_least32_t;
185 179 #ifdef _LP64
186 180 typedef unsigned long uint_least64_t;
187 181 #else /* _ILP32 */
188 182 #if defined(_LONGLONG_TYPE)
189 183 typedef unsigned long long uint_least64_t;
190 184 #endif
191 185 #endif
192 186
193 187 #ifdef __cplusplus
194 188 }
195 189 #endif
196 190
197 191 #endif /* _SYS_INT_TYPES_H */
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX