@zigc/lib 0.16.0-test.1 → 0.17.0-dev.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/LICENSE +19 -0
  2. package/c/math.zig +135 -35
  3. package/c/stropts.zig +17 -0
  4. package/c.zig +1 -0
  5. package/compiler/aro/aro/Attribute/names.zig +604 -589
  6. package/compiler/aro/aro/Attribute.zig +202 -116
  7. package/compiler/aro/aro/Builtins/common.zig +874 -863
  8. package/compiler/aro/aro/Builtins/eval.zig +15 -7
  9. package/compiler/aro/aro/Builtins.zig +0 -1
  10. package/compiler/aro/aro/CodeGen.zig +3 -1
  11. package/compiler/aro/aro/Compilation.zig +120 -97
  12. package/compiler/aro/aro/Diagnostics.zig +21 -17
  13. package/compiler/aro/aro/Driver/GCCDetector.zig +635 -0
  14. package/compiler/aro/aro/Driver.zig +124 -50
  15. package/compiler/aro/aro/LangOpts.zig +12 -2
  16. package/compiler/aro/aro/Parser/Diagnostic.zig +79 -19
  17. package/compiler/aro/aro/Parser.zig +336 -142
  18. package/compiler/aro/aro/Preprocessor/Diagnostic.zig +21 -0
  19. package/compiler/aro/aro/Preprocessor.zig +127 -56
  20. package/compiler/aro/aro/Target.zig +17 -12
  21. package/compiler/aro/aro/Tokenizer.zig +31 -14
  22. package/compiler/aro/aro/Toolchain.zig +4 -7
  23. package/compiler/aro/aro/Tree.zig +178 -148
  24. package/compiler/aro/aro/TypeStore.zig +82 -24
  25. package/compiler/aro/aro/Value.zig +13 -17
  26. package/compiler/aro/aro/features.zig +1 -0
  27. package/compiler/aro/aro/pragmas/once.zig +0 -1
  28. package/compiler/aro/aro/record_layout.zig +3 -3
  29. package/compiler/aro/assembly_backend/x86_64.zig +3 -4
  30. package/compiler/aro/backend/Assembly.zig +1 -2
  31. package/compiler/aro/backend/Interner.zig +2 -2
  32. package/compiler/aro/backend/Ir.zig +100 -92
  33. package/compiler/aro/include/ptrcheck.h +49 -0
  34. package/compiler/aro/main.zig +26 -10
  35. package/compiler/build_runner.zig +1 -0
  36. package/compiler/objdump.zig +93 -0
  37. package/compiler/reduce.zig +5 -1
  38. package/compiler/resinator/compile.zig +2 -2
  39. package/compiler/resinator/main.zig +7 -1
  40. package/compiler/resinator/preprocess.zig +1 -3
  41. package/compiler/std-docs.zig +8 -1
  42. package/compiler/test_runner.zig +193 -61
  43. package/compiler/translate-c/MacroTranslator.zig +80 -11
  44. package/compiler/translate-c/PatternList.zig +1 -9
  45. package/compiler/translate-c/Scope.zig +43 -6
  46. package/compiler/translate-c/Translator.zig +364 -126
  47. package/compiler/translate-c/ast.zig +19 -11
  48. package/compiler/translate-c/main.zig +75 -16
  49. package/compiler_rt/cos.zig +141 -52
  50. package/compiler_rt/limb64.zig +266 -0
  51. package/compiler_rt/long_double.zig +37 -0
  52. package/compiler_rt/mulo.zig +6 -1
  53. package/compiler_rt/rem_pio2l.zig +173 -0
  54. package/compiler_rt/sin.zig +140 -55
  55. package/compiler_rt/sincos.zig +279 -72
  56. package/compiler_rt/tan.zig +118 -47
  57. package/compiler_rt/trig.zig +256 -6
  58. package/compiler_rt.zig +2 -0
  59. package/fuzzer.zig +855 -307
  60. package/libc/musl/src/math/pow.c +343 -0
  61. package/package.json +1 -1
  62. package/std/Build/Fuzz.zig +6 -19
  63. package/std/Build/Module.zig +1 -1
  64. package/std/Build/Step/CheckObject.zig +3 -3
  65. package/std/Build/Step/Compile.zig +18 -0
  66. package/std/Build/Step/ConfigHeader.zig +49 -33
  67. package/std/Build/Step/InstallArtifact.zig +18 -0
  68. package/std/Build/Step/Run.zig +536 -87
  69. package/std/Build/Step/TranslateC.zig +0 -6
  70. package/std/Build/Step.zig +8 -15
  71. package/std/Build/WebServer.zig +29 -17
  72. package/std/Build/abi.zig +47 -11
  73. package/std/Build.zig +17 -14
  74. package/std/Io/Dispatch.zig +2 -0
  75. package/std/Io/File/Reader.zig +3 -1
  76. package/std/Io/File.zig +1 -0
  77. package/std/Io/Kqueue.zig +2 -2
  78. package/std/Io/Threaded.zig +181 -143
  79. package/std/Io/Uring.zig +2 -1
  80. package/std/Io.zig +970 -2
  81. package/std/Target.zig +3 -2
  82. package/std/Thread.zig +8 -3
  83. package/std/array_hash_map.zig +96 -555
  84. package/std/array_list.zig +22 -31
  85. package/std/bit_set.zig +22 -6
  86. package/std/builtin/assembly.zig +68 -0
  87. package/std/c.zig +17 -17
  88. package/std/compress/flate/Compress.zig +3 -3
  89. package/std/crypto/Certificate/Bundle.zig +15 -1
  90. package/std/crypto/codecs/asn1.zig +33 -18
  91. package/std/crypto/codecs/base64_hex_ct.zig +14 -4
  92. package/std/debug/Dwarf.zig +29 -9
  93. package/std/debug/Info.zig +4 -0
  94. package/std/debug/MachOFile.zig +46 -8
  95. package/std/debug/Pdb.zig +539 -36
  96. package/std/debug/SelfInfo/Elf.zig +19 -18
  97. package/std/debug/SelfInfo/MachO.zig +18 -7
  98. package/std/debug/SelfInfo/Windows.zig +138 -36
  99. package/std/debug.zig +179 -65
  100. package/std/enums.zig +25 -19
  101. package/std/heap/ArenaAllocator.zig +145 -154
  102. package/std/heap/debug_allocator.zig +7 -7
  103. package/std/http/Client.zig +10 -6
  104. package/std/http.zig +11 -9
  105. package/std/json/Stringify.zig +3 -3
  106. package/std/json/dynamic.zig +4 -4
  107. package/std/math/big/int.zig +16 -17
  108. package/std/mem/Allocator.zig +4 -5
  109. package/std/mem.zig +48 -0
  110. package/std/os/emscripten.zig +2 -18
  111. package/std/os/linux/arc.zig +144 -0
  112. package/std/os/linux.zig +21 -4
  113. package/std/os/windows.zig +2 -2
  114. package/std/pdb.zig +143 -4
  115. package/std/posix.zig +6 -12
  116. package/std/priority_dequeue.zig +13 -12
  117. package/std/priority_queue.zig +5 -4
  118. package/std/process/Child.zig +1 -1
  119. package/std/process/Environ.zig +1 -1
  120. package/std/start.zig +17 -4
  121. package/std/std.zig +19 -6
  122. package/std/testing/FailingAllocator.zig +4 -4
  123. package/std/testing/Smith.zig +37 -2
  124. package/std/zig/Ast/Render.zig +186 -458
  125. package/std/zig/Ast.zig +0 -4
  126. package/std/zig/AstGen.zig +44 -7
  127. package/std/zig/AstSmith.zig +2602 -0
  128. package/std/zig/Client.zig +8 -3
  129. package/std/zig/Parse.zig +83 -74
  130. package/std/zig/Server.zig +26 -0
  131. package/std/zig/Zir.zig +17 -0
  132. package/std/zig/c_translation/helpers.zig +14 -9
  133. package/std/zig/llvm/Builder.zig +107 -48
  134. package/std/zig/system.zig +20 -4
  135. package/std/zig/tokenizer.zig +2 -1
  136. package/std/zig.zig +6 -0
  137. package/compiler/aro/aro/Driver/Filesystem.zig +0 -241
  138. package/libc/mingw/complex/cabs.c +0 -48
  139. package/libc/mingw/complex/cabsf.c +0 -48
  140. package/libc/mingw/complex/cacos.c +0 -50
  141. package/libc/mingw/complex/cacosf.c +0 -50
  142. package/libc/mingw/complex/carg.c +0 -48
  143. package/libc/mingw/complex/cargf.c +0 -48
  144. package/libc/mingw/complex/casin.c +0 -50
  145. package/libc/mingw/complex/casinf.c +0 -50
  146. package/libc/mingw/complex/catan.c +0 -50
  147. package/libc/mingw/complex/catanf.c +0 -50
  148. package/libc/mingw/complex/ccos.c +0 -50
  149. package/libc/mingw/complex/ccosf.c +0 -50
  150. package/libc/mingw/complex/cexp.c +0 -48
  151. package/libc/mingw/complex/cexpf.c +0 -48
  152. package/libc/mingw/complex/cimag.c +0 -48
  153. package/libc/mingw/complex/cimagf.c +0 -48
  154. package/libc/mingw/complex/clog.c +0 -48
  155. package/libc/mingw/complex/clog10.c +0 -49
  156. package/libc/mingw/complex/clog10f.c +0 -49
  157. package/libc/mingw/complex/clogf.c +0 -48
  158. package/libc/mingw/complex/conj.c +0 -48
  159. package/libc/mingw/complex/conjf.c +0 -48
  160. package/libc/mingw/complex/cpow.c +0 -48
  161. package/libc/mingw/complex/cpowf.c +0 -48
  162. package/libc/mingw/complex/cproj.c +0 -48
  163. package/libc/mingw/complex/cprojf.c +0 -48
  164. package/libc/mingw/complex/creal.c +0 -48
  165. package/libc/mingw/complex/crealf.c +0 -48
  166. package/libc/mingw/complex/csin.c +0 -50
  167. package/libc/mingw/complex/csinf.c +0 -50
  168. package/libc/mingw/complex/csqrt.c +0 -48
  169. package/libc/mingw/complex/csqrtf.c +0 -48
  170. package/libc/mingw/complex/ctan.c +0 -50
  171. package/libc/mingw/complex/ctanf.c +0 -50
  172. package/libc/mingw/math/arm/s_rint.c +0 -86
  173. package/libc/mingw/math/arm/s_rintf.c +0 -51
  174. package/libc/mingw/math/arm/sincos.S +0 -30
  175. package/libc/mingw/math/arm-common/sincosl.c +0 -13
  176. package/libc/mingw/math/arm64/rint.c +0 -12
  177. package/libc/mingw/math/arm64/rintf.c +0 -12
  178. package/libc/mingw/math/arm64/sincos.S +0 -32
  179. package/libc/mingw/math/bsd_private_base.h +0 -148
  180. package/libc/mingw/math/frexpf.c +0 -13
  181. package/libc/mingw/math/frexpl.c +0 -71
  182. package/libc/mingw/math/x86/acosf.c +0 -29
  183. package/libc/mingw/math/x86/atanf.c +0 -23
  184. package/libc/mingw/math/x86/atanl.c +0 -18
  185. package/libc/mingw/math/x86/cos.def.h +0 -65
  186. package/libc/mingw/math/x86/cosl.c +0 -46
  187. package/libc/mingw/math/x86/cosl_internal.S +0 -55
  188. package/libc/mingw/math/x86/ldexp.c +0 -23
  189. package/libc/mingw/math/x86/scalbn.S +0 -41
  190. package/libc/mingw/math/x86/scalbnf.S +0 -40
  191. package/libc/mingw/math/x86/sin.def.h +0 -65
  192. package/libc/mingw/math/x86/sinl.c +0 -46
  193. package/libc/mingw/math/x86/sinl_internal.S +0 -58
  194. package/libc/mingw/math/x86/tanl.S +0 -62
  195. package/libc/mingw/misc/btowc.c +0 -28
  196. package/libc/mingw/misc/wcstof.c +0 -66
  197. package/libc/mingw/misc/wcstoimax.c +0 -132
  198. package/libc/mingw/misc/wcstoumax.c +0 -126
  199. package/libc/mingw/misc/wctob.c +0 -29
  200. package/libc/mingw/misc/winbs_uint64.c +0 -6
  201. package/libc/mingw/misc/winbs_ulong.c +0 -6
  202. package/libc/mingw/misc/winbs_ushort.c +0 -6
  203. package/libc/mingw/stdio/_Exit.c +0 -10
  204. package/libc/mingw/stdio/_findfirst64i32.c +0 -21
  205. package/libc/mingw/stdio/_findnext64i32.c +0 -21
  206. package/libc/mingw/stdio/_fstat64i32.c +0 -37
  207. package/libc/mingw/stdio/_stat64i32.c +0 -37
  208. package/libc/mingw/stdio/_wfindfirst64i32.c +0 -21
  209. package/libc/mingw/stdio/_wfindnext64i32.c +0 -21
  210. package/libc/mingw/stdio/_wstat64i32.c +0 -37
  211. package/libc/musl/src/legacy/isastream.c +0 -7
  212. package/libc/musl/src/legacy/valloc.c +0 -8
  213. package/libc/musl/src/math/__cosl.c +0 -96
  214. package/libc/musl/src/math/__sinl.c +0 -78
  215. package/libc/musl/src/math/__tanl.c +0 -143
  216. package/libc/musl/src/math/aarch64/lrint.c +0 -10
  217. package/libc/musl/src/math/aarch64/lrintf.c +0 -10
  218. package/libc/musl/src/math/aarch64/rintf.c +0 -7
  219. package/libc/musl/src/math/cosl.c +0 -39
  220. package/libc/musl/src/math/fdim.c +0 -10
  221. package/libc/musl/src/math/finite.c +0 -7
  222. package/libc/musl/src/math/finitef.c +0 -7
  223. package/libc/musl/src/math/frexp.c +0 -23
  224. package/libc/musl/src/math/frexpf.c +0 -23
  225. package/libc/musl/src/math/frexpl.c +0 -29
  226. package/libc/musl/src/math/i386/lrint.c +0 -8
  227. package/libc/musl/src/math/i386/lrintf.c +0 -8
  228. package/libc/musl/src/math/i386/rintf.c +0 -7
  229. package/libc/musl/src/math/lrint.c +0 -72
  230. package/libc/musl/src/math/lrintf.c +0 -8
  231. package/libc/musl/src/math/powerpc64/lrint.c +0 -16
  232. package/libc/musl/src/math/powerpc64/lrintf.c +0 -16
  233. package/libc/musl/src/math/rintf.c +0 -30
  234. package/libc/musl/src/math/s390x/rintf.c +0 -15
  235. package/libc/musl/src/math/sincosl.c +0 -60
  236. package/libc/musl/src/math/sinl.c +0 -41
  237. package/libc/musl/src/math/tanl.c +0 -29
  238. package/libc/musl/src/math/x32/lrint.s +0 -5
  239. package/libc/musl/src/math/x32/lrintf.s +0 -5
  240. package/libc/musl/src/math/x86_64/lrint.c +0 -8
  241. package/libc/musl/src/math/x86_64/lrintf.c +0 -8
  242. package/libc/wasi/libc-bottom-half/sources/reallocarray.c +0 -14
