xref: /netbsd-src/external/gpl3/gcc.old/dist/libphobos/src/std/stdint.d (revision 627f7eb200a4419d89b531d55fccd2ee3ffdcde0)
1*627f7eb2Smrg // Written in the D programming language.
2*627f7eb2Smrg 
3*627f7eb2Smrg /**
4*627f7eb2Smrg  *
5*627f7eb2Smrg     D constrains integral types to specific sizes. But efficiency
6*627f7eb2Smrg     of different sizes varies from machine to machine,
7*627f7eb2Smrg     pointer sizes vary, and the maximum integer size varies.
8*627f7eb2Smrg     <b>stdint</b> offers a portable way of trading off size
9*627f7eb2Smrg     vs efficiency, in a manner compatible with the <tt>stdint.h</tt>
10*627f7eb2Smrg     definitions in C.
11*627f7eb2Smrg 
12*627f7eb2Smrg     In the table below, the $(B exact alias)es are types of exactly the
13*627f7eb2Smrg     specified number of bits.
14*627f7eb2Smrg     The $(B at least alias)es are at least the specified number of bits
15*627f7eb2Smrg     large, and can be larger.
16*627f7eb2Smrg     The $(B fast alias)es are the fastest integral type supported by the
17*627f7eb2Smrg     processor that is at least as wide as the specified number of bits.
18*627f7eb2Smrg 
19*627f7eb2Smrg     The aliases are:
20*627f7eb2Smrg 
21*627f7eb2Smrg     $(ATABLE $(TR
22*627f7eb2Smrg     $(TH Exact Alias)
23*627f7eb2Smrg     $(TH Description)
24*627f7eb2Smrg     $(TH At Least Alias)
25*627f7eb2Smrg     $(TH Description)
26*627f7eb2Smrg     $(TH Fast Alias)
27*627f7eb2Smrg     $(TH Description)
28*627f7eb2Smrg     )$(TR
29*627f7eb2Smrg     $(TD int8_t)
30*627f7eb2Smrg     $(TD exactly 8 bits signed)
31*627f7eb2Smrg     $(TD int_least8_t)
32*627f7eb2Smrg     $(TD at least 8 bits signed)
33*627f7eb2Smrg     $(TD int_fast8_t)
34*627f7eb2Smrg     $(TD fast 8 bits signed)
35*627f7eb2Smrg     )$(TR
36*627f7eb2Smrg     $(TD uint8_t)
37*627f7eb2Smrg     $(TD exactly 8 bits unsigned)
38*627f7eb2Smrg     $(TD uint_least8_t)
39*627f7eb2Smrg     $(TD at least 8 bits unsigned)
40*627f7eb2Smrg     $(TD uint_fast8_t)
41*627f7eb2Smrg     $(TD fast 8 bits unsigned)
42*627f7eb2Smrg 
43*627f7eb2Smrg     )$(TR
44*627f7eb2Smrg     $(TD int16_t)
45*627f7eb2Smrg     $(TD exactly 16 bits signed)
46*627f7eb2Smrg     $(TD int_least16_t)
47*627f7eb2Smrg     $(TD at least 16 bits signed)
48*627f7eb2Smrg     $(TD int_fast16_t)
49*627f7eb2Smrg     $(TD fast 16 bits signed)
50*627f7eb2Smrg     )$(TR
51*627f7eb2Smrg     $(TD uint16_t)
52*627f7eb2Smrg     $(TD exactly 16 bits unsigned)
53*627f7eb2Smrg     $(TD uint_least16_t)
54*627f7eb2Smrg     $(TD at least 16 bits unsigned)
55*627f7eb2Smrg     $(TD uint_fast16_t)
56*627f7eb2Smrg     $(TD fast 16 bits unsigned)
57*627f7eb2Smrg 
58*627f7eb2Smrg     )$(TR
59*627f7eb2Smrg     $(TD int32_t)
60*627f7eb2Smrg     $(TD exactly 32 bits signed)
61*627f7eb2Smrg     $(TD int_least32_t)
62*627f7eb2Smrg     $(TD at least 32 bits signed)
63*627f7eb2Smrg     $(TD int_fast32_t)
64*627f7eb2Smrg     $(TD fast 32 bits signed)
65*627f7eb2Smrg     )$(TR
66*627f7eb2Smrg     $(TD uint32_t)
67*627f7eb2Smrg     $(TD exactly 32 bits unsigned)
68*627f7eb2Smrg     $(TD uint_least32_t)
69*627f7eb2Smrg     $(TD at least 32 bits unsigned)
70*627f7eb2Smrg     $(TD uint_fast32_t)
71*627f7eb2Smrg     $(TD fast 32 bits unsigned)
72*627f7eb2Smrg 
73*627f7eb2Smrg     )$(TR
74*627f7eb2Smrg     $(TD int64_t)
75*627f7eb2Smrg     $(TD exactly 64 bits signed)
76*627f7eb2Smrg     $(TD int_least64_t)
77*627f7eb2Smrg     $(TD at least 64 bits signed)
78*627f7eb2Smrg     $(TD int_fast64_t)
79*627f7eb2Smrg     $(TD fast 64 bits signed)
80*627f7eb2Smrg     )$(TR
81*627f7eb2Smrg     $(TD uint64_t)
82*627f7eb2Smrg     $(TD exactly 64 bits unsigned)
83*627f7eb2Smrg     $(TD uint_least64_t)
84*627f7eb2Smrg     $(TD at least 64 bits unsigned)
85*627f7eb2Smrg     $(TD uint_fast64_t)
86*627f7eb2Smrg     $(TD fast 64 bits unsigned)
87*627f7eb2Smrg     ))
88*627f7eb2Smrg 
89*627f7eb2Smrg     The ptr aliases are integral types guaranteed to be large enough
90*627f7eb2Smrg     to hold a pointer without losing bits:
91*627f7eb2Smrg 
92*627f7eb2Smrg     $(ATABLE $(TR
93*627f7eb2Smrg     $(TH Alias)
94*627f7eb2Smrg     $(TH Description)
95*627f7eb2Smrg     )$(TR
96*627f7eb2Smrg     $(TD intptr_t)
97*627f7eb2Smrg     $(TD signed integral type large enough to hold a pointer)
98*627f7eb2Smrg     )$(TR
99*627f7eb2Smrg     $(TD uintptr_t)
100*627f7eb2Smrg     $(TD unsigned integral type large enough to hold a pointer)
101*627f7eb2Smrg     ))
102*627f7eb2Smrg 
103*627f7eb2Smrg     The max aliases are the largest integral types:
104*627f7eb2Smrg 
105*627f7eb2Smrg     $(ATABLE $(TR
106*627f7eb2Smrg     $(TH Alias)
107*627f7eb2Smrg     $(TH Description)
108*627f7eb2Smrg     )$(TR
109*627f7eb2Smrg     $(TD intmax_t)
110*627f7eb2Smrg     $(TD the largest signed integral type)
111*627f7eb2Smrg     )$(TR
112*627f7eb2Smrg     $(TD uintmax_t)
113*627f7eb2Smrg     $(TD the largest unsigned integral type)
114*627f7eb2Smrg     ))
115*627f7eb2Smrg 
116*627f7eb2Smrg  * Macros:
117*627f7eb2Smrg  *  ATABLE=<table border="1" cellspacing="0" cellpadding="5">$0</table>
118*627f7eb2Smrg  *
119*627f7eb2Smrg  * Copyright: Copyright Digital Mars 2000 - 2009.
120*627f7eb2Smrg  * License:   $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
121*627f7eb2Smrg  * Authors:   $(HTTP digitalmars.com, Walter Bright)
122*627f7eb2Smrg  * Source:    $(PHOBOSSRC std/_stdint.d)
123*627f7eb2Smrg  */
124*627f7eb2Smrg /*          Copyright Digital Mars 2000 - 2009.
125*627f7eb2Smrg  * Distributed under the Boost Software License, Version 1.0.
126*627f7eb2Smrg  *    (See accompanying file LICENSE_1_0.txt or copy at
127*627f7eb2Smrg  *          http://www.boost.org/LICENSE_1_0.txt)
128*627f7eb2Smrg  */
129*627f7eb2Smrg module std.stdint;
130*627f7eb2Smrg 
131*627f7eb2Smrg public import core.stdc.stdint;
132