@xnetx/tinyc-native-x86_64-w64-mingw32 0.1.3 → 0.3.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 (124) 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/tinyc_io.h +131 -131
  4. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/_mingw.h +171 -171
  5. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/arm_neon.h +3585 -0
  6. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/assert.h +62 -62
  7. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx2intrin.h +93 -0
  8. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512bwintrin.h +128 -0
  9. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512cdintrin.h +31 -0
  10. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512dqintrin.h +123 -0
  11. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512fintrin.h +1075 -0
  12. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512vbmiintrin.h +30 -0
  13. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512vlintrin.h +1633 -0
  14. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512vnniintrin.h +33 -0
  15. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avxintrin.h +675 -0
  16. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/conio.h +409 -409
  17. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/ctype.h +281 -281
  18. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dir.h +31 -31
  19. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/direct.h +68 -68
  20. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dirent.h +135 -135
  21. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dos.h +55 -55
  22. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/emmintrin.h +213 -0
  23. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/errno.h +75 -75
  24. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/excpt.h +123 -123
  25. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/f16cintrin.h +29 -0
  26. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fcntl.h +52 -52
  27. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fenv.h +108 -108
  28. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/float.h +75 -75
  29. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fmaintrin.h +141 -0
  30. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/immintrin.h +21 -0
  31. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/inttypes.h +297 -297
  32. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/io.h +418 -418
  33. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/iso646.h +36 -36
  34. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/limits.h +116 -116
  35. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/locale.h +91 -91
  36. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/malloc.h +181 -181
  37. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/math.h +497 -497
  38. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/mem.h +13 -13
  39. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/memory.h +40 -40
  40. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/process.h +176 -176
  41. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/riscv_vector.h +12334 -0
  42. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/conio_s.h +42 -42
  43. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/crtdbg_s.h +19 -19
  44. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/io_s.h +33 -33
  45. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/mbstring_s.h +52 -52
  46. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/search_s.h +25 -25
  47. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stdio_s.h +145 -145
  48. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stdlib_s.h +67 -67
  49. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stralign_s.h +30 -30
  50. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/string_s.h +41 -41
  51. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/sys/timeb_s.h +34 -34
  52. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/tchar_s.h +266 -266
  53. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/time_s.h +61 -61
  54. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/wchar_s.h +128 -128
  55. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/setjmp.h +199 -199
  56. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/share.h +28 -28
  57. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/signal.h +63 -63
  58. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/smmintrin.h +74 -0
  59. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdalign.h +16 -16
  60. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdarg.h +14 -14
  61. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdatomic.h +171 -171
  62. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdbool.h +11 -11
  63. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stddef.h +39 -39
  64. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdint.h +212 -212
  65. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdio.h +429 -429
  66. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdlib.h +606 -606
  67. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdnoreturn.h +7 -7
  68. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/string.h +164 -164
  69. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/fcntl.h +13 -13
  70. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/file.h +14 -14
  71. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/locking.h +30 -30
  72. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/stat.h +290 -290
  73. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/time.h +69 -69
  74. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/timeb.h +133 -133
  75. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/types.h +123 -123
  76. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/unistd.h +14 -14
  77. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/utime.h +146 -146
  78. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tcc/tcc_libm.h +618 -618
  79. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tccdefs.h +338 -338
  80. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tcclib.h +82 -82
  81. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tchar.h +1102 -1102
  82. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tgmath.h +89 -89
  83. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/time.h +287 -287
  84. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tmmintrin.h +19 -0
  85. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/uchar.h +33 -33
  86. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/unistd.h +1 -1
  87. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/vadefs.h +11 -11
  88. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/values.h +4 -4
  89. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/varargs.h +12 -12
  90. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/wchar.h +873 -873
  91. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/wctype.h +172 -172
  92. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/basetsd.h +149 -149
  93. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/basetyps.h +85 -85
  94. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/guiddef.h +156 -156
  95. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/poppack.h +8 -8
  96. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack1.h +8 -8
  97. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack2.h +8 -8
  98. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack4.h +8 -8
  99. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack8.h +8 -8
  100. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/qos.h +72 -72
  101. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/shellapi.h +59 -59
  102. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winbase.h +2966 -2966
  103. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/wincon.h +309 -309
  104. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/windef.h +293 -293
  105. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/windows.h +127 -127
  106. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winerror.h +3166 -3166
  107. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/wingdi.h +4080 -4080
  108. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winnls.h +778 -778
  109. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winnt.h +5994 -5994
  110. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winreg.h +272 -272
  111. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winsock2.h +1474 -1474
  112. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winuser.h +5652 -5652
  113. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winver.h +160 -160
  114. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/ws2ipdef.h +21 -21
  115. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/ws2tcpip.h +391 -391
  116. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/xmmintrin.h +170 -0
  117. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/gdi32.def +337 -337
  118. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/kernel32.def +776 -776
  119. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/libtcc1.a +0 -0
  120. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/msvcrt.def +1320 -1320
  121. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/runmain.o +0 -0
  122. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/user32.def +658 -658
  123. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/ws2_32.def +198 -198
  124. package/sysroot/x86_64-w64-mingw32/manifest.json +1 -1
