@zigc/lib 0.16.0-dev.3091 → 0.16.0-dev.3128

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 (132) hide show
  1. package/c/math.zig +121 -30
  2. package/compiler/build_runner.zig +1 -0
  3. package/compiler/test_runner.zig +191 -59
  4. package/compiler_rt/cos.zig +141 -52
  5. package/compiler_rt/long_double.zig +37 -0
  6. package/compiler_rt/rem_pio2l.zig +173 -0
  7. package/compiler_rt/sin.zig +140 -55
  8. package/compiler_rt/sincos.zig +279 -72
  9. package/compiler_rt/tan.zig +118 -47
  10. package/compiler_rt/trig.zig +256 -6
  11. package/fuzzer.zig +855 -307
  12. package/package.json +1 -1
  13. package/std/Build/Fuzz.zig +6 -19
  14. package/std/Build/Step/Run.zig +530 -68
  15. package/std/Build/abi.zig +39 -7
  16. package/std/Build.zig +3 -0
  17. package/std/compress/flate/Compress.zig +3 -3
  18. package/std/debug/Info.zig +4 -0
  19. package/std/heap/ArenaAllocator.zig +145 -154
  20. package/std/mem/Allocator.zig +4 -5
  21. package/std/mem.zig +48 -0
  22. package/std/priority_dequeue.zig +13 -12
  23. package/std/priority_queue.zig +5 -4
  24. package/std/zig/Client.zig +8 -3
  25. package/std/zig/Server.zig +26 -0
  26. package/libc/mingw/complex/cabs.c +0 -48
  27. package/libc/mingw/complex/cabsf.c +0 -48
  28. package/libc/mingw/complex/cacos.c +0 -50
  29. package/libc/mingw/complex/cacosf.c +0 -50
  30. package/libc/mingw/complex/carg.c +0 -48
  31. package/libc/mingw/complex/cargf.c +0 -48
  32. package/libc/mingw/complex/casin.c +0 -50
  33. package/libc/mingw/complex/casinf.c +0 -50
  34. package/libc/mingw/complex/catan.c +0 -50
  35. package/libc/mingw/complex/catanf.c +0 -50
  36. package/libc/mingw/complex/ccos.c +0 -50
  37. package/libc/mingw/complex/ccosf.c +0 -50
  38. package/libc/mingw/complex/cexp.c +0 -48
  39. package/libc/mingw/complex/cexpf.c +0 -48
  40. package/libc/mingw/complex/cimag.c +0 -48
  41. package/libc/mingw/complex/cimagf.c +0 -48
  42. package/libc/mingw/complex/clog.c +0 -48
  43. package/libc/mingw/complex/clog10.c +0 -49
  44. package/libc/mingw/complex/clog10f.c +0 -49
  45. package/libc/mingw/complex/clogf.c +0 -48
  46. package/libc/mingw/complex/conj.c +0 -48
  47. package/libc/mingw/complex/conjf.c +0 -48
  48. package/libc/mingw/complex/cpow.c +0 -48
  49. package/libc/mingw/complex/cpowf.c +0 -48
  50. package/libc/mingw/complex/cproj.c +0 -48
  51. package/libc/mingw/complex/cprojf.c +0 -48
  52. package/libc/mingw/complex/creal.c +0 -48
  53. package/libc/mingw/complex/crealf.c +0 -48
  54. package/libc/mingw/complex/csin.c +0 -50
  55. package/libc/mingw/complex/csinf.c +0 -50
  56. package/libc/mingw/complex/csqrt.c +0 -48
  57. package/libc/mingw/complex/csqrtf.c +0 -48
  58. package/libc/mingw/complex/ctan.c +0 -50
  59. package/libc/mingw/complex/ctanf.c +0 -50
  60. package/libc/mingw/math/arm/s_rint.c +0 -86
  61. package/libc/mingw/math/arm/s_rintf.c +0 -51
  62. package/libc/mingw/math/arm/sincos.S +0 -30
  63. package/libc/mingw/math/arm-common/sincosl.c +0 -13
  64. package/libc/mingw/math/arm64/rint.c +0 -12
  65. package/libc/mingw/math/arm64/rintf.c +0 -12
  66. package/libc/mingw/math/arm64/sincos.S +0 -32
  67. package/libc/mingw/math/bsd_private_base.h +0 -148
  68. package/libc/mingw/math/frexpf.c +0 -13
  69. package/libc/mingw/math/frexpl.c +0 -71
  70. package/libc/mingw/math/x86/acosf.c +0 -29
  71. package/libc/mingw/math/x86/atanf.c +0 -23
  72. package/libc/mingw/math/x86/atanl.c +0 -18
  73. package/libc/mingw/math/x86/cos.def.h +0 -65
  74. package/libc/mingw/math/x86/cosl.c +0 -46
  75. package/libc/mingw/math/x86/cosl_internal.S +0 -55
  76. package/libc/mingw/math/x86/ldexp.c +0 -23
  77. package/libc/mingw/math/x86/scalbn.S +0 -41
  78. package/libc/mingw/math/x86/scalbnf.S +0 -40
  79. package/libc/mingw/math/x86/sin.def.h +0 -65
  80. package/libc/mingw/math/x86/sinl.c +0 -46
  81. package/libc/mingw/math/x86/sinl_internal.S +0 -58
  82. package/libc/mingw/math/x86/tanl.S +0 -62
  83. package/libc/mingw/misc/btowc.c +0 -28
  84. package/libc/mingw/misc/wcstof.c +0 -66
  85. package/libc/mingw/misc/wcstoimax.c +0 -132
  86. package/libc/mingw/misc/wcstoumax.c +0 -126
  87. package/libc/mingw/misc/wctob.c +0 -29
  88. package/libc/mingw/misc/winbs_uint64.c +0 -6
  89. package/libc/mingw/misc/winbs_ulong.c +0 -6
  90. package/libc/mingw/misc/winbs_ushort.c +0 -6
  91. package/libc/mingw/stdio/_Exit.c +0 -10
  92. package/libc/mingw/stdio/_findfirst64i32.c +0 -21
  93. package/libc/mingw/stdio/_findnext64i32.c +0 -21
  94. package/libc/mingw/stdio/_fstat64i32.c +0 -37
  95. package/libc/mingw/stdio/_stat64i32.c +0 -37
  96. package/libc/mingw/stdio/_wfindfirst64i32.c +0 -21
  97. package/libc/mingw/stdio/_wfindnext64i32.c +0 -21
  98. package/libc/mingw/stdio/_wstat64i32.c +0 -37
  99. package/libc/musl/src/legacy/valloc.c +0 -8
  100. package/libc/musl/src/math/__cosl.c +0 -96
  101. package/libc/musl/src/math/__sinl.c +0 -78
  102. package/libc/musl/src/math/__tanl.c +0 -143
  103. package/libc/musl/src/math/aarch64/lrint.c +0 -10
  104. package/libc/musl/src/math/aarch64/lrintf.c +0 -10
  105. package/libc/musl/src/math/aarch64/rintf.c +0 -7
  106. package/libc/musl/src/math/cosl.c +0 -39
  107. package/libc/musl/src/math/exp_data.c +0 -182
  108. package/libc/musl/src/math/exp_data.h +0 -26
  109. package/libc/musl/src/math/finite.c +0 -7
  110. package/libc/musl/src/math/finitef.c +0 -7
  111. package/libc/musl/src/math/frexp.c +0 -23
  112. package/libc/musl/src/math/frexpf.c +0 -23
  113. package/libc/musl/src/math/frexpl.c +0 -29
  114. package/libc/musl/src/math/i386/lrint.c +0 -8
  115. package/libc/musl/src/math/i386/lrintf.c +0 -8
  116. package/libc/musl/src/math/i386/rintf.c +0 -7
  117. package/libc/musl/src/math/lrint.c +0 -72
  118. package/libc/musl/src/math/lrintf.c +0 -8
  119. package/libc/musl/src/math/pow_data.c +0 -180
  120. package/libc/musl/src/math/pow_data.h +0 -22
  121. package/libc/musl/src/math/powerpc64/lrint.c +0 -16
  122. package/libc/musl/src/math/powerpc64/lrintf.c +0 -16
  123. package/libc/musl/src/math/rintf.c +0 -30
  124. package/libc/musl/src/math/s390x/rintf.c +0 -15
  125. package/libc/musl/src/math/sincosl.c +0 -60
  126. package/libc/musl/src/math/sinl.c +0 -41
  127. package/libc/musl/src/math/tanl.c +0 -29
  128. package/libc/musl/src/math/x32/lrint.s +0 -5
  129. package/libc/musl/src/math/x32/lrintf.s +0 -5
  130. package/libc/musl/src/math/x86_64/lrint.c +0 -8
  131. package/libc/musl/src/math/x86_64/lrintf.c +0 -8
  132. package/libc/wasi/libc-bottom-half/sources/reallocarray.c +0 -14
