Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/int_const.h
+++ new/usr/src/uts/common/sys/int_const.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_CONST_H
28 30 #define _SYS_INT_CONST_H
29 31
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 32 /*
33 33 * This file, <sys/int_const.h>, is part of the Sun Microsystems implementation
34 34 * of <inttypes.h> as proposed in the ISO/JTC1/SC22/WG14 C committee's working
35 35 * draft for the revision of the current ISO C standard, ISO/IEC 9899:1990
36 36 * Programming language - C.
37 37 *
38 38 * Programs/Modules should not directly include this file. Access to the
39 39 * types defined in this file should be through the inclusion of one of the
40 40 * following files:
41 41 *
42 42 * <sys/inttypes.h> Provides the Kernel and Driver appropriate
43 43 * components of <inttypes.h>.
44 44 *
45 45 * <inttypes.h> For use by applications.
46 46 *
47 47 * See these files for more details.
48 48 *
49 49 * Use at your own risk. This file will track the evolution of the revision
50 50 * of the current ISO C standard. As of February 1996, the committee is
51 51 * squarely behind the fixed sized types.
52 52 */
53 53
54 54 #include <sys/feature_tests.h>
55 55
56 56 #ifdef __cplusplus
57 57 extern "C" {
58 58 #endif
59 59
60 60 /*
61 61 * Constants
62 62 *
63 63 * The following macros create constants of the types defined in
64 64 * <sys/int_types.h>. The intent is that:
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
65 65 * Constants defined using these macros have a specific size and
66 66 * signedness. The suffix used for int64_t and uint64_t (ll and ull)
67 67 * are for examples only. Implementations are permitted to use other
68 68 * suffixes.
69 69 *
70 70 * The "CSTYLED" comments are flags to an internal code style analysis tool
71 71 * telling it to silently accept the line which follows. This internal
72 72 * standard requires a space between arguments, but the historical,
73 73 * non-ANSI-C ``method'' of concatenation can't tolerate those spaces.
74 74 */
75 -#ifdef __STDC__
76 75 /* CSTYLED */
77 76 #define __CONCAT__(A,B) A ## B
78 -#else
79 -/* CSTYLED */
80 -#define __CONCAT__(A,B) A/**/B
81 -#endif
82 77
83 -#if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
84 78 #define INT8_C(c) (c)
85 -#endif
86 79 #define INT16_C(c) (c)
87 80 #define INT32_C(c) (c)
88 81 #ifdef _LP64
89 82 /* CSTYLED */
90 83 #define INT64_C(c) __CONCAT__(c,l)
91 84 #else /* _ILP32 */
92 85 #if defined(_LONGLONG_TYPE)
93 86 /* CSTYLED */
94 87 #define INT64_C(c) __CONCAT__(c,ll)
95 88 #endif
96 89 #endif
97 90
98 91 /* CSTYLED */
99 92 #define UINT8_C(c) __CONCAT__(c,u)
100 93 /* CSTYLED */
101 94 #define UINT16_C(c) __CONCAT__(c,u)
102 95 /* CSTYLED */
103 96 #define UINT32_C(c) __CONCAT__(c,u)
104 97 #ifdef _LP64
105 98 /* CSTYLED */
106 99 #define UINT64_C(c) __CONCAT__(c,ul)
107 100 #else /* _ILP32 */
108 101 #if defined(_LONGLONG_TYPE)
109 102 /* CSTYLED */
110 103 #define UINT64_C(c) __CONCAT__(c,ull)
111 104 #endif
112 105 #endif
113 106
114 107 #ifdef _LP64
115 108 /* CSTYLED */
116 109 #define INTMAX_C(c) __CONCAT__(c,l)
117 110 /* CSTYLED */
118 111 #define UINTMAX_C(c) __CONCAT__(c,ul)
119 112 #else /* _ILP32 */
120 113 #if defined(_LONGLONG_TYPE)
121 114 /* CSTYLED */
122 115 #define INTMAX_C(c) __CONCAT__(c,ll)
123 116 /* CSTYLED */
124 117 #define UINTMAX_C(c) __CONCAT__(c,ull)
125 118 #else
126 119 #define INTMAX_C(c) (c)
127 120 #define UINTMAX_C(c) (c)
128 121 #endif
129 122 #endif
130 123
131 124 #ifdef __cplusplus
132 125 }
133 126 #endif
134 127
135 128 #endif /* _SYS_INT_CONST_H */
↓ open down ↓ |
40 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX