@xnetx/tinyc-native-x86_64-w64-mingw32 0.1.2 → 0.2.0

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 (125) hide show
  1. package/natives/x86_64-w64-mingw32/toolchain/x86_64-w64-mingw32/tinyc.exe +0 -0
  2. package/package.json +1 -1
  3. package/sysroot/x86_64-w64-mingw32/include/libtcc.h +125 -116
  4. package/sysroot/x86_64-w64-mingw32/include/tinyc_io.h +131 -123
  5. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/_mingw.h +171 -171
  6. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/arm_neon.h +3585 -0
  7. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/assert.h +62 -62
  8. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx2intrin.h +93 -0
  9. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512bwintrin.h +128 -0
  10. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512cdintrin.h +31 -0
  11. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512dqintrin.h +123 -0
  12. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512fintrin.h +1075 -0
  13. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512vbmiintrin.h +30 -0
  14. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512vlintrin.h +1633 -0
  15. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512vnniintrin.h +33 -0
  16. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avxintrin.h +675 -0
  17. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/conio.h +409 -409
  18. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/ctype.h +281 -281
  19. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dir.h +31 -31
  20. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/direct.h +68 -68
  21. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dirent.h +135 -135
  22. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dos.h +55 -55
  23. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/emmintrin.h +213 -0
  24. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/errno.h +75 -75
  25. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/excpt.h +123 -123
  26. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/f16cintrin.h +29 -0
  27. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fcntl.h +52 -52
  28. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fenv.h +108 -108
  29. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/float.h +75 -75
  30. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fmaintrin.h +141 -0
  31. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/immintrin.h +21 -0
  32. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/inttypes.h +297 -297
  33. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/io.h +418 -418
  34. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/iso646.h +36 -36
  35. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/limits.h +116 -116
  36. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/locale.h +91 -91
  37. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/malloc.h +181 -181
  38. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/math.h +497 -497
  39. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/mem.h +13 -13
  40. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/memory.h +40 -40
  41. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/process.h +176 -176
  42. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/riscv_vector.h +12334 -0
  43. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/conio_s.h +42 -42
  44. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/crtdbg_s.h +19 -19
  45. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/io_s.h +33 -33
  46. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/mbstring_s.h +52 -52
  47. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/search_s.h +25 -25
  48. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stdio_s.h +145 -145
  49. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stdlib_s.h +67 -67
  50. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stralign_s.h +30 -30
  51. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/string_s.h +41 -41
  52. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/sys/timeb_s.h +34 -34
  53. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/tchar_s.h +266 -266
  54. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/time_s.h +61 -61
  55. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/wchar_s.h +128 -128
  56. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/setjmp.h +199 -199
  57. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/share.h +28 -28
  58. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/signal.h +63 -63
  59. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/smmintrin.h +74 -0
  60. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdalign.h +16 -16
  61. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdarg.h +14 -14
  62. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdatomic.h +171 -171
  63. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdbool.h +11 -11
  64. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stddef.h +39 -39
  65. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdint.h +212 -212
  66. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdio.h +429 -429
  67. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdlib.h +606 -606
  68. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdnoreturn.h +7 -7
  69. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/string.h +164 -164
  70. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/fcntl.h +13 -13
  71. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/file.h +14 -14
  72. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/locking.h +30 -30
  73. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/stat.h +290 -290
  74. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/time.h +69 -69
  75. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/timeb.h +133 -133
  76. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/types.h +123 -123
  77. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/unistd.h +14 -14
  78. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/utime.h +146 -146
  79. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tcc/tcc_libm.h +618 -618
  80. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tccdefs.h +338 -338
  81. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tcclib.h +82 -82
  82. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tchar.h +1102 -1102
  83. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tgmath.h +89 -89
  84. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/time.h +287 -287
  85. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tmmintrin.h +19 -0
  86. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/uchar.h +33 -33
  87. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/unistd.h +1 -1
  88. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/vadefs.h +11 -11
  89. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/values.h +4 -4
  90. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/varargs.h +12 -12
  91. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/wchar.h +873 -873
  92. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/wctype.h +172 -172
  93. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/basetsd.h +149 -149
  94. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/basetyps.h +85 -85
  95. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/guiddef.h +156 -156
  96. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/poppack.h +8 -8
  97. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack1.h +8 -8
  98. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack2.h +8 -8
  99. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack4.h +8 -8
  100. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack8.h +8 -8
  101. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/qos.h +72 -72
  102. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/shellapi.h +59 -59
  103. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winbase.h +2966 -2966
  104. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/wincon.h +309 -309
  105. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/windef.h +293 -293
  106. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/windows.h +127 -127
  107. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winerror.h +3166 -3166
  108. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/wingdi.h +4080 -4080
  109. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winnls.h +778 -778
  110. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winnt.h +5994 -5994
  111. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winreg.h +272 -272
  112. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winsock2.h +1474 -1474
  113. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winuser.h +5652 -5652
  114. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winver.h +160 -160
  115. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/ws2ipdef.h +21 -21
  116. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/ws2tcpip.h +391 -391
  117. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/xmmintrin.h +170 -0
  118. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/gdi32.def +337 -337
  119. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/kernel32.def +776 -776
  120. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/libtcc1.a +0 -0
  121. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/msvcrt.def +1320 -1320
  122. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/runmain.o +0 -0
  123. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/user32.def +658 -658
  124. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/ws2_32.def +198 -198
  125. package/sysroot/x86_64-w64-mingw32/manifest.json +1 -1
