@xnetx/tinyc-native-aarch64-linux-gnu 0.0.0-stage → 0.1.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 (194) hide show
  1. package/natives/aarch64-linux-gnu/toolchain/aarch64-linux-android/tinyc +0 -0
  2. package/natives/aarch64-linux-gnu/toolchain/aarch64-linux-gnu/tinyc +0 -0
  3. package/natives/aarch64-linux-gnu/toolchain/riscv64-linux-gnu/tinyc +0 -0
  4. package/natives/aarch64-linux-gnu/toolchain/x86_64-linux-android/tinyc +0 -0
  5. package/natives/aarch64-linux-gnu/toolchain/x86_64-linux-gnu/tinyc +0 -0
  6. package/natives/aarch64-linux-gnu/toolchain/x86_64-w64-mingw32/tinyc +0 -0
  7. package/package.json +15 -4
  8. package/packaging-manifest.json +197 -0
  9. package/sysroot/aarch64-linux-android/include/libtcc.h +116 -0
  10. package/sysroot/aarch64-linux-android/include/tinyc_io.h +123 -0
  11. package/sysroot/aarch64-linux-android/lib/tcc/include/float.h +75 -0
  12. package/sysroot/aarch64-linux-android/lib/tcc/include/stdalign.h +16 -0
  13. package/sysroot/aarch64-linux-android/lib/tcc/include/stdarg.h +14 -0
  14. package/sysroot/aarch64-linux-android/lib/tcc/include/stdatomic.h +171 -0
  15. package/sysroot/aarch64-linux-android/lib/tcc/include/stdbool.h +11 -0
  16. package/sysroot/aarch64-linux-android/lib/tcc/include/stddef.h +39 -0
  17. package/sysroot/aarch64-linux-android/lib/tcc/include/stdnoreturn.h +7 -0
  18. package/sysroot/aarch64-linux-android/lib/tcc/include/tccdefs.h +338 -0
  19. package/sysroot/aarch64-linux-android/lib/tcc/include/tcclib.h +82 -0
  20. package/sysroot/aarch64-linux-android/lib/tcc/include/tgmath.h +89 -0
  21. package/sysroot/aarch64-linux-android/lib/tcc/include/varargs.h +12 -0
  22. package/sysroot/aarch64-linux-android/lib/tcc/libtcc1.a +0 -0
  23. package/sysroot/aarch64-linux-android/manifest.json +17 -0
  24. package/sysroot/aarch64-linux-gnu/include/libtcc.h +116 -0
  25. package/sysroot/aarch64-linux-gnu/include/tinyc_io.h +123 -0
  26. package/sysroot/aarch64-linux-gnu/lib/libtcc.a +0 -0
  27. package/sysroot/aarch64-linux-gnu/lib/tcc/bcheck.o +0 -0
  28. package/sysroot/aarch64-linux-gnu/lib/tcc/bcheck_run.o +0 -0
  29. package/sysroot/aarch64-linux-gnu/lib/tcc/bt-exe.o +0 -0
  30. package/sysroot/aarch64-linux-gnu/lib/tcc/bt-log.o +0 -0
  31. package/sysroot/aarch64-linux-gnu/lib/tcc/include/float.h +75 -0
  32. package/sysroot/aarch64-linux-gnu/lib/tcc/include/stdalign.h +16 -0
  33. package/sysroot/aarch64-linux-gnu/lib/tcc/include/stdarg.h +14 -0
  34. package/sysroot/aarch64-linux-gnu/lib/tcc/include/stdatomic.h +171 -0
  35. package/sysroot/aarch64-linux-gnu/lib/tcc/include/stdbool.h +11 -0
  36. package/sysroot/aarch64-linux-gnu/lib/tcc/include/stddef.h +39 -0
  37. package/sysroot/aarch64-linux-gnu/lib/tcc/include/stdnoreturn.h +7 -0
  38. package/sysroot/aarch64-linux-gnu/lib/tcc/include/tccdefs.h +338 -0
  39. package/sysroot/aarch64-linux-gnu/lib/tcc/include/tcclib.h +82 -0
  40. package/sysroot/aarch64-linux-gnu/lib/tcc/include/tgmath.h +89 -0
  41. package/sysroot/aarch64-linux-gnu/lib/tcc/include/varargs.h +12 -0
  42. package/sysroot/aarch64-linux-gnu/lib/tcc/libtcc1.a +0 -0
  43. package/sysroot/aarch64-linux-gnu/lib/tcc/runmain.o +0 -0
  44. package/sysroot/aarch64-linux-gnu/manifest.json +15 -0
  45. package/sysroot/riscv64-linux-gnu/include/libtcc.h +116 -0
  46. package/sysroot/riscv64-linux-gnu/include/tinyc_io.h +123 -0
  47. package/sysroot/riscv64-linux-gnu/lib/tcc/include/float.h +75 -0
  48. package/sysroot/riscv64-linux-gnu/lib/tcc/include/stdalign.h +16 -0
  49. package/sysroot/riscv64-linux-gnu/lib/tcc/include/stdarg.h +14 -0
  50. package/sysroot/riscv64-linux-gnu/lib/tcc/include/stdatomic.h +171 -0
  51. package/sysroot/riscv64-linux-gnu/lib/tcc/include/stdbool.h +11 -0
  52. package/sysroot/riscv64-linux-gnu/lib/tcc/include/stddef.h +39 -0
  53. package/sysroot/riscv64-linux-gnu/lib/tcc/include/stdnoreturn.h +7 -0
  54. package/sysroot/riscv64-linux-gnu/lib/tcc/include/tccdefs.h +338 -0
  55. package/sysroot/riscv64-linux-gnu/lib/tcc/include/tcclib.h +82 -0
  56. package/sysroot/riscv64-linux-gnu/lib/tcc/include/tgmath.h +89 -0
  57. package/sysroot/riscv64-linux-gnu/lib/tcc/include/varargs.h +12 -0
  58. package/sysroot/riscv64-linux-gnu/lib/tcc/libtcc1.a +0 -0
  59. package/sysroot/riscv64-linux-gnu/manifest.json +15 -0
  60. package/sysroot/x86_64-linux-android/include/libtcc.h +116 -0
  61. package/sysroot/x86_64-linux-android/include/tinyc_io.h +123 -0
  62. package/sysroot/x86_64-linux-android/lib/tcc/include/float.h +75 -0
  63. package/sysroot/x86_64-linux-android/lib/tcc/include/stdalign.h +16 -0
  64. package/sysroot/x86_64-linux-android/lib/tcc/include/stdarg.h +14 -0
  65. package/sysroot/x86_64-linux-android/lib/tcc/include/stdatomic.h +171 -0
  66. package/sysroot/x86_64-linux-android/lib/tcc/include/stdbool.h +11 -0
  67. package/sysroot/x86_64-linux-android/lib/tcc/include/stddef.h +39 -0
  68. package/sysroot/x86_64-linux-android/lib/tcc/include/stdnoreturn.h +7 -0
  69. package/sysroot/x86_64-linux-android/lib/tcc/include/tccdefs.h +338 -0
  70. package/sysroot/x86_64-linux-android/lib/tcc/include/tcclib.h +82 -0
  71. package/sysroot/x86_64-linux-android/lib/tcc/include/tgmath.h +89 -0
  72. package/sysroot/x86_64-linux-android/lib/tcc/include/varargs.h +12 -0
  73. package/sysroot/x86_64-linux-android/lib/tcc/libtcc1.a +0 -0
  74. package/sysroot/x86_64-linux-android/manifest.json +17 -0
  75. package/sysroot/x86_64-linux-gnu/include/libtcc.h +116 -0
  76. package/sysroot/x86_64-linux-gnu/include/tinyc_io.h +123 -0
  77. package/sysroot/x86_64-linux-gnu/lib/tcc/include/float.h +75 -0
  78. package/sysroot/x86_64-linux-gnu/lib/tcc/include/stdalign.h +16 -0
  79. package/sysroot/x86_64-linux-gnu/lib/tcc/include/stdarg.h +14 -0
  80. package/sysroot/x86_64-linux-gnu/lib/tcc/include/stdatomic.h +171 -0
  81. package/sysroot/x86_64-linux-gnu/lib/tcc/include/stdbool.h +11 -0
  82. package/sysroot/x86_64-linux-gnu/lib/tcc/include/stddef.h +39 -0
  83. package/sysroot/x86_64-linux-gnu/lib/tcc/include/stdnoreturn.h +7 -0
  84. package/sysroot/x86_64-linux-gnu/lib/tcc/include/tccdefs.h +338 -0
  85. package/sysroot/x86_64-linux-gnu/lib/tcc/include/tcclib.h +82 -0
  86. package/sysroot/x86_64-linux-gnu/lib/tcc/include/tgmath.h +89 -0
  87. package/sysroot/x86_64-linux-gnu/lib/tcc/include/varargs.h +12 -0
  88. package/sysroot/x86_64-linux-gnu/lib/tcc/libtcc1.a +0 -0
  89. package/sysroot/x86_64-linux-gnu/manifest.json +15 -0
  90. package/sysroot/x86_64-w64-mingw32/include/libtcc.h +116 -0
  91. package/sysroot/x86_64-w64-mingw32/include/tinyc_io.h +123 -0
  92. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/_mingw.h +171 -0
  93. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/assert.h +62 -0
  94. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/conio.h +409 -0
  95. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/ctype.h +281 -0
  96. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dir.h +31 -0
  97. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/direct.h +68 -0
  98. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dirent.h +135 -0
  99. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dos.h +55 -0
  100. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/errno.h +75 -0
  101. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/excpt.h +123 -0
  102. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fcntl.h +52 -0
  103. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fenv.h +108 -0
  104. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/float.h +75 -0
  105. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/inttypes.h +297 -0
  106. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/io.h +418 -0
  107. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/iso646.h +36 -0
  108. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/limits.h +116 -0
  109. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/locale.h +91 -0
  110. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/malloc.h +181 -0
  111. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/math.h +497 -0
  112. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/mem.h +13 -0
  113. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/memory.h +40 -0
  114. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/process.h +176 -0
  115. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/conio_s.h +42 -0
  116. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/crtdbg_s.h +19 -0
  117. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/io_s.h +33 -0
  118. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/mbstring_s.h +52 -0
  119. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/search_s.h +25 -0
  120. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stdio_s.h +145 -0
  121. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stdlib_s.h +67 -0
  122. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stralign_s.h +30 -0
  123. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/string_s.h +41 -0
  124. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/sys/timeb_s.h +34 -0
  125. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/tchar_s.h +266 -0
  126. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/time_s.h +61 -0
  127. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/wchar_s.h +128 -0
  128. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/setjmp.h +199 -0
  129. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/share.h +28 -0
  130. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/signal.h +63 -0
  131. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdalign.h +16 -0
  132. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdarg.h +14 -0
  133. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdatomic.h +171 -0
  134. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdbool.h +11 -0
  135. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stddef.h +39 -0
  136. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdint.h +212 -0
  137. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdio.h +429 -0
  138. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdlib.h +606 -0
  139. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdnoreturn.h +7 -0
  140. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/string.h +164 -0
  141. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/fcntl.h +13 -0
  142. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/file.h +14 -0
  143. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/locking.h +30 -0
  144. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/stat.h +290 -0
  145. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/time.h +69 -0
  146. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/timeb.h +133 -0
  147. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/types.h +123 -0
  148. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/unistd.h +14 -0
  149. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/utime.h +146 -0
  150. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tcc/tcc_libm.h +618 -0
  151. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tccdefs.h +338 -0
  152. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tcclib.h +82 -0
  153. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tchar.h +1102 -0
  154. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tgmath.h +89 -0
  155. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/time.h +287 -0
  156. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/uchar.h +33 -0
  157. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/unistd.h +1 -0
  158. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/vadefs.h +11 -0
  159. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/values.h +4 -0
  160. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/varargs.h +12 -0
  161. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/wchar.h +873 -0
  162. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/wctype.h +172 -0
  163. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/basetsd.h +149 -0
  164. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/basetyps.h +85 -0
  165. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/guiddef.h +156 -0
  166. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/poppack.h +8 -0
  167. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack1.h +8 -0
  168. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack2.h +8 -0
  169. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack4.h +8 -0
  170. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack8.h +8 -0
  171. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/qos.h +72 -0
  172. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/shellapi.h +59 -0
  173. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winbase.h +2966 -0
  174. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/wincon.h +309 -0
  175. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/windef.h +293 -0
  176. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/windows.h +127 -0
  177. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winerror.h +3166 -0
  178. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/wingdi.h +4080 -0
  179. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winnls.h +778 -0
  180. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winnt.h +5994 -0
  181. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winreg.h +272 -0
  182. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winsock2.h +1474 -0
  183. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winuser.h +5652 -0
  184. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winver.h +160 -0
  185. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/ws2ipdef.h +21 -0
  186. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/ws2tcpip.h +391 -0
  187. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/gdi32.def +337 -0
  188. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/kernel32.def +776 -0
  189. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/libtcc1.a +0 -0
  190. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/msvcrt.def +1320 -0
  191. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/user32.def +658 -0
  192. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/ws2_32.def +198 -0
  193. package/sysroot/x86_64-w64-mingw32/manifest.json +15 -0
  194. package/README.md +0 -3
