xref: /onnv-gate/usr/src/uts/common/sys/int_fmtio.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef _SYS_INT_FMTIO_H
28*0Sstevel@tonic-gate #define	_SYS_INT_FMTIO_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate /*
33*0Sstevel@tonic-gate  * This file, <sys/int_fmtio.h>, is part of the Sun Microsystems implementation
34*0Sstevel@tonic-gate  * of <inttypes.h> as defined by the ISO C Standard, ISO/IEC 9899:1999
35*0Sstevel@tonic-gate  * Programming language - C.
36*0Sstevel@tonic-gate  *
37*0Sstevel@tonic-gate  * ISO  International Organization for Standardization.
38*0Sstevel@tonic-gate  *
39*0Sstevel@tonic-gate  * Programs/Modules should not directly include this file.  Access to the
40*0Sstevel@tonic-gate  * types defined in this file should be through the inclusion of one of the
41*0Sstevel@tonic-gate  * following files:
42*0Sstevel@tonic-gate  *
43*0Sstevel@tonic-gate  *	<sys/inttypes.h>	Provides the Kernel and Driver appropriate
44*0Sstevel@tonic-gate  *				components of <inttypes.h>.
45*0Sstevel@tonic-gate  *
46*0Sstevel@tonic-gate  *	<inttypes.h>		For use by applications.
47*0Sstevel@tonic-gate  *
48*0Sstevel@tonic-gate  * See these files for more details.
49*0Sstevel@tonic-gate  */
50*0Sstevel@tonic-gate 
51*0Sstevel@tonic-gate #include <sys/feature_tests.h>
52*0Sstevel@tonic-gate 
53*0Sstevel@tonic-gate #ifdef __cplusplus
54*0Sstevel@tonic-gate extern "C" {
55*0Sstevel@tonic-gate #endif
56*0Sstevel@tonic-gate 
57*0Sstevel@tonic-gate /*
58*0Sstevel@tonic-gate  * Formatted I/O
59*0Sstevel@tonic-gate  *
60*0Sstevel@tonic-gate  * The following macros can be used even when an implementation has not
61*0Sstevel@tonic-gate  * extended the printf/scanf family of functions.
62*0Sstevel@tonic-gate  *
63*0Sstevel@tonic-gate  * The form of the names of the macros is either "PRI" for printf specifiers
64*0Sstevel@tonic-gate  * or "SCN" for scanf specifiers, followed by the conversion specifier letter
65*0Sstevel@tonic-gate  * followed by the datatype size. For example, PRId32 is the macro for
66*0Sstevel@tonic-gate  * the printf d conversion specifier with the flags for 32 bit datatype.
67*0Sstevel@tonic-gate  *
68*0Sstevel@tonic-gate  * An example using one of these macros:
69*0Sstevel@tonic-gate  *
70*0Sstevel@tonic-gate  *	uint64_t u;
71*0Sstevel@tonic-gate  *	printf("u = %016" PRIx64 "\n", u);
72*0Sstevel@tonic-gate  *
73*0Sstevel@tonic-gate  * For the purpose of example, the definitions of the printf/scanf macros
74*0Sstevel@tonic-gate  * below have the values appropriate for a machine with 8 bit shorts, 16
75*0Sstevel@tonic-gate  * bit shorts, 32 bit ints, 32 or 64 bit longs depending on compilation
76*0Sstevel@tonic-gate  * mode, and 64 bit long longs.
77*0Sstevel@tonic-gate  */
78*0Sstevel@tonic-gate 
79*0Sstevel@tonic-gate /*
80*0Sstevel@tonic-gate  * fprintf macros for signed integers
81*0Sstevel@tonic-gate  */
82*0Sstevel@tonic-gate #if defined(_KERNEL)
83*0Sstevel@tonic-gate #define	_MODF8	""
84*0Sstevel@tonic-gate #define	_MODF16	""
85*0Sstevel@tonic-gate #else
86*0Sstevel@tonic-gate #define	_MODF8	"hh"
87*0Sstevel@tonic-gate #define	_MODF16	"h"
88*0Sstevel@tonic-gate #endif
89*0Sstevel@tonic-gate 
90*0Sstevel@tonic-gate #define	_PRId	"d"
91*0Sstevel@tonic-gate #define	_PRIi	"i"
92*0Sstevel@tonic-gate #define	_PRIo	"o"
93*0Sstevel@tonic-gate #define	_PRIu	"u"
94*0Sstevel@tonic-gate #define	_PRIx	"x"
95*0Sstevel@tonic-gate #define	_PRIX	"X"
96*0Sstevel@tonic-gate 
97*0Sstevel@tonic-gate #if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
98*0Sstevel@tonic-gate #define	PRId8			_MODF8 _PRId
99*0Sstevel@tonic-gate #define	PRIdLEAST8		PRId8
100*0Sstevel@tonic-gate #define	PRIdFAST8		PRId8
101*0Sstevel@tonic-gate #endif
102*0Sstevel@tonic-gate #define	PRId16			_MODF16 _PRId
103*0Sstevel@tonic-gate #define	PRIdLEAST16		PRId16
104*0Sstevel@tonic-gate #define	PRId32			"d"
105*0Sstevel@tonic-gate #define	PRIdFAST16		PRId32
106*0Sstevel@tonic-gate #define	PRIdLEAST32		PRId32
107*0Sstevel@tonic-gate #define	PRIdFAST32		PRId32
108*0Sstevel@tonic-gate #ifdef  _LP64
109*0Sstevel@tonic-gate #define	PRId64			"ld"
110*0Sstevel@tonic-gate #else   /* _ILP32 */
111*0Sstevel@tonic-gate #if defined(_LONGLONG_TYPE)
112*0Sstevel@tonic-gate #define	PRId64			"lld"
113*0Sstevel@tonic-gate #endif
114*0Sstevel@tonic-gate #endif
115*0Sstevel@tonic-gate #ifdef PRId64
116*0Sstevel@tonic-gate #define	PRIdLEAST64		PRId64
117*0Sstevel@tonic-gate #define	PRIdFAST64		PRId64
118*0Sstevel@tonic-gate #endif
119*0Sstevel@tonic-gate 
120*0Sstevel@tonic-gate #if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
121*0Sstevel@tonic-gate #define	PRIi8			_MODF8 _PRIi
122*0Sstevel@tonic-gate #define	PRIiLEAST8		PRIi8
123*0Sstevel@tonic-gate #define	PRIiFAST8		PRIi8
124*0Sstevel@tonic-gate #endif
125*0Sstevel@tonic-gate #define	PRIi16			_MODF16 _PRIi
126*0Sstevel@tonic-gate #define	PRIiLEAST16		PRIi16
127*0Sstevel@tonic-gate #define	PRIi32			"i"
128*0Sstevel@tonic-gate #define	PRIiFAST16		PRIi32
129*0Sstevel@tonic-gate #define	PRIiLEAST32		PRIi32
130*0Sstevel@tonic-gate #define	PRIiFAST32		PRIi32
131*0Sstevel@tonic-gate #ifdef  _LP64
132*0Sstevel@tonic-gate #define	PRIi64			"li"
133*0Sstevel@tonic-gate #else   /* _ILP32 */
134*0Sstevel@tonic-gate #if defined(_LONGLONG_TYPE)
135*0Sstevel@tonic-gate #define	PRIi64			"lli"
136*0Sstevel@tonic-gate #endif
137*0Sstevel@tonic-gate #endif
138*0Sstevel@tonic-gate #ifdef PRIi64
139*0Sstevel@tonic-gate #define	PRIiLEAST64		PRIi64
140*0Sstevel@tonic-gate #define	PRIiFAST64		PRIi64
141*0Sstevel@tonic-gate #endif
142*0Sstevel@tonic-gate 
143*0Sstevel@tonic-gate /*
144*0Sstevel@tonic-gate  * fprintf macros for unsigned integers
145*0Sstevel@tonic-gate  */
146*0Sstevel@tonic-gate 
147*0Sstevel@tonic-gate #define	PRIo8			_MODF8 _PRIo
148*0Sstevel@tonic-gate #define	PRIoLEAST8		PRIo8
149*0Sstevel@tonic-gate #define	PRIoFAST8		PRIo8
150*0Sstevel@tonic-gate #define	PRIo16			_MODF16 _PRIo
151*0Sstevel@tonic-gate #define	PRIoLEAST16		PRIo16
152*0Sstevel@tonic-gate #define	PRIo32			"o"
153*0Sstevel@tonic-gate #define	PRIoFAST16		PRIo32
154*0Sstevel@tonic-gate #define	PRIoLEAST32		PRIo32
155*0Sstevel@tonic-gate #define	PRIoFAST32		PRIo32
156*0Sstevel@tonic-gate #ifdef  _LP64
157*0Sstevel@tonic-gate #define	PRIo64			"lo"
158*0Sstevel@tonic-gate #else	/* _ILP32 */
159*0Sstevel@tonic-gate #if defined(_LONGLONG_TYPE)
160*0Sstevel@tonic-gate #define	PRIo64			"llo"
161*0Sstevel@tonic-gate #endif
162*0Sstevel@tonic-gate #endif
163*0Sstevel@tonic-gate #ifdef PRIo64
164*0Sstevel@tonic-gate #define	PRIoLEAST64		PRIo64
165*0Sstevel@tonic-gate #define	PRIoFAST64		PRIo64
166*0Sstevel@tonic-gate #endif
167*0Sstevel@tonic-gate 
168*0Sstevel@tonic-gate #define	PRIu8			_MODF8 _PRIu
169*0Sstevel@tonic-gate #define	PRIuLEAST8		PRIu8
170*0Sstevel@tonic-gate #define	PRIuFAST8		PRIu8
171*0Sstevel@tonic-gate #define	PRIu16			_MODF16 _PRIu
172*0Sstevel@tonic-gate #define	PRIuLEAST16		PRIu16
173*0Sstevel@tonic-gate #define	PRIu32			"u"
174*0Sstevel@tonic-gate #define	PRIuFAST16		PRIu32
175*0Sstevel@tonic-gate #define	PRIuLEAST32		PRIu32
176*0Sstevel@tonic-gate #define	PRIuFAST32		PRIu32
177*0Sstevel@tonic-gate #ifdef  _LP64
178*0Sstevel@tonic-gate #define	PRIu64			"lu"
179*0Sstevel@tonic-gate #else   /* _ILP32 */
180*0Sstevel@tonic-gate #if defined(_LONGLONG_TYPE)
181*0Sstevel@tonic-gate #define	PRIu64			"llu"
182*0Sstevel@tonic-gate #endif
183*0Sstevel@tonic-gate #endif
184*0Sstevel@tonic-gate #ifdef PRIu64
185*0Sstevel@tonic-gate #define	PRIuLEAST64		PRIu64
186*0Sstevel@tonic-gate #define	PRIuFAST64		PRIu64
187*0Sstevel@tonic-gate #endif
188*0Sstevel@tonic-gate 
189*0Sstevel@tonic-gate #define	PRIx8			_MODF8 _PRIx
190*0Sstevel@tonic-gate #define	PRIxLEAST8		PRIx8
191*0Sstevel@tonic-gate #define	PRIxFAST8		PRIx8
192*0Sstevel@tonic-gate #define	PRIx16			_MODF16 _PRIx
193*0Sstevel@tonic-gate #define	PRIxLEAST16		PRIx16
194*0Sstevel@tonic-gate #define	PRIx32			"x"
195*0Sstevel@tonic-gate #define	PRIxFAST16		PRIx32
196*0Sstevel@tonic-gate #define	PRIxLEAST32		PRIx32
197*0Sstevel@tonic-gate #define	PRIxFAST32		PRIx32
198*0Sstevel@tonic-gate #ifdef  _LP64
199*0Sstevel@tonic-gate #define	PRIx64			"lx"
200*0Sstevel@tonic-gate #else   /* _ILP32 */
201*0Sstevel@tonic-gate #if defined(_LONGLONG_TYPE)
202*0Sstevel@tonic-gate #define	PRIx64			"llx"
203*0Sstevel@tonic-gate #endif
204*0Sstevel@tonic-gate #endif
205*0Sstevel@tonic-gate #ifdef PRIx64
206*0Sstevel@tonic-gate #define	PRIxLEAST64		PRIx64
207*0Sstevel@tonic-gate #define	PRIxFAST64		PRIx64
208*0Sstevel@tonic-gate #endif
209*0Sstevel@tonic-gate 
210*0Sstevel@tonic-gate #define	PRIX8			_MODF8 _PRIX
211*0Sstevel@tonic-gate #define	PRIXLEAST8		PRIX8
212*0Sstevel@tonic-gate #define	PRIXFAST8		PRIX8
213*0Sstevel@tonic-gate #define	PRIX16			_MODF16 _PRIX
214*0Sstevel@tonic-gate #define	PRIXLEAST16		PRIX16
215*0Sstevel@tonic-gate #define	PRIX32			"X"
216*0Sstevel@tonic-gate #define	PRIXFAST16		PRIX32
217*0Sstevel@tonic-gate #define	PRIXLEAST32		PRIX32
218*0Sstevel@tonic-gate #define	PRIXFAST32		PRIX32
219*0Sstevel@tonic-gate #ifdef  _LP64
220*0Sstevel@tonic-gate #define	PRIX64			"lX"
221*0Sstevel@tonic-gate #else   /* _ILP32 */
222*0Sstevel@tonic-gate #if defined(_LONGLONG_TYPE)
223*0Sstevel@tonic-gate #define	PRIX64			"llX"
224*0Sstevel@tonic-gate #endif
225*0Sstevel@tonic-gate #endif
226*0Sstevel@tonic-gate #ifdef PRIX64
227*0Sstevel@tonic-gate #define	PRIXLEAST64		PRIX64
228*0Sstevel@tonic-gate #define	PRIXFAST64		PRIX64
229*0Sstevel@tonic-gate #endif
230*0Sstevel@tonic-gate 
231*0Sstevel@tonic-gate /*
232*0Sstevel@tonic-gate  * fprintf macros for pointers
233*0Sstevel@tonic-gate  */
234*0Sstevel@tonic-gate 
235*0Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
236*0Sstevel@tonic-gate #define	PRIdPTR			"ld"
237*0Sstevel@tonic-gate #define	PRIiPTR			"li"
238*0Sstevel@tonic-gate #define	PRIoPTR			"lo"
239*0Sstevel@tonic-gate #define	PRIuPTR			"lu"
240*0Sstevel@tonic-gate #define	PRIxPTR			"lx"
241*0Sstevel@tonic-gate #define	PRIXPTR			"lX"
242*0Sstevel@tonic-gate #else
243*0Sstevel@tonic-gate #define	PRIdPTR			"d"
244*0Sstevel@tonic-gate #define	PRIiPTR			"i"
245*0Sstevel@tonic-gate #define	PRIoPTR			"o"
246*0Sstevel@tonic-gate #define	PRIuPTR			"u"
247*0Sstevel@tonic-gate #define	PRIxPTR			"x"
248*0Sstevel@tonic-gate #define	PRIXPTR			"X"
249*0Sstevel@tonic-gate #endif /* defined(_LP64) || defined(_I32LPx) */
250*0Sstevel@tonic-gate 
251*0Sstevel@tonic-gate /*
252*0Sstevel@tonic-gate  * fscanf macros for signed integers
253*0Sstevel@tonic-gate  */
254*0Sstevel@tonic-gate #if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
255*0Sstevel@tonic-gate #define	SCNd8			"hhd"
256*0Sstevel@tonic-gate #define	SCNdLEAST8		SCNd8
257*0Sstevel@tonic-gate #define	SCNdFAST8		SCNd8
258*0Sstevel@tonic-gate #endif
259*0Sstevel@tonic-gate #define	SCNd16			"hd"
260*0Sstevel@tonic-gate #define	SCNdLEAST16		SCNd16
261*0Sstevel@tonic-gate #define	SCNd32			"d"
262*0Sstevel@tonic-gate #define	SCNdFAST16		SCNd32
263*0Sstevel@tonic-gate #define	SCNdLEAST32		SCNd32
264*0Sstevel@tonic-gate #define	SCNdFAST32		SCNd32
265*0Sstevel@tonic-gate #ifdef PRId64
266*0Sstevel@tonic-gate #define	SCNd64			PRId64
267*0Sstevel@tonic-gate #define	SCNdLEAST64		PRId64
268*0Sstevel@tonic-gate #define	SCNdFAST64		PRId64
269*0Sstevel@tonic-gate #endif
270*0Sstevel@tonic-gate #define	SCNdPTR			PRIdPTR
271*0Sstevel@tonic-gate 
272*0Sstevel@tonic-gate #if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
273*0Sstevel@tonic-gate #define	SCNi8			"hhi"
274*0Sstevel@tonic-gate #define	SCNiLEAST8		SCNi8
275*0Sstevel@tonic-gate #define	SCNiFAST8		SCNi8
276*0Sstevel@tonic-gate #endif
277*0Sstevel@tonic-gate #define	SCNi16			"hi"
278*0Sstevel@tonic-gate #define	SCNiLEAST16		SCNi16
279*0Sstevel@tonic-gate #define	SCNi32			"i"
280*0Sstevel@tonic-gate #define	SCNiFAST16		SCNi32
281*0Sstevel@tonic-gate #define	SCNiLEAST32		SCNi32
282*0Sstevel@tonic-gate #define	SCNiFAST32		SCNi32
283*0Sstevel@tonic-gate #ifdef PRIi64
284*0Sstevel@tonic-gate #define	SCNi64			PRIi64
285*0Sstevel@tonic-gate #define	SCNiLEAST64		PRIi64
286*0Sstevel@tonic-gate #define	SCNiFAST64		PRIi64
287*0Sstevel@tonic-gate #endif
288*0Sstevel@tonic-gate #define	SCNiPTR			PRIiPTR
289*0Sstevel@tonic-gate 
290*0Sstevel@tonic-gate /*
291*0Sstevel@tonic-gate  * fscanf macros for unsigned integers
292*0Sstevel@tonic-gate  */
293*0Sstevel@tonic-gate #define	SCNo8			"hho"
294*0Sstevel@tonic-gate #define	SCNoLEAST8		SCNo8
295*0Sstevel@tonic-gate #define	SCNoFAST8		SCNo8
296*0Sstevel@tonic-gate #define	SCNo16			"ho"
297*0Sstevel@tonic-gate #define	SCNoLEAST16		SCNo16
298*0Sstevel@tonic-gate #define	SCNo32			"o"
299*0Sstevel@tonic-gate #define	SCNoFAST16		SCNo32
300*0Sstevel@tonic-gate #define	SCNoLEAST32		SCNo32
301*0Sstevel@tonic-gate #define	SCNoFAST32		SCNo32
302*0Sstevel@tonic-gate #ifdef PRIo64
303*0Sstevel@tonic-gate #define	SCNo64			PRIo64
304*0Sstevel@tonic-gate #define	SCNoLEAST64		PRIo64
305*0Sstevel@tonic-gate #define	SCNoFAST64		PRIo64
306*0Sstevel@tonic-gate #endif
307*0Sstevel@tonic-gate #define	SCNoPTR			PRIoPTR
308*0Sstevel@tonic-gate 
309*0Sstevel@tonic-gate #define	SCNu8			"hhu"
310*0Sstevel@tonic-gate #define	SCNuLEAST8		SCNu8
311*0Sstevel@tonic-gate #define	SCNuFAST8		SCNu8
312*0Sstevel@tonic-gate #define	SCNu16			"hu"
313*0Sstevel@tonic-gate #define	SCNuLEAST16		SCNu16
314*0Sstevel@tonic-gate #define	SCNu32			"u"
315*0Sstevel@tonic-gate #define	SCNuFAST16		SCNu32
316*0Sstevel@tonic-gate #define	SCNuLEAST32		SCNu32
317*0Sstevel@tonic-gate #define	SCNuFAST32		SCNu32
318*0Sstevel@tonic-gate #ifdef PRIu64
319*0Sstevel@tonic-gate #define	SCNu64			PRIu64
320*0Sstevel@tonic-gate #define	SCNuLEAST64		PRIu64
321*0Sstevel@tonic-gate #define	SCNuFAST64		PRIu64
322*0Sstevel@tonic-gate #endif
323*0Sstevel@tonic-gate #define	SCNuPTR			PRIuPTR
324*0Sstevel@tonic-gate 
325*0Sstevel@tonic-gate #define	SCNx8			"hhx"
326*0Sstevel@tonic-gate #define	SCNxLEAST8		SCNx8
327*0Sstevel@tonic-gate #define	SCNxFAST8		SCNx8
328*0Sstevel@tonic-gate #define	SCNx16			"hx"
329*0Sstevel@tonic-gate #define	SCNxLEAST16		SCNx16
330*0Sstevel@tonic-gate #define	SCNx32			"x"
331*0Sstevel@tonic-gate #define	SCNxFAST16		SCNx32
332*0Sstevel@tonic-gate #define	SCNxLEAST32		SCNx32
333*0Sstevel@tonic-gate #define	SCNxFAST32		SCNx32
334*0Sstevel@tonic-gate #ifdef PRIx64
335*0Sstevel@tonic-gate #define	SCNx64			PRIx64
336*0Sstevel@tonic-gate #define	SCNxLEAST64		PRIx64
337*0Sstevel@tonic-gate #define	SCNxFAST64		PRIx64
338*0Sstevel@tonic-gate #endif
339*0Sstevel@tonic-gate #define	SCNxPTR			PRIxPTR
340*0Sstevel@tonic-gate 
341*0Sstevel@tonic-gate #define	SCNX8			"hhX"
342*0Sstevel@tonic-gate #define	SCNXLEAST8		SCNX8
343*0Sstevel@tonic-gate #define	SCNXFAST8		SCNX8
344*0Sstevel@tonic-gate #define	SCNX16			"hX"
345*0Sstevel@tonic-gate #define	SCNXLEAST16		SCNX16
346*0Sstevel@tonic-gate #define	SCNX32			"X"
347*0Sstevel@tonic-gate #define	SCNXFAST16		SCNX32
348*0Sstevel@tonic-gate #define	SCNXLEAST32		SCNX32
349*0Sstevel@tonic-gate #define	SCNXFAST32		SCNX32
350*0Sstevel@tonic-gate #ifdef PRIX64
351*0Sstevel@tonic-gate #define	SCNX64			PRIX64
352*0Sstevel@tonic-gate #define	SCNXLEAST64		PRIX64
353*0Sstevel@tonic-gate #define	SCNXFAST64		PRIX64
354*0Sstevel@tonic-gate #endif
355*0Sstevel@tonic-gate #define	SCNXPTR			PRIXPTR
356*0Sstevel@tonic-gate 
357*0Sstevel@tonic-gate /*
358*0Sstevel@tonic-gate  * The following macros define I/O formats for intmax_t and uintmax_t.
359*0Sstevel@tonic-gate  */
360*0Sstevel@tonic-gate #if !defined(_LP64) && defined(_LONGLONG_TYPE)
361*0Sstevel@tonic-gate #define	PRIdMAX			"lld"
362*0Sstevel@tonic-gate #define	PRIiMAX			"lli"
363*0Sstevel@tonic-gate #define	PRIoMAX			"llo"
364*0Sstevel@tonic-gate #define	PRIxMAX			"llx"
365*0Sstevel@tonic-gate #define	PRIuMAX			"llu"
366*0Sstevel@tonic-gate #define	PRIXMAX			"llX"
367*0Sstevel@tonic-gate #else
368*0Sstevel@tonic-gate #define	PRIdMAX			"ld"
369*0Sstevel@tonic-gate #define	PRIiMAX			"li"
370*0Sstevel@tonic-gate #define	PRIoMAX			"lo"
371*0Sstevel@tonic-gate #define	PRIxMAX			"lx"
372*0Sstevel@tonic-gate #define	PRIuMAX			"lu"
373*0Sstevel@tonic-gate #define	PRIXMAX			"lX"
374*0Sstevel@tonic-gate #endif	/* !defined(_LP64) && defined(_LONGLONG_TYPE) */
375*0Sstevel@tonic-gate 
376*0Sstevel@tonic-gate #define	SCNdMAX			PRIdMAX
377*0Sstevel@tonic-gate #define	SCNiMAX			PRIiMAX
378*0Sstevel@tonic-gate #define	SCNoMAX			PRIoMAX
379*0Sstevel@tonic-gate #define	SCNxMAX			PRIxMAX
380*0Sstevel@tonic-gate #define	SCNuMAX			PRIuMAX
381*0Sstevel@tonic-gate #define	SCNXMAX			PRIXMAX
382*0Sstevel@tonic-gate 
383*0Sstevel@tonic-gate #ifdef __cplusplus
384*0Sstevel@tonic-gate }
385*0Sstevel@tonic-gate #endif
386*0Sstevel@tonic-gate 
387*0Sstevel@tonic-gate #endif /* _SYS_INT_FMTIO_H */
388