@@ -1,16 +1,16 @@
1
- #ifndef _STDALIGN_H
2
- #define _STDALIGN_H
3
-
4
- #if __STDC_VERSION__ < 201112L && (defined(__GNUC__) || defined(__TINYC__))
5
- # define _Alignas(t) __attribute__((__aligned__(t)))
6
- # define _Alignof(t) __alignof__(t)
7
- #endif
8
-
9
- #define alignas _Alignas
10
- #define alignof _Alignof
11
-
12
- #define __alignas_is_defined 1
13
- #define __alignof_is_defined 1
14
-
15
- #endif /* _STDALIGN_H */
16
-
1
+ #ifndef _STDALIGN_H
2
+ #define _STDALIGN_H
3
+
4
+ #if __STDC_VERSION__ < 201112L && (defined(__GNUC__) || defined(__TINYC__))
5
+ # define _Alignas(t) __attribute__((__aligned__(t)))
6
+ # define _Alignof(t) __alignof__(t)
7
+ #endif
8
+
9
+ #define alignas _Alignas
10
+ #define alignof _Alignof
11
+
12
+ #define __alignas_is_defined 1
13
+ #define __alignof_is_defined 1
14
+
15
+ #endif /* _STDALIGN_H */
16
+
@@ -1,14 +1,14 @@
1
- #ifndef _STDARG_H
2
- #define _STDARG_H
3
-
4
- typedef __builtin_va_list va_list;
5
- #define va_start __builtin_va_start
6
- #define va_arg __builtin_va_arg
7
- #define va_copy __builtin_va_copy
8
- #define va_end __builtin_va_end
9
-
10
- /* fix a buggy dependency on GCC in libio.h */
11
- typedef va_list __gnuc_va_list;
12
- #define _VA_LIST_DEFINED
13
-
14
- #endif /* _STDARG_H */
1
+ #ifndef _STDARG_H
2
+ #define _STDARG_H
3
+
4
+ typedef __builtin_va_list va_list;
5
+ #define va_start __builtin_va_start
6
+ #define va_arg __builtin_va_arg
7
+ #define va_copy __builtin_va_copy
8
+ #define va_end __builtin_va_end
9
+
10
+ /* fix a buggy dependency on GCC in libio.h */
11
+ typedef va_list __gnuc_va_list;
12
+ #define _VA_LIST_DEFINED
13
+
14
+ #endif /* _STDARG_H */
@@ -1,171 +1,171 @@
1
- /* This file is derived from clang's stdatomic.h */
2
-
3
- /*===---- stdatomic.h - Standard header for atomic types and operations -----===
4
- *
5
- * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6
- * See https://llvm.org/LICENSE.txt for license information.
7
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8
- *
9
- *===-----------------------------------------------------------------------===
10
- */
11
-
12
- #ifndef _STDATOMIC_H
13
- #define _STDATOMIC_H
14
-
15
- #include <stddef.h>
16
- #include <stdint.h>
17
- #include <stdbool.h>
18
-
19
- #define __ATOMIC_RELAXED 0
20
- #define __ATOMIC_CONSUME 1
21
- #define __ATOMIC_ACQUIRE 2
22
- #define __ATOMIC_RELEASE 3
23
- #define __ATOMIC_ACQ_REL 4
24
- #define __ATOMIC_SEQ_CST 5
25
-
26
- /* Memory ordering */
27
- typedef enum {
28
- memory_order_relaxed = __ATOMIC_RELAXED,
29
- memory_order_consume = __ATOMIC_CONSUME,
30
- memory_order_acquire = __ATOMIC_ACQUIRE,
31
- memory_order_release = __ATOMIC_RELEASE,
32
- memory_order_acq_rel = __ATOMIC_ACQ_REL,
33
- memory_order_seq_cst = __ATOMIC_SEQ_CST,
34
- } memory_order;
35
-
36
- /* Atomic typedefs */
37
- typedef _Atomic(_Bool) atomic_bool;
38
- typedef _Atomic(char) atomic_char;
39
- typedef _Atomic(signed char) atomic_schar;
40
- typedef _Atomic(unsigned char) atomic_uchar;
41
- typedef _Atomic(short) atomic_short;
42
- typedef _Atomic(unsigned short) atomic_ushort;
43
- typedef _Atomic(int) atomic_int;
44
- typedef _Atomic(unsigned int) atomic_uint;
45
- typedef _Atomic(long) atomic_long;
46
- typedef _Atomic(unsigned long) atomic_ulong;
47
- typedef _Atomic(long long) atomic_llong;
48
- typedef _Atomic(unsigned long long) atomic_ullong;
49
- typedef _Atomic(uint_least16_t) atomic_char16_t;
50
- typedef _Atomic(uint_least32_t) atomic_char32_t;
51
- typedef _Atomic(wchar_t) atomic_wchar_t;
52
- typedef _Atomic(int_least8_t) atomic_int_least8_t;
53
- typedef _Atomic(uint_least8_t) atomic_uint_least8_t;
54
- typedef _Atomic(int_least16_t) atomic_int_least16_t;
55
- typedef _Atomic(uint_least16_t) atomic_uint_least16_t;
56
- typedef _Atomic(int_least32_t) atomic_int_least32_t;
57
- typedef _Atomic(uint_least32_t) atomic_uint_least32_t;
58
- typedef _Atomic(int_least64_t) atomic_int_least64_t;
59
- typedef _Atomic(uint_least64_t) atomic_uint_least64_t;
60
- typedef _Atomic(int_fast8_t) atomic_int_fast8_t;
61
- typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t;
62
- typedef _Atomic(int_fast16_t) atomic_int_fast16_t;
63
- typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t;
64
- typedef _Atomic(int_fast32_t) atomic_int_fast32_t;
65
- typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t;
66
- typedef _Atomic(int_fast64_t) atomic_int_fast64_t;
67
- typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t;
68
- typedef _Atomic(intptr_t) atomic_intptr_t;
69
- typedef _Atomic(uintptr_t) atomic_uintptr_t;
70
- typedef _Atomic(size_t) atomic_size_t;
71
- typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t;
72
- typedef _Atomic(intmax_t) atomic_intmax_t;
73
- typedef _Atomic(uintmax_t) atomic_uintmax_t;
74
-
75
- /* Atomic flag */
76
- typedef struct {
77
- atomic_bool value;
78
- } atomic_flag;
79
-
80
- #define ATOMIC_FLAG_INIT {0}
81
- #define ATOMIC_VAR_INIT(value) (value)
82
-
83
- /* Generic routines */
84
- #define atomic_init(object, desired) \
85
- atomic_store_explicit(object, desired, __ATOMIC_RELAXED)
86
-
87
- #define __atomic_store_n(ptr, val, order) \
88
- ({ __typeof__ ((void)0, *(ptr)) __val = (val); \
89
- __atomic_store((ptr), &__val, (order)); })
90
- #define atomic_store_explicit(object, desired, order) \
91
- ({ __typeof__ (object) ptr = (object); \
92
- __typeof__ (*ptr) tmp = (desired); \
93
- __atomic_store (ptr, &tmp, (order)); \
94
- })
95
- #define atomic_store(object, desired) \
96
- atomic_store_explicit (object, desired, __ATOMIC_SEQ_CST)
97
-
98
- #define __atomic_load_n(ptr, order) \
99
- ({ typeof(*(ptr)) __val; \
100
- __atomic_load((ptr), &__val, (order)); \
101
- __val; })
102
- #define atomic_load_explicit(object, order) \
103
- ({ __typeof__ (object) ptr = (object); \
104
- __typeof__ ((void)0,*ptr) tmp; \
105
- __atomic_load (ptr, &tmp, (order)); \
106
- tmp; \
107
- })
108
- #define atomic_load(object) atomic_load_explicit (object, __ATOMIC_SEQ_CST)
109
-
110
- #define atomic_exchange_explicit(object, desired, order) \
111
- ({ __typeof__ (object) ptr = (object); \
112
- __typeof__ (*ptr) val = (desired); \
113
- __typeof__ (*ptr) tmp; \
114
- __atomic_exchange (ptr, &val, &tmp, (order)); \
115
- tmp; \
116
- })
117
- #define atomic_exchange(object, desired) \
118
- atomic_exchange_explicit (object, desired, __ATOMIC_SEQ_CST)
119
- #define __atomic_compare_exchange_n(ptr, expected, desired, weak, success, failure) \
120
- ({ typeof(*(ptr)) __desired = (desired); \
121
- __atomic_compare_exchange((ptr), (expected), &__desired, \
122
- (weak), (success), (failure)); })
123
- #define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
124
- ({ __typeof__ (object) ptr = (object); \
125
- __typeof__ (*ptr) tmp = desired; \
126
- __atomic_compare_exchange(ptr, expected, &tmp, 0, success, failure); \
127
- })
128
- #define atomic_compare_exchange_strong(object, expected, desired) \
129
- atomic_compare_exchange_strong_explicit (object, expected, desired, \
130
- __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
131
- #define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
132
- ({ __typeof__ (object) ptr = (object); \
133
- __typeof__ (*ptr) tmp = desired; \
134
- __atomic_compare_exchange(ptr, expected, &tmp, 1, success, failure); \
135
- })
136
- #define atomic_compare_exchange_weak(object, expected, desired) \
137
- atomic_compare_exchange_weak_explicit (object, expected, desired, \
138
- __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
139
-
140
- #define atomic_fetch_add(object, operand) \
141
- __atomic_fetch_add(object, operand, __ATOMIC_SEQ_CST)
142
- #define atomic_fetch_add_explicit __atomic_fetch_add
143
-
144
- #define atomic_fetch_sub(object, operand) \
145
- __atomic_fetch_sub(object, operand, __ATOMIC_SEQ_CST)
146
- #define atomic_fetch_sub_explicit __atomic_fetch_sub
147
-
148
- #define atomic_fetch_or(object, operand) \
149
- __atomic_fetch_or(object, operand, __ATOMIC_SEQ_CST)
150
- #define atomic_fetch_or_explicit __atomic_fetch_or
151
-
152
- #define atomic_fetch_xor(object, operand) \
153
- __atomic_fetch_xor(object, operand, __ATOMIC_SEQ_CST)
154
- #define atomic_fetch_xor_explicit __atomic_fetch_xor
155
-
156
- #define atomic_fetch_and(object, operand) \
157
- __atomic_fetch_and(object, operand, __ATOMIC_SEQ_CST)
158
- #define atomic_fetch_and_explicit __atomic_fetch_and
159
-
160
- extern void atomic_thread_fence (memory_order);
161
- #define __atomic_thread_fence(order) atomic_thread_fence (order)
162
- extern void atomic_signal_fence (memory_order);
163
- #define __atomic_signal_fence(order) atomic_signal_fence(order)
164
- extern bool __atomic_is_lock_free(size_t size, void *ptr);
165
- #define atomic_is_lock_free(OBJ) __atomic_is_lock_free (sizeof (*(OBJ)), (OBJ))
166
-
167
- extern bool atomic_flag_test_and_set(void *object);
168
- extern bool atomic_flag_test_and_set_explicit(void *object, memory_order order);
169
- extern void atomic_flag_clear(void *object);
170
- extern void atomic_flag_clear_explicit(void *object, memory_order order);
171
- #endif /* _STDATOMIC_H */
1
+ /* This file is derived from clang's stdatomic.h */
2
+
3
+ /*===---- stdatomic.h - Standard header for atomic types and operations -----===
4
+ *
5
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6
+ * See https://llvm.org/LICENSE.txt for license information.
7
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8
+ *
9
+ *===-----------------------------------------------------------------------===
10
+ */
11
+
12
+ #ifndef _STDATOMIC_H
13
+ #define _STDATOMIC_H
14
+
15
+ #include <stddef.h>
16
+ #include <stdint.h>
17
+ #include <stdbool.h>
18
+
19
+ #define __ATOMIC_RELAXED 0
20
+ #define __ATOMIC_CONSUME 1
21
+ #define __ATOMIC_ACQUIRE 2
22
+ #define __ATOMIC_RELEASE 3
23
+ #define __ATOMIC_ACQ_REL 4
24
+ #define __ATOMIC_SEQ_CST 5
25
+
26
+ /* Memory ordering */
27
+ typedef enum {
28
+ memory_order_relaxed = __ATOMIC_RELAXED,
29
+ memory_order_consume = __ATOMIC_CONSUME,
30
+ memory_order_acquire = __ATOMIC_ACQUIRE,
31
+ memory_order_release = __ATOMIC_RELEASE,
32
+ memory_order_acq_rel = __ATOMIC_ACQ_REL,
33
+ memory_order_seq_cst = __ATOMIC_SEQ_CST,
34
+ } memory_order;
35
+
36
+ /* Atomic typedefs */
37
+ typedef _Atomic(_Bool) atomic_bool;
38
+ typedef _Atomic(char) atomic_char;
39
+ typedef _Atomic(signed char) atomic_schar;
40
+ typedef _Atomic(unsigned char) atomic_uchar;
41
+ typedef _Atomic(short) atomic_short;
42
+ typedef _Atomic(unsigned short) atomic_ushort;
43
+ typedef _Atomic(int) atomic_int;
44
+ typedef _Atomic(unsigned int) atomic_uint;
45
+ typedef _Atomic(long) atomic_long;
46
+ typedef _Atomic(unsigned long) atomic_ulong;
47
+ typedef _Atomic(long long) atomic_llong;
48
+ typedef _Atomic(unsigned long long) atomic_ullong;
49
+ typedef _Atomic(uint_least16_t) atomic_char16_t;
50
+ typedef _Atomic(uint_least32_t) atomic_char32_t;
51
+ typedef _Atomic(wchar_t) atomic_wchar_t;
52
+ typedef _Atomic(int_least8_t) atomic_int_least8_t;
53
+ typedef _Atomic(uint_least8_t) atomic_uint_least8_t;
54
+ typedef _Atomic(int_least16_t) atomic_int_least16_t;
55
+ typedef _Atomic(uint_least16_t) atomic_uint_least16_t;
56
+ typedef _Atomic(int_least32_t) atomic_int_least32_t;
57
+ typedef _Atomic(uint_least32_t) atomic_uint_least32_t;
58
+ typedef _Atomic(int_least64_t) atomic_int_least64_t;
59
+ typedef _Atomic(uint_least64_t) atomic_uint_least64_t;
60
+ typedef _Atomic(int_fast8_t) atomic_int_fast8_t;
61
+ typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t;
62
+ typedef _Atomic(int_fast16_t) atomic_int_fast16_t;
63
+ typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t;
64
+ typedef _Atomic(int_fast32_t) atomic_int_fast32_t;
65
+ typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t;
66
+ typedef _Atomic(int_fast64_t) atomic_int_fast64_t;
67
+ typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t;
68
+ typedef _Atomic(intptr_t) atomic_intptr_t;
69
+ typedef _Atomic(uintptr_t) atomic_uintptr_t;
70
+ typedef _Atomic(size_t) atomic_size_t;
71
+ typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t;
72
+ typedef _Atomic(intmax_t) atomic_intmax_t;
73
+ typedef _Atomic(uintmax_t) atomic_uintmax_t;
74
+
75
+ /* Atomic flag */
76
+ typedef struct {
77
+ atomic_bool value;
78
+ } atomic_flag;
79
+
80
+ #define ATOMIC_FLAG_INIT {0}
81
+ #define ATOMIC_VAR_INIT(value) (value)
82
+
83
+ /* Generic routines */
84
+ #define atomic_init(object, desired) \
85
+ atomic_store_explicit(object, desired, __ATOMIC_RELAXED)
86
+
87
+ #define __atomic_store_n(ptr, val, order) \
88
+ ({ __typeof__ ((void)0, *(ptr)) __val = (val); \
89
+ __atomic_store((ptr), &__val, (order)); })
90
+ #define atomic_store_explicit(object, desired, order) \
91
+ ({ __typeof__ (object) ptr = (object); \
92
+ __typeof__ (*ptr) tmp = (desired); \
93
+ __atomic_store (ptr, &tmp, (order)); \
94
+ })
95
+ #define atomic_store(object, desired) \
96
+ atomic_store_explicit (object, desired, __ATOMIC_SEQ_CST)
97
+
98
+ #define __atomic_load_n(ptr, order) \
99
+ ({ typeof(*(ptr)) __val; \
100
+ __atomic_load((ptr), &__val, (order)); \
101
+ __val; })
102
+ #define atomic_load_explicit(object, order) \
103
+ ({ __typeof__ (object) ptr = (object); \
104
+ __typeof__ ((void)0,*ptr) tmp; \
105
+ __atomic_load (ptr, &tmp, (order)); \
106
+ tmp; \
107
+ })
108
+ #define atomic_load(object) atomic_load_explicit (object, __ATOMIC_SEQ_CST)
109
+
110
+ #define atomic_exchange_explicit(object, desired, order) \
111
+ ({ __typeof__ (object) ptr = (object); \
112
+ __typeof__ (*ptr) val = (desired); \
113
+ __typeof__ (*ptr) tmp; \
114
+ __atomic_exchange (ptr, &val, &tmp, (order)); \
115
+ tmp; \
116
+ })
117
+ #define atomic_exchange(object, desired) \
118
+ atomic_exchange_explicit (object, desired, __ATOMIC_SEQ_CST)
119
+ #define __atomic_compare_exchange_n(ptr, expected, desired, weak, success, failure) \
120
+ ({ typeof(*(ptr)) __desired = (desired); \
121
+ __atomic_compare_exchange((ptr), (expected), &__desired, \
122
+ (weak), (success), (failure)); })
123
+ #define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
124
+ ({ __typeof__ (object) ptr = (object); \
125
+ __typeof__ (*ptr) tmp = desired; \
126
+ __atomic_compare_exchange(ptr, expected, &tmp, 0, success, failure); \
127
+ })
128
+ #define atomic_compare_exchange_strong(object, expected, desired) \
129
+ atomic_compare_exchange_strong_explicit (object, expected, desired, \
130
+ __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
131
+ #define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
132
+ ({ __typeof__ (object) ptr = (object); \
133
+ __typeof__ (*ptr) tmp = desired; \
134
+ __atomic_compare_exchange(ptr, expected, &tmp, 1, success, failure); \
135
+ })
136
+ #define atomic_compare_exchange_weak(object, expected, desired) \
137
+ atomic_compare_exchange_weak_explicit (object, expected, desired, \
138
+ __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
139
+
140
+ #define atomic_fetch_add(object, operand) \
141
+ __atomic_fetch_add(object, operand, __ATOMIC_SEQ_CST)
142
+ #define atomic_fetch_add_explicit __atomic_fetch_add
143
+
144
+ #define atomic_fetch_sub(object, operand) \
145
+ __atomic_fetch_sub(object, operand, __ATOMIC_SEQ_CST)
146
+ #define atomic_fetch_sub_explicit __atomic_fetch_sub
147
+
148
+ #define atomic_fetch_or(object, operand) \
149
+ __atomic_fetch_or(object, operand, __ATOMIC_SEQ_CST)
150
+ #define atomic_fetch_or_explicit __atomic_fetch_or
151
+
152
+ #define atomic_fetch_xor(object, operand) \
153
+ __atomic_fetch_xor(object, operand, __ATOMIC_SEQ_CST)
154
+ #define atomic_fetch_xor_explicit __atomic_fetch_xor
155
+
156
+ #define atomic_fetch_and(object, operand) \
157
+ __atomic_fetch_and(object, operand, __ATOMIC_SEQ_CST)
158
+ #define atomic_fetch_and_explicit __atomic_fetch_and
159
+
160
+ extern void atomic_thread_fence (memory_order);
161
+ #define __atomic_thread_fence(order) atomic_thread_fence (order)
162
+ extern void atomic_signal_fence (memory_order);
163
+ #define __atomic_signal_fence(order) atomic_signal_fence(order)
164
+ extern bool __atomic_is_lock_free(size_t size, void *ptr);
165
+ #define atomic_is_lock_free(OBJ) __atomic_is_lock_free (sizeof (*(OBJ)), (OBJ))
166
+
167
+ extern bool atomic_flag_test_and_set(void *object);
168
+ extern bool atomic_flag_test_and_set_explicit(void *object, memory_order order);
169
+ extern void atomic_flag_clear(void *object);
170
+ extern void atomic_flag_clear_explicit(void *object, memory_order order);
171
+ #endif /* _STDATOMIC_H */
@@ -1,11 +1,11 @@
1
- #ifndef _STDBOOL_H
2
- #define _STDBOOL_H
3
-
4
- /* ISOC99 boolean */
5
-
6
- #define bool _Bool
7
- #define true 1
8
- #define false 0
9
- #define __bool_true_false_are_defined 1
10
-
11
- #endif /* _STDBOOL_H */
1
+ #ifndef _STDBOOL_H
2
+ #define _STDBOOL_H
3
+
4
+ /* ISOC99 boolean */
5
+
6
+ #define bool _Bool
7
+ #define true 1
8
+ #define false 0
9
+ #define __bool_true_false_are_defined 1
10
+
11
+ #endif /* _STDBOOL_H */
@@ -1,39 +1,39 @@
1
- #ifndef _STDDEF_H
2
- #define _STDDEF_H
3
-
4
- typedef __SIZE_TYPE__ size_t;
5
- typedef __PTRDIFF_TYPE__ ssize_t;
6
- typedef __WCHAR_TYPE__ wchar_t;
7
- typedef __PTRDIFF_TYPE__ ptrdiff_t;
8
- typedef __PTRDIFF_TYPE__ intptr_t;
9
- typedef __SIZE_TYPE__ uintptr_t;
10
-
11
- #if __STDC_VERSION__ >= 201112L
12
- typedef union { long long __ll; long double __ld; } max_align_t;
13
- #endif
14
-
15
- #ifndef NULL
16
- #define NULL ((void*)0)
17
- #endif
18
-
19
- #undef offsetof
20
- #define offsetof(type, field) __builtin_offsetof(type, field)
21
-
22
- void *alloca(size_t size);
23
-
24
- #endif
25
-
26
- /* Older glibc require a wint_t from <stddef.h> (when requested
27
- by __need_wint_t, as otherwise stddef.h isn't allowed to
28
- define this type). Note that this must be outside the normal
29
- _STDDEF_H guard, so that it works even when we've included the file
30
- already (without requiring wint_t). Some other libs define _WINT_T
31
- if they've already provided that type, so we can use that as guard.
32
- TCC defines __WINT_TYPE__ for us. */
33
- #if defined (__need_wint_t)
34
- #ifndef _WINT_T
35
- #define _WINT_T
36
- typedef __WINT_TYPE__ wint_t;
37
- #endif
38
- #undef __need_wint_t
39
- #endif
1
+ #ifndef _STDDEF_H
2
+ #define _STDDEF_H
3
+
4
+ typedef __SIZE_TYPE__ size_t;
5
+ typedef __PTRDIFF_TYPE__ ssize_t;
6
+ typedef __WCHAR_TYPE__ wchar_t;
7
+ typedef __PTRDIFF_TYPE__ ptrdiff_t;
8
+ typedef __PTRDIFF_TYPE__ intptr_t;
9
+ typedef __SIZE_TYPE__ uintptr_t;
10
+
11
+ #if __STDC_VERSION__ >= 201112L
12
+ typedef union { long long __ll; long double __ld; } max_align_t;
13
+ #endif
14
+
15
+ #ifndef NULL
16
+ #define NULL ((void*)0)
17
+ #endif
18
+
19
+ #undef offsetof
20
+ #define offsetof(type, field) __builtin_offsetof(type, field)
21
+
22
+ void *alloca(size_t size);
23
+
24
+ #endif
25
+
26
+ /* Older glibc require a wint_t from <stddef.h> (when requested
27
+ by __need_wint_t, as otherwise stddef.h isn't allowed to
28
+ define this type). Note that this must be outside the normal
29
+ _STDDEF_H guard, so that it works even when we've included the file
30
+ already (without requiring wint_t). Some other libs define _WINT_T
31
+ if they've already provided that type, so we can use that as guard.
32
+ TCC defines __WINT_TYPE__ for us. */
33
+ #if defined (__need_wint_t)
34
+ #ifndef _WINT_T
35
+ #define _WINT_T
36
+ typedef __WINT_TYPE__ wint_t;
37
+ #endif
38
+ #undef __need_wint_t
39
+ #endif