Mercurial > ms-int-types
annotate inttypes.h @ 18:eb2525abe43a
Better C99 conformance: macros for format specifiers should only be included in C++ implementations if __STDC_FORMAT_MACROS is defined before <inttypes.h> is included.
author | ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde |
---|---|
date | Tue, 09 Oct 2007 12:54:27 +0000 |
parents | f831bbea3401 |
children | fce0b7d5cef7 |
rev | line source |
---|---|
15
f831bbea3401
Fix typo: Miscrosoft -> Microsoft.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
11
diff
changeset
|
1 // ISO C9x compliant inttypes.h for Microsoft Visual Studio |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
2 // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 |
5
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
3 // |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
4 // Copyright (c) 2006 Alexander Chemeris |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
5 // |
5
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
6 // Redistribution and use in source and binary forms, with or without |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
7 // modification, are permitted provided that the following conditions are met: |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
8 // |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
9 // 1. Redistributions of source code must retain the above copyright notice, |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
10 // this list of conditions and the following disclaimer. |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
11 // |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
12 // 2. Redistributions in binary form must reproduce the above copyright |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
13 // notice, this list of conditions and the following disclaimer in the |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
14 // documentation and/or other materials provided with the distribution. |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
15 // |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
16 // 3. The name of the author may be used to endorse or promote products |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
17 // derived from this software without specific prior written permission. |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
18 // |
5
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
19 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
20 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
22 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
29 // |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
30 /////////////////////////////////////////////////////////////////////////////// |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
31 |
2
0cf270b831ef
Rise #error if _MSC_VER is not defined. I.e. compiler other then Microsoft Visual C++ is used.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
0
diff
changeset
|
32 #ifndef _MSC_VER // [ |
10
fed29a68d73f
Error message changed: VC6 supported from now.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
8
diff
changeset
|
33 #error "Use this header only with Microsoft Visual C++ compilers!" |
2
0cf270b831ef
Rise #error if _MSC_VER is not defined. I.e. compiler other then Microsoft Visual C++ is used.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
0
diff
changeset
|
34 #endif // _MSC_VER ] |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
35 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
36 #ifndef _MSC_INTTYPES_H_ // [ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
37 #define _MSC_INTTYPES_H_ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
38 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
39 #if _MSC_VER > 1000 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
40 #pragma once |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
41 #endif |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
42 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
43 #include <stdint.h> |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
44 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
45 // 7.8 Format conversion of integer types |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
46 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
47 typedef struct { |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
48 intmax_t quot; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
49 intmax_t rem; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
50 } imaxdiv_t; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
51 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
52 // 7.8.1 Macros for format specifiers |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
53 |
18
eb2525abe43a
Better C99 conformance: macros for format specifiers should only be included in C++ implementations if __STDC_FORMAT_MACROS is defined before <inttypes.h> is included.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
15
diff
changeset
|
54 #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 |
eb2525abe43a
Better C99 conformance: macros for format specifiers should only be included in C++ implementations if __STDC_FORMAT_MACROS is defined before <inttypes.h> is included.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
15
diff
changeset
|
55 |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
56 // The fprintf macros for signed integers are: |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
57 #define PRId8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
58 #define PRIi8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
59 #define PRIdLEAST8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
60 #define PRIiLEAST8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
61 #define PRIdFAST8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
62 #define PRIiFAST8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
63 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
64 #define PRId16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
65 #define PRIi16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
66 #define PRIdLEAST16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
67 #define PRIiLEAST16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
68 #define PRIdFAST16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
69 #define PRIiFAST16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
70 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
71 #define PRId32 "I32d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
72 #define PRIi32 "I32i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
73 #define PRIdLEAST32 "I32d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
74 #define PRIiLEAST32 "I32i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
75 #define PRIdFAST32 "I32d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
76 #define PRIiFAST32 "I32i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
77 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
78 #define PRId64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
79 #define PRIi64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
80 #define PRIdLEAST64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
81 #define PRIiLEAST64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
82 #define PRIdFAST64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
83 #define PRIiFAST64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
84 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
85 #define PRIdMAX "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
86 #define PRIiMAX "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
87 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
88 #define PRIdPTR "Id" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
89 #define PRIiPTR "Ii" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
90 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
91 // The fprintf macros for unsigned integers are: |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
92 #define PRIo8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
93 #define PRIu8 "u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
94 #define PRIx8 "x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
95 #define PRIX8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
96 #define PRIoLEAST8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
97 #define PRIuLEAST8 "u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
98 #define PRIxLEAST8 "x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
99 #define PRIXLEAST8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
100 #define PRIoFAST8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
101 #define PRIuFAST8 "u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
102 #define PRIxFAST8 "x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
103 #define PRIXFAST8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
104 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
105 #define PRIo16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
106 #define PRIu16 "hu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
107 #define PRIx16 "hx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
108 #define PRIX16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
109 #define PRIoLEAST16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
110 #define PRIuLEAST16 "hu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
111 #define PRIxLEAST16 "hx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
112 #define PRIXLEAST16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
113 #define PRIoFAST16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
114 #define PRIuFAST16 "hu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
115 #define PRIxFAST16 "hx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
116 #define PRIXFAST16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
117 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
118 #define PRIo32 "I32o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
119 #define PRIu32 "I32u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
120 #define PRIx32 "I32x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
121 #define PRIX32 "I32X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
122 #define PRIoLEAST32 "I32o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
123 #define PRIuLEAST32 "I32u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
124 #define PRIxLEAST32 "I32x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
125 #define PRIXLEAST32 "I32X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
126 #define PRIoFAST32 "I32o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
127 #define PRIuFAST32 "I32u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
128 #define PRIxFAST32 "I32x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
129 #define PRIXFAST32 "I32X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
130 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
131 #define PRIo64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
132 #define PRIu64 "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
133 #define PRIx64 "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
134 #define PRIX64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
135 #define PRIoLEAST64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
136 #define PRIuLEAST64 "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
137 #define PRIxLEAST64 "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
138 #define PRIXLEAST64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
139 #define PRIoFAST64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
140 #define PRIuFAST64 "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
141 #define PRIxFAST64 "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
142 #define PRIXFAST64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
143 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
144 #define PRIoMAX "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
145 #define PRIuMAX "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
146 #define PRIxMAX "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
147 #define PRIXMAX "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
148 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
149 #define PRIoPTR "Io" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
150 #define PRIuPTR "Iu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
151 #define PRIxPTR "Ix" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
152 #define PRIXPTR "IX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
153 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
154 // The fscanf macros for signed integers are: |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
155 #define SCNd8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
156 #define SCNi8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
157 #define SCNdLEAST8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
158 #define SCNiLEAST8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
159 #define SCNdFAST8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
160 #define SCNiFAST8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
161 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
162 #define SCNd16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
163 #define SCNi16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
164 #define SCNdLEAST16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
165 #define SCNiLEAST16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
166 #define SCNdFAST16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
167 #define SCNiFAST16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
168 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
169 #define SCNd32 "ld" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
170 #define SCNi32 "li" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
171 #define SCNdLEAST32 "ld" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
172 #define SCNiLEAST32 "li" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
173 #define SCNdFAST32 "ld" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
174 #define SCNiFAST32 "li" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
175 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
176 #define SCNd64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
177 #define SCNi64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
178 #define SCNdLEAST64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
179 #define SCNiLEAST64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
180 #define SCNdFAST64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
181 #define SCNiFAST64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
182 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
183 #define SCNdMAX "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
184 #define SCNiMAX "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
185 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
186 #ifdef _WIN64 // [ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
187 # define SCNdPTR "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
188 # define SCNiPTR "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
189 #else // _WIN64 ][ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
190 # define SCNdPTR "ld" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
191 # define SCNiPTR "li" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
192 #endif // _WIN64 ] |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
193 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
194 // The fscanf macros for unsigned integers are: |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
195 #define SCNo8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
196 #define SCNu8 "u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
197 #define SCNx8 "x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
198 #define SCNX8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
199 #define SCNoLEAST8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
200 #define SCNuLEAST8 "u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
201 #define SCNxLEAST8 "x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
202 #define SCNXLEAST8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
203 #define SCNoFAST8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
204 #define SCNuFAST8 "u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
205 #define SCNxFAST8 "x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
206 #define SCNXFAST8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
207 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
208 #define SCNo16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
209 #define SCNu16 "hu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
210 #define SCNx16 "hx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
211 #define SCNX16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
212 #define SCNoLEAST16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
213 #define SCNuLEAST16 "hu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
214 #define SCNxLEAST16 "hx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
215 #define SCNXLEAST16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
216 #define SCNoFAST16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
217 #define SCNuFAST16 "hu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
218 #define SCNxFAST16 "hx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
219 #define SCNXFAST16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
220 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
221 #define SCNo32 "lo" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
222 #define SCNu32 "lu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
223 #define SCNx32 "lx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
224 #define SCNX32 "lX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
225 #define SCNoLEAST32 "lo" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
226 #define SCNuLEAST32 "lu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
227 #define SCNxLEAST32 "lx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
228 #define SCNXLEAST32 "lX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
229 #define SCNoFAST32 "lo" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
230 #define SCNuFAST32 "lu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
231 #define SCNxFAST32 "lx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
232 #define SCNXFAST32 "lX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
233 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
234 #define SCNo64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
235 #define SCNu64 "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
236 #define SCNx64 "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
237 #define SCNX64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
238 #define SCNoLEAST64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
239 #define SCNuLEAST64 "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
240 #define SCNxLEAST64 "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
241 #define SCNXLEAST64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
242 #define SCNoFAST64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
243 #define SCNuFAST64 "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
244 #define SCNxFAST64 "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
245 #define SCNXFAST64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
246 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
247 #define SCNoMAX "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
248 #define SCNuMAX "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
249 #define SCNxMAX "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
250 #define SCNXMAX "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
251 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
252 #ifdef _WIN64 // [ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
253 # define SCNoPTR "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
254 # define SCNuPTR "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
255 # define SCNxPTR "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
256 # define SCNXPTR "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
257 #else // _WIN64 ][ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
258 # define SCNoPTR "lo" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
259 # define SCNuPTR "lu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
260 # define SCNxPTR "lx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
261 # define SCNXPTR "lX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
262 #endif // _WIN64 ] |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
263 |
18
eb2525abe43a
Better C99 conformance: macros for format specifiers should only be included in C++ implementations if __STDC_FORMAT_MACROS is defined before <inttypes.h> is included.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
15
diff
changeset
|
264 #endif // __STDC_FORMAT_MACROS ] |
eb2525abe43a
Better C99 conformance: macros for format specifiers should only be included in C++ implementations if __STDC_FORMAT_MACROS is defined before <inttypes.h> is included.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
15
diff
changeset
|
265 |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
266 // 7.8.2 Functions for greatest-width integer types |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
267 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
268 // 7.8.2.1 The imaxabs function |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
269 #define imaxabs _abs64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
270 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
271 // 7.8.2.2 The imaxdiv function |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
272 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
273 // This is modified version of div() function from Microsoft's div.c found |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
274 // in %MSVC.NET%\crt\src\div.c |
11
bfc13f31112f
Make _inline modifier for imaxdiv default option. Use STATIC_IMAXDIV to make it static.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
10
diff
changeset
|
275 #ifdef STATIC_IMAXDIV // [ |
8
8528f97c3731
Added INLINE_IMAXDIV define switch.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
7
diff
changeset
|
276 static |
11
bfc13f31112f
Make _inline modifier for imaxdiv default option. Use STATIC_IMAXDIV to make it static.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
10
diff
changeset
|
277 #else // STATIC_IMAXDIV ][ |
bfc13f31112f
Make _inline modifier for imaxdiv default option. Use STATIC_IMAXDIV to make it static.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
10
diff
changeset
|
278 _inline |
bfc13f31112f
Make _inline modifier for imaxdiv default option. Use STATIC_IMAXDIV to make it static.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
10
diff
changeset
|
279 #endif // STATIC_IMAXDIV ] |
8
8528f97c3731
Added INLINE_IMAXDIV define switch.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
7
diff
changeset
|
280 imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
281 { |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
282 imaxdiv_t result; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
283 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
284 result.quot = numer / denom; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
285 result.rem = numer % denom; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
286 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
287 if (numer < 0 && result.rem > 0) { |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
288 // did division wrong; must fix up |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
289 ++result.quot; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
290 result.rem -= denom; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
291 } |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
292 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
293 return result; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
294 } |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
295 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
296 // 7.8.2.3 The strtoimax and strtoumax functions |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
297 #define strtoimax _strtoi64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
298 #define strtoumax _strtoui64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
299 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
300 // 7.8.2.4 The wcstoimax and wcstoumax functions |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
301 #define wcstoimax _wcstoi64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
302 #define wcstoumax _wcstoui64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
303 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
304 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
305 #endif // _MSC_INTTYPES_H_ ] |