@@ -1,338 +1,338 @@
1
- /* tccdefs.h
2
-
3
- Nothing is defined before this file except target machine, target os
4
- and the few things related to option settings in tccpp.c:tcc_predefs().
5
-
6
- This file is either included at runtime as is, or converted and
7
- included as C-strings at compile-time (depending on CONFIG_TCC_PREDEFS).
8
-
9
- Note that line indent matters:
10
-
11
- - in lines starting at column 1, platform macros are replaced by
12
- corresponding TCC target compile-time macros. See conftest.c for
13
- the list of platform macros supported in lines starting at column 1.
14
-
15
- - only lines indented >= 4 are actually included into the executable,
16
- check tccdefs_.h.
17
- */
18
-
19
- #if __SIZEOF_POINTER__ == 4
20
- /* 32bit systems. */
21
- #if defined __OpenBSD__
22
- #define __SIZE_TYPE__ unsigned long
23
- #define __PTRDIFF_TYPE__ long
24
- #else
25
- #define __SIZE_TYPE__ unsigned int
26
- #define __PTRDIFF_TYPE__ int
27
- #endif
28
- #define __ILP32__ 1
29
- #define __INT64_TYPE__ long long
30
- #elif __SIZEOF_LONG__ == 4
31
- /* 64bit Windows. */
32
- #define __SIZE_TYPE__ unsigned long long
33
- #define __PTRDIFF_TYPE__ long long
34
- #define __LLP64__ 1
35
- #define __INT64_TYPE__ long long
36
- #else
37
- /* Other 64bit systems. */
38
- #define __SIZE_TYPE__ unsigned long
39
- #define __PTRDIFF_TYPE__ long
40
- #define __LP64__ 1
41
- # if defined __linux__
42
- #define __INT64_TYPE__ long
43
- # else /* APPLE, BSD */
44
- #define __INT64_TYPE__ long long
45
- # endif
46
- #endif
47
- #define __SIZEOF_INT__ 4
48
- #define __INT_MAX__ 0x7fffffff
49
- #if __SIZEOF_LONG__ == 4
50
- #define __LONG_MAX__ 0x7fffffffL
51
- #else
52
- #define __LONG_MAX__ 0x7fffffffffffffffL
53
- #endif
54
- #define __SIZEOF_LONG_LONG__ 8
55
- #define __LONG_LONG_MAX__ 0x7fffffffffffffffLL
56
- #define __CHAR_BIT__ 8
57
- #define __ORDER_LITTLE_ENDIAN__ 1234
58
- #define __ORDER_BIG_ENDIAN__ 4321
59
- #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
60
- #if defined _WIN32
61
- #define __WCHAR_TYPE__ unsigned short
62
- #define __WINT_TYPE__ unsigned short
63
- #elif defined __linux__
64
- #define __WCHAR_TYPE__ int
65
- #define __WINT_TYPE__ unsigned int
66
- #else
67
- #define __WCHAR_TYPE__ int
68
- #define __WINT_TYPE__ int
69
- #endif
70
-
71
- #if __STDC_VERSION__ >= 201112L
72
- # define __STDC_NO_ATOMICS__ 1
73
- # define __STDC_NO_COMPLEX__ 1
74
- # define __STDC_NO_THREADS__ 1
75
- #if !defined _WIN32
76
- # define __STDC_UTF_16__ 1
77
- # define __STDC_UTF_32__ 1
78
- #endif
79
- #endif
80
-
81
- #if defined _WIN32
82
- #define __declspec(x) __attribute__((x))
83
- #define __cdecl
84
-
85
- #elif defined __FreeBSD__
86
- #define __GNUC__ 9
87
- #define __GNUC_MINOR__ 3
88
- #define __GNUC_PATCHLEVEL__ 0
89
- #define __GNUC_STDC_INLINE__ 1
90
- #define __NO_TLS 1
91
- #define __RUNETYPE_INTERNAL 1
92
- # if __SIZEOF_POINTER__ == 8
93
- #define __SIZEOF_SIZE_T__ 8
94
- #define __SIZEOF_PTRDIFF_T__ 8
95
- #else
96
- #define __SIZEOF_SIZE_T__ 4
97
- #define __SIZEOF_PTRDIFF_T__ 4
98
- # endif
99
-
100
- #elif defined __FreeBSD_kernel__
101
-
102
- #elif defined __NetBSD__
103
- #define __GNUC__ 4
104
- #define __GNUC_MINOR__ 1
105
- #define __GNUC_PATCHLEVEL__ 0
106
- #define _Pragma(x)
107
- #define __ELF__ 1
108
- #if defined __aarch64__
109
- #define _LOCORE /* avoids usage of __asm */
110
- #endif
111
-
112
- #elif defined __OpenBSD__
113
- #define __GNUC__ 4
114
- #define _ANSI_LIBRARY 1
115
-
116
- #elif defined __APPLE__
117
- /* emulate APPLE-GCC to make libc's headerfiles compile: */
118
- #define __GNUC__ 4 /* darwin emits warning on GCC<4 */
119
- #define __APPLE_CC__ 1 /* for <TargetConditionals.h> */
120
- #define __LITTLE_ENDIAN__ 1
121
- #define _DONT_USE_CTYPE_INLINE_ 1
122
- /* avoids usage of GCC/clang specific builtins in libc-headerfiles: */
123
- #define __FINITE_MATH_ONLY__ 1
124
- #define _FORTIFY_SOURCE 0
125
- //#define __has_builtin(x) 0
126
- #define _Float16 short unsigned int /* fake type just for size & alignment (macOS Sequoia) */
127
-
128
- #elif defined __ANDROID__
129
- #define BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD
130
-
131
- #else
132
- /* Linux */
133
-
134
- #endif
135
-
136
- /* Some derived integer types needed to get stdint.h to compile correctly on some platforms */
137
- #ifndef __NetBSD__
138
- #define __UINTPTR_TYPE__ unsigned __PTRDIFF_TYPE__
139
- #define __INTPTR_TYPE__ __PTRDIFF_TYPE__
140
- #endif
141
- #define __INT32_TYPE__ int
142
-
143
- #if !defined _WIN32
144
- /* glibc defines. We do not support __USER_NAME_PREFIX__ */
145
- #define __REDIRECT(name, proto, alias) name proto __asm__ (#alias)
146
- #define __REDIRECT_NTH(name, proto, alias) name proto __asm__ (#alias) __THROW
147
- #define __REDIRECT_NTHNL(name, proto, alias) name proto __asm__ (#alias) __THROWNL
148
- #endif
149
-
150
- /* not implemented */
151
- #define __PRETTY_FUNCTION__ __FUNCTION__
152
- #define __has_builtin(x) 0
153
- #define __has_feature(x) 0
154
- #define __has_attribute(x) 0
155
- /* C23 Keywords */
156
- #define _Nonnull
157
- #define _Nullable
158
- #define _Nullable_result
159
- #define _Null_unspecified
160
-
161
- /* skip __builtin... with -E */
162
- #ifndef __TCC_PP__
163
-
164
- #define __builtin_offsetof(type, field) ((__SIZE_TYPE__)&((type*)0)->field)
165
- #define __builtin_extract_return_addr(x) x
166
- #if !defined __linux__ && !defined _WIN32
167
- /* used by math.h */
168
- #define __builtin_huge_val() 1e500
169
- #define __builtin_huge_valf() 1e50f
170
- #define __builtin_huge_vall() 1e5000L
171
- # if defined __APPLE__
172
- #define __builtin_nanf(ignored_string) (0.0F/0.0F)
173
- /* used by floats.h to implement FLT_ROUNDS C99 macro. 1 == to nearest */
174
- #define __builtin_flt_rounds() 1
175
- /* used by _fd_def.h */
176
- #define __builtin_bzero(p, ignored_size) bzero(p, sizeof(*(p)))
177
- # else
178
- #define __builtin_nanf(ignored_string) (0.0F/0.0F)
179
- # endif
180
- #endif
181
-
182
- /* GCC's __uint128_t appears in some Linux/OSX header files.
183
- Just make it some type with same size and alignment. */
184
- struct __uint128__ { char x[16]; } __attribute((__aligned__(16)));
185
- #define __int128_t struct __uint128__
186
- #define __uint128_t struct __uint128__
187
-
188
- /* __builtin_va_list */
189
- #if defined __x86_64__
190
- #if !defined _WIN32
191
- /* GCC compatible definition of va_list. */
192
- /* This should be in sync with the declaration in our lib/va_list.c */
193
- typedef struct {
194
- unsigned gp_offset, fp_offset;
195
- union {
196
- unsigned overflow_offset;
197
- char *overflow_arg_area;
198
- };
199
- char *reg_save_area;
200
- } __builtin_va_list[1];
201
-
202
- void *__va_arg(__builtin_va_list ap, int arg_type, int size, int align);
203
- #define __builtin_va_start(ap, last) \
204
- (*(ap) = *(__builtin_va_list)((char*)__builtin_frame_address(0) - 24))
205
- #define __builtin_va_arg(ap, t) \
206
- (*(t *)(__va_arg(ap, __builtin_va_arg_types(t), sizeof(t), __alignof__(t))))
207
- #define __builtin_va_copy(dest, src) (*(dest) = *(src))
208
-
209
- #else /* _WIN64 */
210
- typedef char *__builtin_va_list;
211
- #define __builtin_va_arg(ap, t) ((sizeof(t) > 8 || (sizeof(t) & (sizeof(t) - 1))) \
212
- ? **(t **)((ap += 8) - 8) : *(t *)((ap += 8) - 8))
213
- #endif
214
-
215
- #elif defined __arm__
216
- typedef char *__builtin_va_list;
217
- #define _tcc_alignof(type) ((int)&((struct {char c;type x;} *)0)->x)
218
- #define _tcc_align(addr,type) (((unsigned)addr + _tcc_alignof(type) - 1) \
219
- & ~(_tcc_alignof(type) - 1))
220
- #define __builtin_va_start(ap,last) (ap = ((char *)&(last)) + ((sizeof(last)+3)&~3))
221
- #define __builtin_va_arg(ap,type) (ap = (void *) ((_tcc_align(ap,type)+sizeof(type)+3) \
222
- &~3), *(type *)(ap - ((sizeof(type)+3)&~3)))
223
-
224
- #elif defined __aarch64__
225
- #if defined _WIN32
226
- typedef char *__builtin_va_list;
227
- #elif defined __APPLE__
228
- typedef struct {
229
- void *__stack;
230
- } __builtin_va_list;
231
-
232
- #else
233
- typedef struct {
234
- void *__stack, *__gr_top, *__vr_top;
235
- int __gr_offs, __vr_offs;
236
- } __builtin_va_list;
237
-
238
- #endif
239
- #elif defined __riscv
240
- typedef char *__builtin_va_list;
241
- #define __va_reg_size (__riscv_xlen >> 3)
242
- #define _tcc_align(addr,type) (((unsigned long)addr + __alignof__(type) - 1) \
243
- & -(__alignof__(type)))
244
- #define __builtin_va_arg(ap,type) (*(sizeof(type) > (2*__va_reg_size) ? *(type **)((ap += __va_reg_size) - __va_reg_size) : (ap = (va_list)(_tcc_align(ap,type) + (sizeof(type)+__va_reg_size - 1)& -__va_reg_size), (type *)(ap - ((sizeof(type)+ __va_reg_size - 1)& -__va_reg_size)))))
245
-
246
- #else /* __i386__ */
247
- typedef char *__builtin_va_list;
248
- #define __builtin_va_start(ap,last) (ap = ((char *)&(last)) + ((sizeof(last)+3)&~3))
249
- #define __builtin_va_arg(ap,t) (*(t*)((ap+=(sizeof(t)+3)&~3)-((sizeof(t)+3)&~3)))
250
-
251
- #endif
252
- #define __builtin_va_end(ap) (void)(ap)
253
- #ifndef __builtin_va_copy
254
- # define __builtin_va_copy(dest, src) (dest) = (src)
255
- #endif
256
-
257
- /* TCC BBUILTIN AND BOUNDS ALIASES */
258
- #ifdef __leading_underscore
259
- # define __RENAME(X) __asm__("_"X)
260
- #else
261
- # define __RENAME(X) __asm__(X)
262
- #endif
263
-
264
- #ifdef __TCC_BCHECK__
265
- # define __BUILTINBC(ret,name,params) ret __builtin_##name params __RENAME("__bound_"#name);
266
- # define __BOUND(ret,name,params) ret name params __RENAME("__bound_"#name);
267
- #else
268
- # define __BUILTINBC(ret,name,params) ret __builtin_##name params __RENAME(#name);
269
- # define __BOUND(ret,name,params)
270
- #endif
271
- #ifdef _WIN32
272
- #define __BOTH __BOUND
273
- #define __BUILTIN(ret,name,params)
274
- #else
275
- #define __BOTH(ret,name,params) __BUILTINBC(ret,name,params)__BOUND(ret,name,params)
276
- #define __BUILTIN(ret,name,params) ret __builtin_##name params __RENAME(#name);
277
- #endif
278
-
279
- __BOTH(void*, memcpy, (void *, const void*, __SIZE_TYPE__))
280
- __BOTH(void*, memmove, (void *, const void*, __SIZE_TYPE__))
281
- __BOTH(void*, memset, (void *, int, __SIZE_TYPE__))
282
- __BOTH(int, memcmp, (const void *, const void*, __SIZE_TYPE__))
283
- __BOTH(__SIZE_TYPE__, strlen, (const char *))
284
- __BOTH(char*, strcpy, (char *, const char *))
285
- __BOTH(char*, strncpy, (char *, const char*, __SIZE_TYPE__))
286
- __BOTH(int, strcmp, (const char*, const char*))
287
- __BOTH(int, strncmp, (const char*, const char*, __SIZE_TYPE__))
288
- __BOTH(char*, strcat, (char*, const char*))
289
- __BOTH(char*, strncat, (char*, const char*, __SIZE_TYPE__))
290
- __BOTH(char*, strchr, (const char*, int))
291
- __BOTH(char*, strrchr, (const char*, int))
292
- __BOTH(char*, strdup, (const char*))
293
- #if defined __ARM_EABI__
294
- __BOUND(void*,__aeabi_memcpy,(void*,const void*,__SIZE_TYPE__))
295
- __BOUND(void*,__aeabi_memmove,(void*,const void*,__SIZE_TYPE__))
296
- __BOUND(void*,__aeabi_memmove4,(void*,const void*,__SIZE_TYPE__))
297
- __BOUND(void*,__aeabi_memmove8,(void*,const void*,__SIZE_TYPE__))
298
- __BOUND(void*,__aeabi_memset,(void*,int,__SIZE_TYPE__))
299
- #endif
300
-
301
- #if defined __linux__ || defined __APPLE__ // HAVE MALLOC_REDIR
302
- #define __MAYBE_REDIR __BUILTIN
303
- #else
304
- #define __MAYBE_REDIR __BOTH
305
- #endif
306
- __MAYBE_REDIR(void*, malloc, (__SIZE_TYPE__))
307
- __MAYBE_REDIR(void*, realloc, (void *, __SIZE_TYPE__))
308
- __MAYBE_REDIR(void*, calloc, (__SIZE_TYPE__, __SIZE_TYPE__))
309
- __MAYBE_REDIR(void*, memalign, (__SIZE_TYPE__, __SIZE_TYPE__))
310
- __MAYBE_REDIR(void, free, (void*))
311
- __BOTH(void*, alloca, (__SIZE_TYPE__))
312
- void *alloca(__SIZE_TYPE__);
313
- __BUILTIN(void, abort, (void))
314
- __BOUND(void, longjmp, ())
315
- #if !defined _WIN32
316
- __BOUND(void*, mmap, ())
317
- __BOUND(int, munmap, ())
318
- #endif
319
- #undef __BUILTINBC
320
- #undef __BUILTIN
321
- #undef __BOUND
322
- #undef __BOTH
323
- #undef __MAYBE_REDIR
324
- #undef __RENAME
325
-
326
- #define __BUILTIN_EXTERN(name,u) \
327
- int __builtin_##name(u int); \
328
- int __builtin_##name##l(u long); \
329
- int __builtin_##name##ll(u long long);
330
- __BUILTIN_EXTERN(ffs,)
331
- __BUILTIN_EXTERN(clz, unsigned)
332
- __BUILTIN_EXTERN(ctz, unsigned)
333
- __BUILTIN_EXTERN(clrsb,)
334
- __BUILTIN_EXTERN(popcount, unsigned)
335
- __BUILTIN_EXTERN(parity, unsigned)
336
- #undef __BUILTIN_EXTERN
337
-
338
- #endif /* ndef __TCC_PP__ */
1
+ /* tccdefs.h
2
+
3
+ Nothing is defined before this file except target machine, target os
4
+ and the few things related to option settings in tccpp.c:tcc_predefs().
5
+
6
+ This file is either included at runtime as is, or converted and
7
+ included as C-strings at compile-time (depending on CONFIG_TCC_PREDEFS).
8
+
9
+ Note that line indent matters:
10
+
11
+ - in lines starting at column 1, platform macros are replaced by
12
+ corresponding TCC target compile-time macros. See conftest.c for
13
+ the list of platform macros supported in lines starting at column 1.
14
+
15
+ - only lines indented >= 4 are actually included into the executable,
16
+ check tccdefs_.h.
17
+ */
18
+
19
+ #if __SIZEOF_POINTER__ == 4
20
+ /* 32bit systems. */
21
+ #if defined __OpenBSD__
22
+ #define __SIZE_TYPE__ unsigned long
23
+ #define __PTRDIFF_TYPE__ long
24
+ #else
25
+ #define __SIZE_TYPE__ unsigned int
26
+ #define __PTRDIFF_TYPE__ int
27
+ #endif
28
+ #define __ILP32__ 1
29
+ #define __INT64_TYPE__ long long
30
+ #elif __SIZEOF_LONG__ == 4
31
+ /* 64bit Windows. */
32
+ #define __SIZE_TYPE__ unsigned long long
33
+ #define __PTRDIFF_TYPE__ long long
34
+ #define __LLP64__ 1
35
+ #define __INT64_TYPE__ long long
36
+ #else
37
+ /* Other 64bit systems. */
38
+ #define __SIZE_TYPE__ unsigned long
39
+ #define __PTRDIFF_TYPE__ long
40
+ #define __LP64__ 1
41
+ # if defined __linux__
42
+ #define __INT64_TYPE__ long
43
+ # else /* APPLE, BSD */
44
+ #define __INT64_TYPE__ long long
45
+ # endif
46
+ #endif
47
+ #define __SIZEOF_INT__ 4
48
+ #define __INT_MAX__ 0x7fffffff
49
+ #if __SIZEOF_LONG__ == 4
50
+ #define __LONG_MAX__ 0x7fffffffL
51
+ #else
52
+ #define __LONG_MAX__ 0x7fffffffffffffffL
53
+ #endif
54
+ #define __SIZEOF_LONG_LONG__ 8
55
+ #define __LONG_LONG_MAX__ 0x7fffffffffffffffLL
56
+ #define __CHAR_BIT__ 8
57
+ #define __ORDER_LITTLE_ENDIAN__ 1234
58
+ #define __ORDER_BIG_ENDIAN__ 4321
59
+ #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
60
+ #if defined _WIN32
61
+ #define __WCHAR_TYPE__ unsigned short
62
+ #define __WINT_TYPE__ unsigned short
63
+ #elif defined __linux__
64
+ #define __WCHAR_TYPE__ int
65
+ #define __WINT_TYPE__ unsigned int
66
+ #else
67
+ #define __WCHAR_TYPE__ int
68
+ #define __WINT_TYPE__ int
69
+ #endif
70
+
71
+ #if __STDC_VERSION__ >= 201112L
72
+ # define __STDC_NO_ATOMICS__ 1
73
+ # define __STDC_NO_COMPLEX__ 1
74
+ # define __STDC_NO_THREADS__ 1
75
+ #if !defined _WIN32
76
+ # define __STDC_UTF_16__ 1
77
+ # define __STDC_UTF_32__ 1
78
+ #endif
79
+ #endif
80
+
81
+ #if defined _WIN32
82
+ #define __declspec(x) __attribute__((x))
83
+ #define __cdecl
84
+
85
+ #elif defined __FreeBSD__
86
+ #define __GNUC__ 9
87
+ #define __GNUC_MINOR__ 3
88
+ #define __GNUC_PATCHLEVEL__ 0
89
+ #define __GNUC_STDC_INLINE__ 1
90
+ #define __NO_TLS 1
91
+ #define __RUNETYPE_INTERNAL 1
92
+ # if __SIZEOF_POINTER__ == 8
93
+ #define __SIZEOF_SIZE_T__ 8
94
+ #define __SIZEOF_PTRDIFF_T__ 8
95
+ #else
96
+ #define __SIZEOF_SIZE_T__ 4
97
+ #define __SIZEOF_PTRDIFF_T__ 4
98
+ # endif
99
+
100
+ #elif defined __FreeBSD_kernel__
101
+
102
+ #elif defined __NetBSD__
103
+ #define __GNUC__ 4
104
+ #define __GNUC_MINOR__ 1
105
+ #define __GNUC_PATCHLEVEL__ 0
106
+ #define _Pragma(x)
107
+ #define __ELF__ 1
108
+ #if defined __aarch64__
109
+ #define _LOCORE /* avoids usage of __asm */
110
+ #endif
111
+
112
+ #elif defined __OpenBSD__
113
+ #define __GNUC__ 4
114
+ #define _ANSI_LIBRARY 1
115
+
116
+ #elif defined __APPLE__
117
+ /* emulate APPLE-GCC to make libc's headerfiles compile: */
118
+ #define __GNUC__ 4 /* darwin emits warning on GCC<4 */
119
+ #define __APPLE_CC__ 1 /* for <TargetConditionals.h> */
120
+ #define __LITTLE_ENDIAN__ 1
121
+ #define _DONT_USE_CTYPE_INLINE_ 1
122
+ /* avoids usage of GCC/clang specific builtins in libc-headerfiles: */
123
+ #define __FINITE_MATH_ONLY__ 1
124
+ #define _FORTIFY_SOURCE 0
125
+ //#define __has_builtin(x) 0
126
+ #define _Float16 short unsigned int /* fake type just for size & alignment (macOS Sequoia) */
127
+
128
+ #elif defined __ANDROID__
129
+ #define BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD
130
+
131
+ #else
132
+ /* Linux */
133
+
134
+ #endif
135
+
136
+ /* Some derived integer types needed to get stdint.h to compile correctly on some platforms */
137
+ #ifndef __NetBSD__
138
+ #define __UINTPTR_TYPE__ unsigned __PTRDIFF_TYPE__
139
+ #define __INTPTR_TYPE__ __PTRDIFF_TYPE__
140
+ #endif
141
+ #define __INT32_TYPE__ int
142
+
143
+ #if !defined _WIN32
144
+ /* glibc defines. We do not support __USER_NAME_PREFIX__ */
145
+ #define __REDIRECT(name, proto, alias) name proto __asm__ (#alias)
146
+ #define __REDIRECT_NTH(name, proto, alias) name proto __asm__ (#alias) __THROW
147
+ #define __REDIRECT_NTHNL(name, proto, alias) name proto __asm__ (#alias) __THROWNL
148
+ #endif
149
+
150
+ /* not implemented */
151
+ #define __PRETTY_FUNCTION__ __FUNCTION__
152
+ #define __has_builtin(x) 0
153
+ #define __has_feature(x) 0
154
+ #define __has_attribute(x) 0
155
+ /* C23 Keywords */
156
+ #define _Nonnull
157
+ #define _Nullable
158
+ #define _Nullable_result
159
+ #define _Null_unspecified
160
+
161
+ /* skip __builtin... with -E */
162
+ #ifndef __TCC_PP__
163
+
164
+ #define __builtin_offsetof(type, field) ((__SIZE_TYPE__)&((type*)0)->field)
165
+ #define __builtin_extract_return_addr(x) x
166
+ #if !defined __linux__ && !defined _WIN32
167
+ /* used by math.h */
168
+ #define __builtin_huge_val() 1e500
169
+ #define __builtin_huge_valf() 1e50f
170
+ #define __builtin_huge_vall() 1e5000L
171
+ # if defined __APPLE__
172
+ #define __builtin_nanf(ignored_string) (0.0F/0.0F)
173
+ /* used by floats.h to implement FLT_ROUNDS C99 macro. 1 == to nearest */
174
+ #define __builtin_flt_rounds() 1
175
+ /* used by _fd_def.h */
176
+ #define __builtin_bzero(p, ignored_size) bzero(p, sizeof(*(p)))
177
+ # else
178
+ #define __builtin_nanf(ignored_string) (0.0F/0.0F)
179
+ # endif
180
+ #endif
181
+
182
+ /* GCC's __uint128_t appears in some Linux/OSX header files.
183
+ Just make it some type with same size and alignment. */
184
+ struct __uint128__ { char x[16]; } __attribute((__aligned__(16)));
185
+ #define __int128_t struct __uint128__
186
+ #define __uint128_t struct __uint128__
187
+
188
+ /* __builtin_va_list */
189
+ #if defined __x86_64__
190
+ #if !defined _WIN32
191
+ /* GCC compatible definition of va_list. */
192
+ /* This should be in sync with the declaration in our lib/va_list.c */
193
+ typedef struct {
194
+ unsigned gp_offset, fp_offset;
195
+ union {
196
+ unsigned overflow_offset;
197
+ char *overflow_arg_area;
198
+ };
199
+ char *reg_save_area;
200
+ } __builtin_va_list[1];
201
+
202
+ void *__va_arg(__builtin_va_list ap, int arg_type, int size, int align);
203
+ #define __builtin_va_start(ap, last) \
204
+ (*(ap) = *(__builtin_va_list)((char*)__builtin_frame_address(0) - 24))
205
+ #define __builtin_va_arg(ap, t) \
206
+ (*(t *)(__va_arg(ap, __builtin_va_arg_types(t), sizeof(t), __alignof__(t))))
207
+ #define __builtin_va_copy(dest, src) (*(dest) = *(src))
208
+
209
+ #else /* _WIN64 */
210
+ typedef char *__builtin_va_list;
211
+ #define __builtin_va_arg(ap, t) ((sizeof(t) > 8 || (sizeof(t) & (sizeof(t) - 1))) \
212
+ ? **(t **)((ap += 8) - 8) : *(t *)((ap += 8) - 8))
213
+ #endif
214
+
215
+ #elif defined __arm__
216
+ typedef char *__builtin_va_list;
217
+ #define _tcc_alignof(type) ((int)&((struct {char c;type x;} *)0)->x)
218
+ #define _tcc_align(addr,type) (((unsigned)addr + _tcc_alignof(type) - 1) \
219
+ & ~(_tcc_alignof(type) - 1))
220
+ #define __builtin_va_start(ap,last) (ap = ((char *)&(last)) + ((sizeof(last)+3)&~3))
221
+ #define __builtin_va_arg(ap,type) (ap = (void *) ((_tcc_align(ap,type)+sizeof(type)+3) \
222
+ &~3), *(type *)(ap - ((sizeof(type)+3)&~3)))
223
+
224
+ #elif defined __aarch64__
225
+ #if defined _WIN32
226
+ typedef char *__builtin_va_list;
227
+ #elif defined __APPLE__
228
+ typedef struct {
229
+ void *__stack;
230
+ } __builtin_va_list;
231
+
232
+ #else
233
+ typedef struct {
234
+ void *__stack, *__gr_top, *__vr_top;
235
+ int __gr_offs, __vr_offs;
236
+ } __builtin_va_list;
237
+
238
+ #endif
239
+ #elif defined __riscv
240
+ typedef char *__builtin_va_list;
241
+ #define __va_reg_size (__riscv_xlen >> 3)
242
+ #define _tcc_align(addr,type) (((unsigned long)addr + __alignof__(type) - 1) \
243
+ & -(__alignof__(type)))
244
+ #define __builtin_va_arg(ap,type) (*(sizeof(type) > (2*__va_reg_size) ? *(type **)((ap += __va_reg_size) - __va_reg_size) : (ap = (va_list)(_tcc_align(ap,type) + (sizeof(type)+__va_reg_size - 1)& -__va_reg_size), (type *)(ap - ((sizeof(type)+ __va_reg_size - 1)& -__va_reg_size)))))
245
+
246
+ #else /* __i386__ */
247
+ typedef char *__builtin_va_list;
248
+ #define __builtin_va_start(ap,last) (ap = ((char *)&(last)) + ((sizeof(last)+3)&~3))
249
+ #define __builtin_va_arg(ap,t) (*(t*)((ap+=(sizeof(t)+3)&~3)-((sizeof(t)+3)&~3)))
250
+
251
+ #endif
252
+ #define __builtin_va_end(ap) (void)(ap)
253
+ #ifndef __builtin_va_copy
254
+ # define __builtin_va_copy(dest, src) (dest) = (src)
255
+ #endif
256
+
257
+ /* TCC BBUILTIN AND BOUNDS ALIASES */
258
+ #ifdef __leading_underscore
259
+ # define __RENAME(X) __asm__("_"X)
260
+ #else
261
+ # define __RENAME(X) __asm__(X)
262
+ #endif
263
+
264
+ #ifdef __TCC_BCHECK__
265
+ # define __BUILTINBC(ret,name,params) ret __builtin_##name params __RENAME("__bound_"#name);
266
+ # define __BOUND(ret,name,params) ret name params __RENAME("__bound_"#name);
267
+ #else
268
+ # define __BUILTINBC(ret,name,params) ret __builtin_##name params __RENAME(#name);
269
+ # define __BOUND(ret,name,params)
270
+ #endif
271
+ #ifdef _WIN32
272
+ #define __BOTH __BOUND
273
+ #define __BUILTIN(ret,name,params)
274
+ #else
275
+ #define __BOTH(ret,name,params) __BUILTINBC(ret,name,params)__BOUND(ret,name,params)
276
+ #define __BUILTIN(ret,name,params) ret __builtin_##name params __RENAME(#name);
277
+ #endif
278
+
279
+ __BOTH(void*, memcpy, (void *, const void*, __SIZE_TYPE__))
280
+ __BOTH(void*, memmove, (void *, const void*, __SIZE_TYPE__))
281
+ __BOTH(void*, memset, (void *, int, __SIZE_TYPE__))
282
+ __BOTH(int, memcmp, (const void *, const void*, __SIZE_TYPE__))
283
+ __BOTH(__SIZE_TYPE__, strlen, (const char *))
284
+ __BOTH(char*, strcpy, (char *, const char *))
285
+ __BOTH(char*, strncpy, (char *, const char*, __SIZE_TYPE__))
286
+ __BOTH(int, strcmp, (const char*, const char*))
287
+ __BOTH(int, strncmp, (const char*, const char*, __SIZE_TYPE__))
288
+ __BOTH(char*, strcat, (char*, const char*))
289
+ __BOTH(char*, strncat, (char*, const char*, __SIZE_TYPE__))
290
+ __BOTH(char*, strchr, (const char*, int))
291
+ __BOTH(char*, strrchr, (const char*, int))
292
+ __BOTH(char*, strdup, (const char*))
293
+ #if defined __ARM_EABI__
294
+ __BOUND(void*,__aeabi_memcpy,(void*,const void*,__SIZE_TYPE__))
295
+ __BOUND(void*,__aeabi_memmove,(void*,const void*,__SIZE_TYPE__))
296
+ __BOUND(void*,__aeabi_memmove4,(void*,const void*,__SIZE_TYPE__))
297
+ __BOUND(void*,__aeabi_memmove8,(void*,const void*,__SIZE_TYPE__))
298
+ __BOUND(void*,__aeabi_memset,(void*,int,__SIZE_TYPE__))
299
+ #endif
300
+
301
+ #if defined __linux__ || defined __APPLE__ // HAVE MALLOC_REDIR
302
+ #define __MAYBE_REDIR __BUILTIN
303
+ #else
304
+ #define __MAYBE_REDIR __BOTH
305
+ #endif
306
+ __MAYBE_REDIR(void*, malloc, (__SIZE_TYPE__))
307
+ __MAYBE_REDIR(void*, realloc, (void *, __SIZE_TYPE__))
308
+ __MAYBE_REDIR(void*, calloc, (__SIZE_TYPE__, __SIZE_TYPE__))
309
+ __MAYBE_REDIR(void*, memalign, (__SIZE_TYPE__, __SIZE_TYPE__))
310
+ __MAYBE_REDIR(void, free, (void*))
311
+ __BOTH(void*, alloca, (__SIZE_TYPE__))
312
+ void *alloca(__SIZE_TYPE__);
313
+ __BUILTIN(void, abort, (void))
314
+ __BOUND(void, longjmp, ())
315
+ #if !defined _WIN32
316
+ __BOUND(void*, mmap, ())
317
+ __BOUND(int, munmap, ())
318
+ #endif
319
+ #undef __BUILTINBC
320
+ #undef __BUILTIN
321
+ #undef __BOUND
322
+ #undef __BOTH
323
+ #undef __MAYBE_REDIR
324
+ #undef __RENAME
325
+
326
+ #define __BUILTIN_EXTERN(name,u) \
327
+ int __builtin_##name(u int); \
328
+ int __builtin_##name##l(u long); \
329
+ int __builtin_##name##ll(u long long);
330
+ __BUILTIN_EXTERN(ffs,)
331
+ __BUILTIN_EXTERN(clz, unsigned)
332
+ __BUILTIN_EXTERN(ctz, unsigned)
333
+ __BUILTIN_EXTERN(clrsb,)
334
+ __BUILTIN_EXTERN(popcount, unsigned)
335
+ __BUILTIN_EXTERN(parity, unsigned)
336
+ #undef __BUILTIN_EXTERN
337
+
338
+ #endif /* ndef __TCC_PP__ */