Mercurial > ms-int-types
annotate inttypes.h @ 27:536eb2988c28
Fix Issue 9: Surround (U)INTMAX_C with #ifndef's to prevent compiler warnings.
author | alexander.chemeris@gmail.com@d525d15b-5824-0410-80a3-6185d19c2cde |
---|---|
date | Fri, 24 May 2013 22:36:43 +0000 |
parents | a5b39e660e83 |
children |
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 // |
25
a5b39e660e83
Fix license bug - the name of the product and the names of contributors must not be used for promotion.
alexander.chemeris@gmail.com@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
24
diff
changeset
|
4 // Copyright (c) 2006-2013 Alexander Chemeris |
0
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 // |
25
a5b39e660e83
Fix license bug - the name of the product and the names of contributors must not be used for promotion.
alexander.chemeris@gmail.com@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
24
diff
changeset
|
16 // 3. Neither the name of the product nor the names of its contributors may |
a5b39e660e83
Fix license bug - the name of the product and the names of contributors must not be used for promotion.
alexander.chemeris@gmail.com@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
24
diff
changeset
|
17 // be used to endorse or promote products derived from this software |
a5b39e660e83
Fix license bug - the name of the product and the names of contributors must not be used for promotion.
alexander.chemeris@gmail.com@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
24
diff
changeset
|
18 // without specific prior written permission. |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
19 // |
5
72746e08c7ec
License chaged to BSD-derivative.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
2
diff
changeset
|
20 // 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
|
21 // 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
|
22 // 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
|
23 // 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
|
24 // 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
|
25 // 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
|
26 // 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
|
27 // 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
|
28 // 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
|
29 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
0
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 /////////////////////////////////////////////////////////////////////////////// |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
32 |
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
|
33 #ifndef _MSC_VER // [ |
10
fed29a68d73f
Error message changed: VC6 supported from now.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
8
diff
changeset
|
34 #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
|
35 #endif // _MSC_VER ] |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
36 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
37 #ifndef _MSC_INTTYPES_H_ // [ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
38 #define _MSC_INTTYPES_H_ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
39 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
40 #if _MSC_VER > 1000 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
41 #pragma once |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
42 #endif |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
43 |
24
fce0b7d5cef7
[Issue 5] Change <stdint.h> to "stdint.h" to let compiler search for it in local directory.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
18
diff
changeset
|
44 #include "stdint.h" |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
45 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
46 // 7.8 Format conversion of integer types |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
47 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
48 typedef struct { |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
49 intmax_t quot; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
50 intmax_t rem; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
51 } imaxdiv_t; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
52 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
53 // 7.8.1 Macros for format specifiers |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
54 |
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
|
55 #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
|
56 |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
57 // The fprintf macros for signed integers are: |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
58 #define PRId8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
59 #define PRIi8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
60 #define PRIdLEAST8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
61 #define PRIiLEAST8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
62 #define PRIdFAST8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
63 #define PRIiFAST8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
65 #define PRId16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
66 #define PRIi16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
67 #define PRIdLEAST16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
68 #define PRIiLEAST16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
69 #define PRIdFAST16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
70 #define PRIiFAST16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
71 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
72 #define PRId32 "I32d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
73 #define PRIi32 "I32i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
74 #define PRIdLEAST32 "I32d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
75 #define PRIiLEAST32 "I32i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
76 #define PRIdFAST32 "I32d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
77 #define PRIiFAST32 "I32i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
78 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
79 #define PRId64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
80 #define PRIi64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
81 #define PRIdLEAST64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
82 #define PRIiLEAST64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
83 #define PRIdFAST64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
84 #define PRIiFAST64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
85 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
86 #define PRIdMAX "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
87 #define PRIiMAX "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
88 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
89 #define PRIdPTR "Id" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
90 #define PRIiPTR "Ii" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
91 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
92 // The fprintf macros for unsigned integers are: |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
93 #define PRIo8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
94 #define PRIu8 "u" |
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 PRIX8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
97 #define PRIoLEAST8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
98 #define PRIuLEAST8 "u" |
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 PRIXLEAST8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
101 #define PRIoFAST8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
102 #define PRIuFAST8 "u" |
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 #define PRIXFAST8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
105 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
106 #define PRIo16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
107 #define PRIu16 "hu" |
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 PRIX16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
110 #define PRIoLEAST16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
111 #define PRIuLEAST16 "hu" |
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 PRIXLEAST16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
114 #define PRIoFAST16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
115 #define PRIuFAST16 "hu" |
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 #define PRIXFAST16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
118 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
119 #define PRIo32 "I32o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
120 #define PRIu32 "I32u" |
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 PRIX32 "I32X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
123 #define PRIoLEAST32 "I32o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
124 #define PRIuLEAST32 "I32u" |
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 PRIXLEAST32 "I32X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
127 #define PRIoFAST32 "I32o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
128 #define PRIuFAST32 "I32u" |
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 #define PRIXFAST32 "I32X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
131 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
132 #define PRIo64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
133 #define PRIu64 "I64u" |
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 PRIX64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
136 #define PRIoLEAST64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
137 #define PRIuLEAST64 "I64u" |
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 PRIXLEAST64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
140 #define PRIoFAST64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
141 #define PRIuFAST64 "I64u" |
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 #define PRIXFAST64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
144 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
145 #define PRIoMAX "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
146 #define PRIuMAX "I64u" |
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 #define PRIXMAX "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
149 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
150 #define PRIoPTR "Io" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
151 #define PRIuPTR "Iu" |
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 #define PRIXPTR "IX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
154 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
155 // The fscanf macros for signed integers are: |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
156 #define SCNd8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
157 #define SCNi8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
158 #define SCNdLEAST8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
159 #define SCNiLEAST8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
160 #define SCNdFAST8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
161 #define SCNiFAST8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
162 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
163 #define SCNd16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
164 #define SCNi16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
165 #define SCNdLEAST16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
166 #define SCNiLEAST16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
167 #define SCNdFAST16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
168 #define SCNiFAST16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
169 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
170 #define SCNd32 "ld" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
171 #define SCNi32 "li" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
172 #define SCNdLEAST32 "ld" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
173 #define SCNiLEAST32 "li" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
174 #define SCNdFAST32 "ld" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
175 #define SCNiFAST32 "li" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
176 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
177 #define SCNd64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
178 #define SCNi64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
179 #define SCNdLEAST64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
180 #define SCNiLEAST64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
181 #define SCNdFAST64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
182 #define SCNiFAST64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
183 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
184 #define SCNdMAX "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
185 #define SCNiMAX "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
186 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
187 #ifdef _WIN64 // [ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
188 # define SCNdPTR "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
189 # define SCNiPTR "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
190 #else // _WIN64 ][ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
191 # define SCNdPTR "ld" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
192 # define SCNiPTR "li" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
193 #endif // _WIN64 ] |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
194 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
195 // The fscanf macros for unsigned integers are: |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
196 #define SCNo8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
197 #define SCNu8 "u" |
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 SCNX8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
200 #define SCNoLEAST8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
201 #define SCNuLEAST8 "u" |
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 SCNXLEAST8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
204 #define SCNoFAST8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
205 #define SCNuFAST8 "u" |
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 #define SCNXFAST8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
208 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
209 #define SCNo16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
210 #define SCNu16 "hu" |
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 SCNX16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
213 #define SCNoLEAST16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
214 #define SCNuLEAST16 "hu" |
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 SCNXLEAST16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
217 #define SCNoFAST16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
218 #define SCNuFAST16 "hu" |
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 #define SCNXFAST16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
221 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
222 #define SCNo32 "lo" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
223 #define SCNu32 "lu" |
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 SCNX32 "lX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
226 #define SCNoLEAST32 "lo" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
227 #define SCNuLEAST32 "lu" |
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 SCNXLEAST32 "lX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
230 #define SCNoFAST32 "lo" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
231 #define SCNuFAST32 "lu" |
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 #define SCNXFAST32 "lX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
234 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
235 #define SCNo64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
236 #define SCNu64 "I64u" |
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 SCNX64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
239 #define SCNoLEAST64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
240 #define SCNuLEAST64 "I64u" |
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 SCNXLEAST64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
243 #define SCNoFAST64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
244 #define SCNuFAST64 "I64u" |
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 #define SCNXFAST64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
247 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
248 #define SCNoMAX "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
249 #define SCNuMAX "I64u" |
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 #define SCNXMAX "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
252 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
253 #ifdef _WIN64 // [ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
254 # define SCNoPTR "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
255 # define SCNuPTR "I64u" |
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 # define SCNXPTR "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
258 #else // _WIN64 ][ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
259 # define SCNoPTR "lo" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
260 # define SCNuPTR "lu" |
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 # define SCNXPTR "lX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
263 #endif // _WIN64 ] |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
264 |
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
|
265 #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
|
266 |
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
267 // 7.8.2 Functions for greatest-width integer types |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
268 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
269 // 7.8.2.1 The imaxabs function |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
270 #define imaxabs _abs64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
271 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
272 // 7.8.2.2 The imaxdiv function |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
273 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
274 // 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
|
275 // 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
|
276 #ifdef STATIC_IMAXDIV // [ |
8
8528f97c3731
Added INLINE_IMAXDIV define switch.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
7
diff
changeset
|
277 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
|
278 #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
|
279 _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
|
280 #endif // STATIC_IMAXDIV ] |
8
8528f97c3731
Added INLINE_IMAXDIV define switch.
ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
7
diff
changeset
|
281 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
|
282 { |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
283 imaxdiv_t result; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
284 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
285 result.quot = numer / denom; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
286 result.rem = numer % denom; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
287 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
288 if (numer < 0 && result.rem > 0) { |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
289 // did division wrong; must fix up |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
290 ++result.quot; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
291 result.rem -= denom; |
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 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
294 return result; |
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 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
297 // 7.8.2.3 The strtoimax and strtoumax functions |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
298 #define strtoimax _strtoi64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
299 #define strtoumax _strtoui64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
300 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
301 // 7.8.2.4 The wcstoimax and wcstoumax functions |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
302 #define wcstoimax _wcstoi64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
303 #define wcstoumax _wcstoui64 |
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 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
306 #endif // _MSC_INTTYPES_H_ ] |