Mercurial > ms-int-types
annotate inttypes.h @ 0:85c12d7e8144
Initial check in.
author | alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde |
---|---|
date | Mon, 11 Dec 2006 18:39:27 +0000 |
parents | |
children | 0cf270b831ef |
rev | line source |
---|---|
0
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
1 // ISO C9x compliant inttypes.h for Miscrosoft Visual Studio |
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 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
3 // |
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 // |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
6 // This library is free software; you can redistribute it and/or |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
7 // modify it under the terms of the GNU Lesser General Public |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
8 // License as published by the Free Software Foundation; either |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
9 // version 2.1 of the License, or (at your option) any later version. |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
10 // |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
11 // This library is distributed in the hope that it will be useful, |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
14 // Lesser General Public License for more details. |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
15 // |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
16 // You should have received a copy of the GNU Lesser General Public |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
17 // License along with this library; if not, write to the Free Software |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
19 /////////////////////////////////////////////////////////////////////////////// |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
20 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
21 // This file is only usable with Microsoft Visual Studio 2003 or later. |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
22 #ifdef _MSC_VER // [ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
23 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
24 #ifndef _MSC_INTTYPES_H_ // [ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
25 #define _MSC_INTTYPES_H_ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
26 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
27 #if _MSC_VER > 1000 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
28 #pragma once |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
29 #endif |
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 #include <stdint.h> |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
32 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
33 // 7.8 Format conversion of integer types |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
34 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
35 typedef struct { |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
36 intmax_t quot; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
37 intmax_t rem; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
38 } imaxdiv_t; |
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 // 7.8.1 Macros for format specifiers |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
41 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
42 // The fprintf macros for signed integers are: |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
43 #define PRId8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
44 #define PRIi8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
45 #define PRIdLEAST8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
46 #define PRIiLEAST8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
47 #define PRIdFAST8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
48 #define PRIiFAST8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
49 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
50 #define PRId16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
51 #define PRIi16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
52 #define PRIdLEAST16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
53 #define PRIiLEAST16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
54 #define PRIdFAST16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
55 #define PRIiFAST16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
56 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
57 #define PRId32 "I32d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
58 #define PRIi32 "I32i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
59 #define PRIdLEAST32 "I32d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
60 #define PRIiLEAST32 "I32i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
61 #define PRIdFAST32 "I32d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
62 #define PRIiFAST32 "I32i" |
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 PRId64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
65 #define PRIi64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
66 #define PRIdLEAST64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
67 #define PRIiLEAST64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
68 #define PRIdFAST64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
69 #define PRIiFAST64 "I64i" |
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 PRIdMAX "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
72 #define PRIiMAX "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
73 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
74 #define PRIdPTR "Id" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
75 #define PRIiPTR "Ii" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
76 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
77 // The fprintf macros for unsigned integers are: |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
78 #define PRIo8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
79 #define PRIu8 "u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
80 #define PRIx8 "x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
81 #define PRIX8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
82 #define PRIoLEAST8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
83 #define PRIuLEAST8 "u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
84 #define PRIxLEAST8 "x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
85 #define PRIXLEAST8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
86 #define PRIoFAST8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
87 #define PRIuFAST8 "u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
88 #define PRIxFAST8 "x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
89 #define PRIXFAST8 "X" |
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 #define PRIo16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
92 #define PRIu16 "hu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
93 #define PRIx16 "hx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
94 #define PRIX16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
95 #define PRIoLEAST16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
96 #define PRIuLEAST16 "hu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
97 #define PRIxLEAST16 "hx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
98 #define PRIXLEAST16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
99 #define PRIoFAST16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
100 #define PRIuFAST16 "hu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
101 #define PRIxFAST16 "hx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
102 #define PRIXFAST16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
103 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
104 #define PRIo32 "I32o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
105 #define PRIu32 "I32u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
106 #define PRIx32 "I32x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
107 #define PRIX32 "I32X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
108 #define PRIoLEAST32 "I32o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
109 #define PRIuLEAST32 "I32u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
110 #define PRIxLEAST32 "I32x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
111 #define PRIXLEAST32 "I32X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
112 #define PRIoFAST32 "I32o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
113 #define PRIuFAST32 "I32u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
114 #define PRIxFAST32 "I32x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
115 #define PRIXFAST32 "I32X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
116 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
117 #define PRIo64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
118 #define PRIu64 "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
119 #define PRIx64 "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
120 #define PRIX64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
121 #define PRIoLEAST64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
122 #define PRIuLEAST64 "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
123 #define PRIxLEAST64 "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
124 #define PRIXLEAST64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
125 #define PRIoFAST64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
126 #define PRIuFAST64 "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
127 #define PRIxFAST64 "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
128 #define PRIXFAST64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
129 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
130 #define PRIoMAX "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
131 #define PRIuMAX "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
132 #define PRIxMAX "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
133 #define PRIXMAX "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
134 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
135 #define PRIoPTR "Io" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
136 #define PRIuPTR "Iu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
137 #define PRIxPTR "Ix" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
138 #define PRIXPTR "IX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
139 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
140 // The fscanf macros for signed integers are: |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
141 #define SCNd8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
142 #define SCNi8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
143 #define SCNdLEAST8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
144 #define SCNiLEAST8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
145 #define SCNdFAST8 "d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
146 #define SCNiFAST8 "i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
147 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
148 #define SCNd16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
149 #define SCNi16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
150 #define SCNdLEAST16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
151 #define SCNiLEAST16 "hi" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
152 #define SCNdFAST16 "hd" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
153 #define SCNiFAST16 "hi" |
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 #define SCNd32 "ld" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
156 #define SCNi32 "li" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
157 #define SCNdLEAST32 "ld" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
158 #define SCNiLEAST32 "li" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
159 #define SCNdFAST32 "ld" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
160 #define SCNiFAST32 "li" |
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 SCNd64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
163 #define SCNi64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
164 #define SCNdLEAST64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
165 #define SCNiLEAST64 "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
166 #define SCNdFAST64 "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
167 #define SCNiFAST64 "I64i" |
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 SCNdMAX "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
170 #define SCNiMAX "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
171 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
172 #ifdef _WIN64 // [ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
173 # define SCNdPTR "I64d" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
174 # define SCNiPTR "I64i" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
175 #else // _WIN64 ][ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
176 # define SCNdPTR "ld" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
177 # define SCNiPTR "li" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
178 #endif // _WIN64 ] |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
179 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
180 // The fscanf macros for unsigned integers are: |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
181 #define SCNo8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
182 #define SCNu8 "u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
183 #define SCNx8 "x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
184 #define SCNX8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
185 #define SCNoLEAST8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
186 #define SCNuLEAST8 "u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
187 #define SCNxLEAST8 "x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
188 #define SCNXLEAST8 "X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
189 #define SCNoFAST8 "o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
190 #define SCNuFAST8 "u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
191 #define SCNxFAST8 "x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
192 #define SCNXFAST8 "X" |
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 #define SCNo16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
195 #define SCNu16 "hu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
196 #define SCNx16 "hx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
197 #define SCNX16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
198 #define SCNoLEAST16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
199 #define SCNuLEAST16 "hu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
200 #define SCNxLEAST16 "hx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
201 #define SCNXLEAST16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
202 #define SCNoFAST16 "ho" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
203 #define SCNuFAST16 "hu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
204 #define SCNxFAST16 "hx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
205 #define SCNXFAST16 "hX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
206 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
207 #define SCNo32 "lo" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
208 #define SCNu32 "lu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
209 #define SCNx32 "lx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
210 #define SCNX32 "lX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
211 #define SCNoLEAST32 "lo" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
212 #define SCNuLEAST32 "lu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
213 #define SCNxLEAST32 "lx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
214 #define SCNXLEAST32 "lX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
215 #define SCNoFAST32 "lo" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
216 #define SCNuFAST32 "lu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
217 #define SCNxFAST32 "lx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
218 #define SCNXFAST32 "lX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
219 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
220 #define SCNo64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
221 #define SCNu64 "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
222 #define SCNx64 "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
223 #define SCNX64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
224 #define SCNoLEAST64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
225 #define SCNuLEAST64 "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
226 #define SCNxLEAST64 "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
227 #define SCNXLEAST64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
228 #define SCNoFAST64 "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
229 #define SCNuFAST64 "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
230 #define SCNxFAST64 "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
231 #define SCNXFAST64 "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
232 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
233 #define SCNoMAX "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
234 #define SCNuMAX "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
235 #define SCNxMAX "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
236 #define SCNXMAX "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
237 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
238 #ifdef _WIN64 // [ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
239 # define SCNoPTR "I64o" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
240 # define SCNuPTR "I64u" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
241 # define SCNxPTR "I64x" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
242 # define SCNXPTR "I64X" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
243 #else // _WIN64 ][ |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
244 # define SCNoPTR "lo" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
245 # define SCNuPTR "lu" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
246 # define SCNxPTR "lx" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
247 # define SCNXPTR "lX" |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
248 #endif // _WIN64 ] |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
249 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
250 // 7.8.2 Functions for greatest-width integer types |
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 // 7.8.2.1 The imaxabs function |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
253 #define imaxabs _abs64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
254 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
255 // 7.8.2.2 The imaxdiv function |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
256 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
257 // 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
|
258 // in %MSVC.NET%\crt\src\div.c |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
259 _inline imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
260 { |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
261 imaxdiv_t result; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
262 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
263 result.quot = numer / denom; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
264 result.rem = numer % denom; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
265 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
266 if (numer < 0 && result.rem > 0) { |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
267 // did division wrong; must fix up |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
268 ++result.quot; |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
269 result.rem -= denom; |
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 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
272 return result; |
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 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
275 // 7.8.2.3 The strtoimax and strtoumax functions |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
276 #define strtoimax _strtoi64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
277 #define strtoumax _strtoui64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
278 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
279 // 7.8.2.4 The wcstoimax and wcstoumax functions |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
280 #define wcstoimax _wcstoi64 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
281 #define wcstoumax _wcstoui64 |
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 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
284 #endif // _MSC_INTTYPES_H_ ] |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
285 |
85c12d7e8144
Initial check in.
alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde
parents:
diff
changeset
|
286 #endif // _MSC_VER ] |