include: demolish _LONGLONG_TYPE; consider "long long" always valid
[unleashed.git] / include / sys / int_const.h
blob7d73042992c5b8229525976ed0b382ecce9931f2
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
25 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
29 #ifndef _SYS_INT_CONST_H
30 #define _SYS_INT_CONST_H
33 * This file, <sys/int_const.h>, is part of the Sun Microsystems implementation
34 * of <inttypes.h> as proposed in the ISO/JTC1/SC22/WG14 C committee's working
35 * draft for the revision of the current ISO C standard, ISO/IEC 9899:1990
36 * Programming language - C.
38 * Programs/Modules should not directly include this file. Access to the
39 * types defined in this file should be through the inclusion of one of the
40 * following files:
42 * <sys/inttypes.h> Provides the Kernel and Driver appropriate
43 * components of <inttypes.h>.
45 * <inttypes.h> For use by applications.
47 * See these files for more details.
49 * Use at your own risk. This file will track the evolution of the revision
50 * of the current ISO C standard. As of February 1996, the committee is
51 * squarely behind the fixed sized types.
54 #include <sys/feature_tests.h>
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
61 * Constants
63 * The following macros create constants of the types defined in
64 * <sys/int_types.h>. The intent is that:
65 * Constants defined using these macros have a specific size and
66 * signedness. The suffix used for int64_t and uint64_t (ll and ull)
67 * are for examples only. Implementations are permitted to use other
68 * suffixes.
70 * The "CSTYLED" comments are flags to an internal code style analysis tool
71 * telling it to silently accept the line which follows. This internal
72 * standard requires a space between arguments, but the historical,
73 * non-ANSI-C ``method'' of concatenation can't tolerate those spaces.
75 /* CSTYLED */
76 #define __CONCAT__(A,B) A ## B
78 #define INT8_C(c) (c)
79 #define INT16_C(c) (c)
80 #define INT32_C(c) (c)
81 #ifdef _LP64
82 /* CSTYLED */
83 #define INT64_C(c) __CONCAT__(c,l)
84 #else /* _ILP32 */
85 /* CSTYLED */
86 #define INT64_C(c) __CONCAT__(c,ll)
87 #endif
89 /* CSTYLED */
90 #define UINT8_C(c) __CONCAT__(c,u)
91 /* CSTYLED */
92 #define UINT16_C(c) __CONCAT__(c,u)
93 /* CSTYLED */
94 #define UINT32_C(c) __CONCAT__(c,u)
95 #ifdef _LP64
96 /* CSTYLED */
97 #define UINT64_C(c) __CONCAT__(c,ul)
98 #else /* _ILP32 */
99 /* CSTYLED */
100 #define UINT64_C(c) __CONCAT__(c,ull)
101 #endif
103 #ifdef _LP64
104 /* CSTYLED */
105 #define INTMAX_C(c) __CONCAT__(c,l)
106 /* CSTYLED */
107 #define UINTMAX_C(c) __CONCAT__(c,ul)
108 #else /* _ILP32 */
109 /* CSTYLED */
110 #define INTMAX_C(c) __CONCAT__(c,ll)
111 /* CSTYLED */
112 #define UINTMAX_C(c) __CONCAT__(c,ull)
113 #endif
115 #ifdef __cplusplus
117 #endif
119 #endif /* _SYS_INT_CONST_H */