@@ -1,55 +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 "cosl_internal.S"
9
- .text
10
- #ifdef __x86_64__
11
- .align 8
12
- #else
13
- .align 4
14
- #endif
15
- .globl __MINGW_USYMBOL(__cosl_internal)
16
- .def __MINGW_USYMBOL(__cosl_internal); .scl 2; .type 32; .endef
17
- __MINGW_USYMBOL(__cosl_internal):
18
- #ifdef __x86_64__
19
- fldt (%rdx)
20
- fcos
21
- fnstsw %ax
22
- testl $0x400,%eax
23
- jz 1f
24
- fldpi
25
- fadd %st(0)
26
- fxch %st(1)
27
- 2: fprem1
28
- fnstsw %ax
29
- testl $0x400,%eax
30
- jnz 2b
31
- fstp %st(1)
32
- fcos
33
- 1: movq %rcx,%rax
34
- movq $0,8(%rcx)
35
- fstpt (%rcx)
36
- ret
37
- #else
38
- fldt 4(%esp)
39
- fcos
40
- fnstsw %ax
41
- testl $0x400,%eax
42
- jnz 1f
43
- ret
44
- 1: fldpi
45
- fadd %st(0)
46
- fxch %st(1)
47
- 2: fprem1
48
- fnstsw %ax
49
- testl $0x400,%eax
50
- jnz 2b
51
- fstp %st(1)
52
- fcos
53
- ret
54
- #endif
55
-
@@ -1,23 +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 <math.h>
7
- #include <errno.h>
8
-
9
- double ldexp(double x, int expn)
10
- {
11
- double res = 0.0;
12
- if (!isfinite (x) || x == 0.0)
13
- return x;
14
-
15
- __asm__ __volatile__ ("fscale"
16
- : "=t" (res)
17
- : "0" (x), "u" ((double) expn));
18
-
19
- if (!isfinite (res) || res == 0.0L)
20
- errno = ERANGE;
21
-
22
- return res;
23
- }
@@ -1,41 +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 "scalbn.S"
9
- .text
10
- #ifdef __x86_64__
11
- .align 8
12
- #else
13
- .align 4
14
- #endif
15
- .globl __MINGW_USYMBOL(scalbn)
16
- .def __MINGW_USYMBOL(scalbn); .scl 2; .type 32; .endef
17
- __MINGW_USYMBOL(scalbn):
18
- #ifdef __x86_64__
19
- subq $24, %rsp
20
- movq %rdx,(%rsp)
21
- fildl (%rsp)
22
- movsd %xmm0,(%rsp)
23
- fldl (%rsp)
24
- fscale
25
- fstp %st(1)
26
- fstpl (%rsp)
27
- movsd (%rsp),%xmm0
28
- addq $24, %rsp
29
- ret
30
-
31
- #else
32
- fildl 12(%esp)
33
- fldl 4(%esp)
34
- fscale
35
- fstp %st(1)
36
- ret
37
- #endif
38
-
39
- .globl __MINGW_USYMBOL(scalbln)
40
- .set __MINGW_USYMBOL(scalbln),__MINGW_USYMBOL(scalbn)
41
-
@@ -1,40 +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 "scalbnf.S"
9
- .text
10
- #ifdef __x86_64__
11
- .align 8
12
- #else
13
- .align 4
14
- #endif
15
- .globl __MINGW_USYMBOL(scalbnf)
16
- .def __MINGW_USYMBOL(scalbnf); .scl 2; .type 32; .endef
17
- __MINGW_USYMBOL(scalbnf):
18
- #ifdef __x86_64__
19
- subq $24, %rsp
20
- movq %rdx,(%rsp)
21
- fildl (%rsp)
22
- movss %xmm0,(%rsp)
23
- flds (%rsp)
24
- fscale
25
- fstp %st(1)
26
- fstps (%rsp)
27
- movss (%rsp),%xmm0
28
- addq $24, %rsp
29
- ret
30
- #else
31
- fildl 8(%esp)
32
- flds 4(%esp)
33
- fscale
34
- fstp %st(1)
35
- ret
36
- #endif
37
-
38
- .globl __MINGW_USYMBOL(scalblnf)
39
- .set __MINGW_USYMBOL(scalblnf),__MINGW_USYMBOL(scalbnf)
40
-
@@ -1,65 +0,0 @@
1
- /*
2
- This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
-
4
- Copyright (c) 2009, 2010 by the mingw-w64 project
5
-
6
- See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
-
8
- This license has been certified as open source. It has also been designated
9
- as GPL compatible by the Free Software Foundation (FSF).
10
-
11
- Redistribution and use in source and binary forms, with or without
12
- modification, are permitted provided that the following conditions are met:
13
-
14
- 1. Redistributions in source code must retain the accompanying copyright
15
- notice, this list of conditions, and the following disclaimer.
16
- 2. Redistributions in binary form must reproduce the accompanying
17
- copyright notice, this list of conditions, and the following disclaimer
18
- in the documentation and/or other materials provided with the
19
- distribution.
20
- 3. Names of the copyright holders must not be used to endorse or promote
21
- products derived from this software without prior written permission
22
- from the copyright holders.
23
- 4. The right to distribute this software or to use it for any purpose does
24
- not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25
- the copyright holders. Use of them is covered by separate agreement
26
- with the copyright holders.
27
- 5. If any files are modified, you must cause the modified files to carry
28
- prominent notices stating that you changed the files and the date of
29
- any change.
30
-
31
- Disclaimer
32
-
33
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34
- OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36
- EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39
- OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43
- */
44
-
45
- #include "../complex/complex_internal.h"
46
- #include <errno.h>
47
-
48
- extern long double __sinl_internal (long double);
49
-
50
- __FLT_TYPE
51
- __FLT_ABI(sin) (__FLT_TYPE x)
52
- {
53
- int x_class = fpclassify (x);
54
- if (x_class == FP_NAN)
55
- {
56
- __FLT_RPT_DOMAIN ("sin", x, 0.0, x);
57
- return x;
58
- }
59
- else if (x_class == FP_INFINITE)
60
- {
61
- __FLT_RPT_DOMAIN ("sin", x, 0.0, __FLT_NAN);
62
- return __FLT_NAN;
63
- }
64
- return (__FLT_TYPE) __sinl_internal ((long double) x);
65
- }
@@ -1,46 +0,0 @@
1
- /*
2
- This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
-
4
- Copyright (c) 2009, 2010 by the mingw-w64 project
5
-
6
- See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
-
8
- This license has been certified as open source. It has also been designated
9
- as GPL compatible by the Free Software Foundation (FSF).
10
-
11
- Redistribution and use in source and binary forms, with or without
12
- modification, are permitted provided that the following conditions are met:
13
-
14
- 1. Redistributions in source code must retain the accompanying copyright
15
- notice, this list of conditions, and the following disclaimer.
16
- 2. Redistributions in binary form must reproduce the accompanying
17
- copyright notice, this list of conditions, and the following disclaimer
18
- in the documentation and/or other materials provided with the
19
- distribution.
20
- 3. Names of the copyright holders must not be used to endorse or promote
21
- products derived from this software without prior written permission
22
- from the copyright holders.
23
- 4. The right to distribute this software or to use it for any purpose does
24
- not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25
- the copyright holders. Use of them is covered by separate agreement
26
- with the copyright holders.
27
- 5. If any files are modified, you must cause the modified files to carry
28
- prominent notices stating that you changed the files and the date of
29
- any change.
30
-
31
- Disclaimer
32
-
33
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34
- OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36
- EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39
- OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43
- */
44
-
45
- #define _NEW_COMPLEX_LDOUBLE 1
46
- #include "sin.def.h"
@@ -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);