@@ -1,58 +0,0 @@
1
- /**
2
- * This file has no copyright assigned and is placed in the Public Domain.
3
- * This file is part of the mingw-w64 runtime package.
4
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
- */
6
- #include <_mingw_mac.h>
7
-
8
- .file "sinl_internal.S"
9
- .text
10
- #ifdef __x86_64__
11
- .align 8
12
- #else
13
- .align 4
14
- #endif
15
- .globl __MINGW_USYMBOL(__sinl_internal)
16
- .def __MINGW_USYMBOL(__sinl_internal); .scl 2; .type 32; .endef
17
- __MINGW_USYMBOL(__sinl_internal):
18
- #ifdef __x86_64__
19
- fldt (%rdx)
20
- fsin
21
- fnstsw %ax
22
- testl $0x400,%eax
23
- jnz 1f
24
- movq %rcx,%rax
25
- movq $0,8(%rcx)
26
- fstpt (%rcx)
27
- ret
28
- 1: fldpi
29
- fadd %st(0)
30
- fxch %st(1)
31
- 2: fprem1
32
- fnstsw %ax
33
- testl $0x400,%eax
34
- jnz 2b
35
- fstp %st(1)
36
- fsin
37
- movq %rcx,%rax
38
- movq $0,8(%rcx)
39
- fstpt (%rcx)
40
- ret
41
- #else
42
- fldt 4(%esp)
43
- fsin
44
- fnstsw %ax
45
- testl $0x400,%eax
46
- jnz 1f
47
- ret
48
- 1: fldpi
49
- fadd %st(0)
50
- fxch %st(1)
51
- 2: fprem1
52
- fnstsw %ax
53
- testl $0x400,%eax
54
- jnz 2b
55
- fstp %st(1)
56
- fsin
57
- ret
58
- #endif
@@ -1,62 +0,0 @@
1
- /**
2
- * This file has no copyright assigned and is placed in the Public Domain.
3
- * This file is part of the mingw-w64 runtime package.
4
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
- */
6
- #include <_mingw_mac.h>
7
-
8
- .file "tanl.S"
9
- .text
10
- #ifdef __x86_64__
11
- .align 8
12
- #else
13
- .align 4
14
- #endif
15
- .globl __MINGW_USYMBOL(tanl)
16
- .def __MINGW_USYMBOL(tanl); .scl 2; .type 32; .endef
17
- __MINGW_USYMBOL(tanl):
18
- #ifdef __x86_64__
19
- fldt (%rdx)
20
- fptan
21
- fnstsw %ax
22
- testl $0x400,%eax
23
- jnz 1f
24
- fstp %st(0)
25
- movq %rcx,%rax
26
- movq $0,8(%rcx)
27
- fstpt (%rcx)
28
- ret
29
- 1: fldpi
30
- fadd %st(0)
31
- fxch %st(1)
32
- 2: fprem1
33
- fstsw %ax
34
- testl $0x400,%eax
35
- jnz 2b
36
- fstp %st(1)
37
- fptan
38
- fstp %st(0)
39
- movq %rcx,%rax
40
- movq $0,8(%rcx)
41
- fstpt (%rcx)
42
- ret
43
- #else
44
- fldt 4(%esp)
45
- fptan
46
- fnstsw %ax
47
- testl $0x400,%eax
48
- jnz 1f
49
- fstp %st(0)
50
- ret
51
- 1: fldpi
52
- fadd %st(0)
53
- fxch %st(1)
54
- 2: fprem1
55
- fstsw %ax
56
- testl $0x400,%eax
57
- jnz 2b
58
- fstp %st(1)
59
- fptan
60
- fstp %st(0)
61
- ret
62
- #endif
@@ -1,28 +0,0 @@
1
- /**
2
- * This file has no copyright assigned and is placed in the Public Domain.
3
- * This file is part of the mingw-w64 runtime package.
4
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
- */
6
- #ifndef WIN32_LEAN_AND_MEAN
7
- #define WIN32_LEAN_AND_MEAN
8
- #endif
9
- #include "mb_wc_common.h"
10
- #include <wchar.h>
11
- #include <stdio.h>
12
- #include <windows.h>
13
-
14
- wint_t btowc (int c)
15
- {
16
- if (c == EOF)
17
- return (WEOF);
18
- else
19
- {
20
- unsigned char ch = c;
21
- wchar_t wc = WEOF;
22
- if (!MultiByteToWideChar (___lc_codepage_func(), MB_ERR_INVALID_CHARS,
23
- (char*)&ch, 1, &wc, 1))
24
- return WEOF;
25
-
26
- return wc;
27
- }
28
- }
@@ -1,66 +0,0 @@
1
- /* Wide char wrapper for strtof
2
- * Revision history:
3
- * 25 Aug 2006 Initial version.
4
- *
5
- * Contributor: Danny Smith <dannysmith@users.sourceforege.net>
6
- */
7
-
8
- /* This routine has been placed in the public domain.*/
9
-
10
- #define WIN32_LEAN_AND_MEAN
11
- #include <windows.h>
12
- #include <locale.h>
13
- #include <wchar.h>
14
- #include <stdlib.h>
15
- #include <string.h>
16
- #include <mbstring.h>
17
-
18
- #include "mb_wc_common.h"
19
-
20
- float wcstof (const wchar_t * __restrict__ wcs, wchar_t ** __restrict__ wcse)
21
- {
22
- char * cs;
23
- char * cse;
24
- unsigned int i;
25
- float ret;
26
- const unsigned int cp = ___lc_codepage_func();
27
-
28
- /* Allocate enough room for (possibly) mb chars */
29
- cs = (char *) malloc ((wcslen(wcs)+1) * MB_CUR_MAX);
30
-
31
- if (cp == 0) /* C locale */
32
- {
33
- for (i = 0; (wcs[i] != 0) && wcs[i] <= 255; i++)
34
- cs[i] = (char) wcs[i];
35
- cs[i] = '\0';
36
- }
37
- else
38
- {
39
- int nbytes = -1;
40
- int mb_len = 0;
41
- /* loop through till we hit null or invalid character */
42
- for (i = 0; (wcs[i] != 0) && (nbytes != 0); i++)
43
- {
44
- nbytes = WideCharToMultiByte(cp, WC_COMPOSITECHECK | WC_SEPCHARS,
45
- wcs + i, 1, cs + mb_len, MB_CUR_MAX,
46
- NULL, NULL);
47
- mb_len += nbytes;
48
- }
49
- cs[mb_len] = '\0';
50
- }
51
-
52
- ret = strtof (cs, &cse);
53
-
54
- if (wcse)
55
- {
56
- /* Make sure temp mbstring cs has 0 at cse. */
57
- *cse = '\0';
58
- i = MultiByteToWideChar (cp, MB_ERR_INVALID_CHARS, cs, -1, NULL, 0);
59
- if (i > 0)
60
- i -= 1; /* Remove zero terminator from length. */
61
- *wcse = (wchar_t *) wcs + i;
62
- }
63
- free (cs);
64
-
65
- return ret;
66
- }
@@ -1,132 +0,0 @@
1
- /**
2
- * This file has no copyright assigned and is placed in the Public Domain.
3
- * This file is part of the mingw-w64 runtime package.
4
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
- */
6
- /*
7
- This source code was extracted from the Q8 package created and
8
- placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil>
9
-
10
- last edit: 1999/11/05 gwyn@arl.mil
11
-
12
- Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E).
13
-
14
- This particular implementation requires the matching <inttypes.h>.
15
- It also assumes that character codes for A..Z and a..z are in
16
- contiguous ascending order; this is true for ASCII but not EBCDIC.
17
- */
18
-
19
- #include <wchar.h>
20
- #include <errno.h>
21
- #include <ctype.h>
22
- #include <inttypes.h>
23
-
24
- /* convert digit wide character to number, in any base */
25
-
26
- #define ToWNumber(c) (iswdigit(c) ? (c) - L'0' : \
27
- iswupper(c) ? (c) - L'A' + 10 : \
28
- iswlower(c) ? (c) - L'a' + 10 : \
29
- -1 /* "invalid" flag */ \
30
- )
31
-
32
- /* validate converted digit character for specific base */
33
- #define valid(n, b) ((n) >= 0 && (n) < (b))
34
-
35
- intmax_t
36
- __cdecl
37
- wcstoimax(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr, int base)
38
- {
39
- register uintmax_t accum; /* accumulates converted value */
40
- register int n; /* numeral from digit character */
41
- int minus; /* set iff minus sign seen */
42
- int toobig; /* set iff value overflows */
43
-
44
- if ( endptr != NULL )
45
- *endptr = (wchar_t *)nptr; /* in case no conv performed */
46
-
47
- if ( base < 0 || base == 1 || base > 36 )
48
- {
49
- errno = EDOM;
50
- return 0; /* unspecified behavior */
51
- }
52
-
53
- /* skip initial, possibly empty sequence of white-space w.characters */
54
-
55
- while ( iswspace(*nptr) )
56
- ++nptr;
57
-
58
- /* process subject sequence: */
59
-
60
- /* optional sign */
61
-
62
- if ( (minus = *nptr == L'-') || *nptr == L'+' )
63
- ++nptr;
64
-
65
- if ( base == 0 )
66
- {
67
- if ( *nptr == L'0' )
68
- {
69
- if ( nptr[1] == L'X' || nptr[1] == L'x' )
70
- base = 16;
71
- else
72
- base = 8;
73
- }
74
- else
75
- base = 10;
76
- }
77
- /* optional "0x" or "0X" for base 16 */
78
-
79
- if ( base == 16 && *nptr == L'0'
80
- && (nptr[1] == L'X' || nptr[1] == L'x')
81
- )
82
- nptr += 2; /* skip past this prefix */
83
-
84
- /* check whether there is at least one valid digit */
85
-
86
- n = ToWNumber(*nptr);
87
- ++nptr;
88
-
89
- if ( !valid(n, base) )
90
- return 0; /* subject seq. not of expected form */
91
-
92
- accum = n;
93
-
94
- for ( toobig = 0; n = ToWNumber(*nptr), valid(n, base); ++nptr )
95
- if ( accum > (uintmax_t)(INTMAX_MAX / base + 2) ) /* major wrap-around */
96
- toobig = 1; /* but keep scanning */
97
- else
98
- accum = base * accum + n;
99
-
100
- if ( endptr != NULL )
101
- *endptr = (wchar_t *)nptr; /* -> first not-valid-digit */
102
-
103
- if ( minus )
104
- {
105
- if ( accum > (uintmax_t)INTMAX_MAX + 1 )
106
- toobig = 1;
107
- }
108
- else
109
- if ( accum > (uintmax_t)INTMAX_MAX )
110
- toobig = 1;
111
-
112
- if ( toobig )
113
- {
114
- errno = ERANGE;
115
- return minus ? INTMAX_MIN : INTMAX_MAX;
116
- }
117
- else
118
- return (intmax_t)(minus ? -accum : accum);
119
- }
120
- intmax_t (__cdecl *__MINGW_IMP_SYMBOL(wcstoimax))(const wchar_t * __restrict__, wchar_t ** __restrict__, int) = wcstoimax;
121
-
122
- long long __attribute__ ((alias ("wcstoimax")))
123
- __cdecl
124
- wcstoll (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base);
125
- extern long long __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(wcstoimax)))))
126
- (__cdecl *__MINGW_IMP_SYMBOL(wcstoll))(const wchar_t * __restrict__, wchar_t ** __restrict__, int);
127
-
128
- long long __attribute__ ((alias ("wcstoimax")))
129
- __cdecl
130
- _wcstoi64 (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base);
131
- extern long long __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(wcstoimax)))))
132
- (__cdecl *__MINGW_IMP_SYMBOL(_wcstoi64))(const wchar_t * __restrict__, wchar_t ** __restrict__, int);
@@ -1,126 +0,0 @@
1
- /**
2
- * This file has no copyright assigned and is placed in the Public Domain.
3
- * This file is part of the mingw-w64 runtime package.
4
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
- */
6
- /*
7
- This source code was extracted from the Q8 package created and
8
- placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil>
9
-
10
- last edit: 1999/11/05 gwyn@arl.mil
11
-
12
- Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E).
13
-
14
- This particular implementation requires the matching <inttypes.h>.
15
- It also assumes that character codes for A..Z and a..z are in
16
- contiguous ascending order; this is true for ASCII but not EBCDIC.
17
- */
18
-
19
- #include <wchar.h>
20
- #include <errno.h>
21
- #include <ctype.h>
22
- #include <inttypes.h>
23
-
24
- /* convert digit wide character to number, in any base */
25
-
26
- #define ToWNumber(c) (iswdigit(c) ? (c) - L'0' : \
27
- iswupper(c) ? (c) - L'A' + 10 : \
28
- iswlower(c) ? (c) - L'a' + 10 : \
29
- -1 /* "invalid" flag */ \
30
- )
31
-
32
- /* validate converted digit character for specific base */
33
- #define valid(n, b) ((n) >= 0 && (n) < (b))
34
-
35
- uintmax_t
36
- __cdecl
37
- wcstoumax(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr, int base)
38
- {
39
- register uintmax_t accum; /* accumulates converted value */
40
- register uintmax_t next; /* for computing next value of accum */
41
- register int n; /* numeral from digit character */
42
- int minus; /* set iff minus sign seen (yes!) */
43
- int toobig; /* set iff value overflows */
44
-
45
- if ( endptr != NULL )
46
- *endptr = (wchar_t *)nptr; /* in case no conv performed */
47
-
48
- if ( base < 0 || base == 1 || base > 36 )
49
- {
50
- errno = EDOM;
51
- return 0; /* unspecified behavior */
52
- }
53
-
54
- /* skip initial, possibly empty sequence of white-space w.characters */
55
-
56
- while ( iswspace(*nptr) )
57
- ++nptr;
58
-
59
- /* process subject sequence: */
60
-
61
- /* optional sign */
62
-
63
- if ( (minus = *nptr == L'-') || *nptr == L'+' )
64
- ++nptr;
65
-
66
- if ( base == 0 )
67
- {
68
- if ( *nptr == L'0' )
69
- {
70
- if ( nptr[1] == L'X' || nptr[1] == L'x' )
71
- base = 16;
72
- else
73
- base = 8;
74
- }
75
- else
76
- base = 10;
77
- }
78
- /* optional "0x" or "0X" for base 16 */
79
-
80
- if ( base == 16 && *nptr == L'0'
81
- && (nptr[1] == L'X' || nptr[1] == L'x')
82
- )
83
- nptr += 2; /* skip past this prefix */
84
-
85
- /* check whether there is at least one valid digit */
86
-
87
- n = ToWNumber(*nptr);
88
- ++nptr;
89
-
90
- if ( !valid(n, base) )
91
- return 0; /* subject seq. not of expected form */
92
-
93
- accum = n;
94
-
95
- for ( toobig = 0; n = ToWNumber(*nptr), valid(n, base); ++nptr )
96
- if ( accum > UINTMAX_MAX / base + 1 /* major wrap-around */
97
- || (next = base * accum + n) < accum /* minor wrap-around */
98
- )
99
- toobig = 1; /* but keep scanning */
100
- else
101
- accum = next;
102
-
103
- if ( endptr != NULL )
104
- *endptr = (wchar_t *)nptr; /* -> first not-valid-digit */
105
-
106
- if ( toobig )
107
- {
108
- errno = ERANGE;
109
- return UINTMAX_MAX;
110
- }
111
- else
112
- return minus ? -accum : accum; /* (yes!) */
113
- }
114
- uintmax_t (__cdecl *__MINGW_IMP_SYMBOL(wcstoumax))(const wchar_t * __restrict__, wchar_t ** __restrict__, int) = wcstoumax;
115
-
116
- unsigned long long __attribute__ ((alias ("wcstoumax")))
117
- __cdecl
118
- wcstoull (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base);
119
- extern unsigned long long __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(wcstoumax)))))
120
- (__cdecl *__MINGW_IMP_SYMBOL(wcstoull))(const wchar_t * __restrict__, wchar_t ** __restrict__, int);
121
-
122
- unsigned long long __attribute__ ((alias ("wcstoumax")))
123
- __cdecl
124
- _wcstoui64 (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base);
125
- extern unsigned long long __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(wcstoumax)))))
126
- (__cdecl *__MINGW_IMP_SYMBOL(_wcstoui64))(const wchar_t * __restrict__, wchar_t ** __restrict__, int);
@@ -1,29 +0,0 @@
1
- /**
2
- * This file has no copyright assigned and is placed in the Public Domain.
3
- * This file is part of the mingw-w64 runtime package.
4
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
- */
6
- #ifndef WIN32_LEAN_AND_MEAN
7
- #define WIN32_LEAN_AND_MEAN
8
- #endif
9
- #include "mb_wc_common.h"
10
- #include <wchar.h>
11
- #include <stdio.h>
12
- #include <stdlib.h>
13
- #include <errno.h>
14
- #include <windows.h>
15
-
16
- /* Return just the first byte after translating to multibyte. */
17
- int wctob (wint_t wc )
18
- {
19
- wchar_t w = wc;
20
- char c;
21
- int invalid_char = 0;
22
- if (!WideCharToMultiByte (___lc_codepage_func(),
23
- 0 /* Is this correct flag? */,
24
- &w, 1, &c, 1, NULL, &invalid_char)
25
- || invalid_char)
26
- return EOF;
27
-
28
- return (unsigned char) c;
29
- }
@@ -1,6 +0,0 @@
1
- unsigned long long __cdecl _byteswap_uint64(unsigned long long _Int64);
2
-
3
- unsigned long long __cdecl _byteswap_uint64(unsigned long long _Int64)
4
- {
5
- return __builtin_bswap64(_Int64);
6
- }
@@ -1,6 +0,0 @@
1
- unsigned long __cdecl _byteswap_ulong (unsigned long _Long);
2
-
3
- unsigned long __cdecl _byteswap_ulong (unsigned long _Long)
4
- {
5
- return __builtin_bswap32(_Long);
6
- }
@@ -1,6 +0,0 @@
1
- unsigned short __cdecl _byteswap_ushort(unsigned short _Short);
2
-
3
- unsigned short __cdecl _byteswap_ushort(unsigned short _Short)
4
- {
5
- return __builtin_bswap16(_Short);
6
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * This file has no copyright assigned and is placed in the Public Domain.
3
- * This file is part of the mingw-w64 runtime package.
4
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
- */
6
- #define __CRT__NO_INLINE
7
- #include <stdlib.h>
8
-
9
- void _Exit(int status)
10
- { _exit(status); }
@@ -1,21 +0,0 @@
1
- #define __CRT__NO_INLINE
2
- #include <io.h>
3
- #include <string.h>
4
-
5
- intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData)
6
- {
7
- struct __finddata64_t fd;
8
- intptr_t ret = _findfirst64(_Filename,&fd);
9
- if (ret == -1) {
10
- *_FindData = (struct _finddata64i32_t){0};
11
- return -1;
12
- }
13
- _FindData->attrib=fd.attrib;
14
- _FindData->time_create=fd.time_create;
15
- _FindData->time_access=fd.time_access;
16
- _FindData->time_write=fd.time_write;
17
- _FindData->size=(_fsize_t) fd.size;
18
- strncpy(_FindData->name,fd.name,260);
19
- return ret;
20
- }
21
-
@@ -1,21 +0,0 @@
1
- #define __CRT__NO_INLINE
2
- #include <io.h>
3
- #include <string.h>
4
-
5
- int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData)
6
- {
7
- struct __finddata64_t fd;
8
- int ret = _findnext64(_FindHandle,&fd);
9
- if (ret == -1) {
10
- *_FindData = (struct _finddata64i32_t){0};
11
- return -1;
12
- }
13
- _FindData->attrib=fd.attrib;
14
- _FindData->time_create=fd.time_create;
15
- _FindData->time_access=fd.time_access;
16
- _FindData->time_write=fd.time_write;
17
- _FindData->size=(_fsize_t) fd.size;
18
- strncpy(_FindData->name,fd.name,260);
19
- return ret;
20
- }
21
-
@@ -1,37 +0,0 @@
1
- /**
2
- * This file has no copyright assigned and is placed in the Public Domain.
3
- * This file is part of the mingw-w64 runtime package.
4
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
- */
6
-
7
- #include <sys/stat.h>
8
-
9
- /* When the file size does not fit into the st_size field:
10
- * crtdll-msvcr90 msvcr100 msvcr110+
11
- * st_size truncate 0 0
12
- * errno no change no change EOVERFLOW
13
- * returns 0 -1 -1
14
- *
15
- * This file is used only for pre-msvcr80 builds,
16
- * So use the pre-msvcr80 behavior - truncate without error.
17
- */
18
- int __cdecl _fstat64i32(int _FileDes,struct _stat64i32 *_Stat)
19
- {
20
- struct _stat64 st;
21
- int ret=_fstat64(_FileDes,&st);
22
- if (ret != 0)
23
- return ret;
24
- _Stat->st_dev=st.st_dev;
25
- _Stat->st_ino=st.st_ino;
26
- _Stat->st_mode=st.st_mode;
27
- _Stat->st_nlink=st.st_nlink;
28
- _Stat->st_uid=st.st_uid;
29
- _Stat->st_gid=st.st_gid;
30
- _Stat->st_rdev=st.st_rdev;
31
- _Stat->st_size=(_off_t) st.st_size; /* truncate 64-bit st_size to 32-bit */
32
- _Stat->st_atime=st.st_atime;
33
- _Stat->st_mtime=st.st_mtime;
34
- _Stat->st_ctime=st.st_ctime;
35
- return 0;
36
- }
37
- int (__cdecl *__MINGW_IMP_SYMBOL(_fstat64i32))(int, struct _stat64i32 *) = _fstat64i32;
@@ -1,37 +0,0 @@
1
- /**
2
- * This file has no copyright assigned and is placed in the Public Domain.
3
- * This file is part of the mingw-w64 runtime package.
4
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5
- */
6
-
7
- #include <sys/stat.h>
8
-
9
- /* When the file size does not fit into the st_size field:
10
- * crtdll-msvcr90 msvcr100 msvcr110+
11
- * st_size truncate 0 0
12
- * errno no change no change EOVERFLOW
13
- * returns 0 -1 -1
14
- *
15
- * This file is used only for pre-msvcr80 builds,
16
- * So use the pre-msvcr80 behavior - truncate without error.
17
- */
18
- int __cdecl _stat64i32(const char *_Name,struct _stat64i32 *_Stat)
19
- {
20
- struct _stat64 st;
21
- int ret=_stat64(_Name,&st);
22
- if (ret != 0)
23
- return ret;
24
- _Stat->st_dev=st.st_dev;
25
- _Stat->st_ino=st.st_ino;
26
- _Stat->st_mode=st.st_mode;
27
- _Stat->st_nlink=st.st_nlink;
28
- _Stat->st_uid=st.st_uid;
29
- _Stat->st_gid=st.st_gid;
30
- _Stat->st_rdev=st.st_rdev;
31
- _Stat->st_size=(_off_t) st.st_size; /* truncate 64-bit st_size to 32-bit */
32
- _Stat->st_atime=st.st_atime;
33
- _Stat->st_mtime=st.st_mtime;
34
- _Stat->st_ctime=st.st_ctime;
35
- return 0;
36
- }
37
- int (__cdecl *__MINGW_IMP_SYMBOL(_stat64i32))(const char *, struct _stat64i32 *) = _stat64i32;
@@ -1,21 +0,0 @@
1
- #define __CRT__NO_INLINE
2
- #include <io.h>
3
- #include <string.h>
4
-
5
- intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData)
6
- {
7
- struct _wfinddata64_t fd;
8
- intptr_t ret = _wfindfirst64(_Filename,&fd);
9
- if (ret == -1) {
10
- *_FindData = (struct _wfinddata64i32_t){0};
11
- return -1;
12
- }
13
- _FindData->attrib=fd.attrib;
14
- _FindData->time_create=fd.time_create;
15
- _FindData->time_access=fd.time_access;
16
- _FindData->time_write=fd.time_write;
17
- _FindData->size=(_fsize_t) fd.size;
18
- memcpy(_FindData->name,fd.name,260*sizeof(wchar_t));
19
- return ret;
20
- }
21
-