@@ -0,0 +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 */
@@ -0,0 +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 */
@@ -0,0 +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
@@ -0,0 +1,7 @@
1
+ #ifndef _STDNORETURN_H
2
+ #define _STDNORETURN_H
3
+
4
+ /* ISOC11 noreturn */
5
+ #define noreturn _Noreturn
6
+
7
+ #endif /* _STDNORETURN_H */
@@ -0,0 +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__ */
@@ -0,0 +1,82 @@
1
+ /* Simple libc header for TCC
2
+ *
3
+ * Add any function you want from the libc there. This file is here
4
+ * only for your convenience so that you do not need to put the whole
5
+ * glibc include files on your floppy disk
6
+ */
7
+ #ifndef _TCCLIB_H
8
+ #define _TCCLIB_H
9
+
10
+ #include <stddef.h>
11
+ #include <stdarg.h>
12
+
13
+ /* stdlib.h */
14
+ void *calloc(size_t nmemb, size_t size);
15
+ void *malloc(size_t size);
16
+ void free(void *ptr);
17
+ void *realloc(void *ptr, size_t size);
18
+ int atoi(const char *nptr);
19
+ long int strtol(const char *nptr, char **endptr, int base);
20
+ unsigned long int strtoul(const char *nptr, char **endptr, int base);
21
+ void exit(int);
22
+ void *alloca(size_t);
23
+
24
+ /* stdio.h */
25
+ typedef struct __FILE FILE;
26
+ #define EOF (-1)
27
+ extern FILE *stdin;
28
+ extern FILE *stdout;
29
+ extern FILE *stderr;
30
+ FILE *fopen(const char *path, const char *mode);
31
+ FILE *fdopen(int fildes, const char *mode);
32
+ FILE *freopen(const char *path, const char *mode, FILE *stream);
33
+ int fclose(FILE *stream);
34
+ size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
35
+ size_t fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream);
36
+ int fgetc(FILE *stream);
37
+ char *fgets(char *s, int size, FILE *stream);
38
+ int getc(FILE *stream);
39
+ int getchar(void);
40
+ char *gets(char *s);
41
+ int ungetc(int c, FILE *stream);
42
+ int fflush(FILE *stream);
43
+ int puts(const char *s);
44
+ int putchar (int c);
45
+
46
+ int printf(const char *format, ...);
47
+ int fprintf(FILE *stream, const char *format, ...);
48
+ int sprintf(char *str, const char *format, ...);
49
+ int snprintf(char *str, size_t size, const char *format, ...);
50
+ int asprintf(char **strp, const char *format, ...);
51
+ int dprintf(int fd, const char *format, ...);
52
+ int vprintf(const char *format, va_list ap);
53
+ int vfprintf(FILE *stream, const char *format, va_list ap);
54
+ int vsprintf(char *str, const char *format, va_list ap);
55
+ int vsnprintf(char *str, size_t size, const char *format, va_list ap);
56
+ int vasprintf(char **strp, const char *format, va_list ap);
57
+ int vdprintf(int fd, const char *format, va_list ap);
58
+
59
+ void perror(const char *s);
60
+
61
+ /* string.h */
62
+ char *strcat(char *dest, const char *src);
63
+ char *strchr(const char *s, int c);
64
+ char *strrchr(const char *s, int c);
65
+ char *strcpy(char *dest, const char *src);
66
+ void *memcpy(void *dest, const void *src, size_t n);
67
+ void *memmove(void *dest, const void *src, size_t n);
68
+ void *memset(void *s, int c, size_t n);
69
+ char *strdup(const char *s);
70
+ size_t strlen(const char *s);
71
+
72
+ /* dlfcn.h */
73
+ #define RTLD_LAZY 0x001
74
+ #define RTLD_NOW 0x002
75
+ #define RTLD_GLOBAL 0x100
76
+
77
+ void *dlopen(const char *filename, int flag);
78
+ const char *dlerror(void);
79
+ void *dlsym(void *handle, char *symbol);
80
+ int dlclose(void *handle);
81
+
82
+ #endif /* _TCCLIB_H */