@xnetx/tinyc-native-x86_64-linux-gnu 0.0.0-stage → 0.1.1

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 (201) hide show
  1. package/README.md +50 -2
  2. package/README.zh-CN.md +36 -0
  3. package/natives/x86_64-linux-gnu/toolchain/aarch64-linux-android/tinyc +0 -0
  4. package/natives/x86_64-linux-gnu/toolchain/aarch64-linux-gnu/tinyc +0 -0
  5. package/natives/x86_64-linux-gnu/toolchain/riscv64-linux-gnu/tinyc +0 -0
  6. package/natives/x86_64-linux-gnu/toolchain/x86_64-linux-android/tinyc +0 -0
  7. package/natives/x86_64-linux-gnu/toolchain/x86_64-linux-gnu/tinyc +0 -0
  8. package/natives/x86_64-linux-gnu/toolchain/x86_64-w64-mingw32/tinyc +0 -0
  9. package/package.json +17 -4
  10. package/packaging-manifest.json +197 -0
  11. package/sysroot/aarch64-linux-android/include/libtcc.h +116 -0
  12. package/sysroot/aarch64-linux-android/include/tinyc_io.h +123 -0
  13. package/sysroot/aarch64-linux-android/lib/tcc/include/float.h +75 -0
  14. package/sysroot/aarch64-linux-android/lib/tcc/include/stdalign.h +16 -0
  15. package/sysroot/aarch64-linux-android/lib/tcc/include/stdarg.h +14 -0
  16. package/sysroot/aarch64-linux-android/lib/tcc/include/stdatomic.h +171 -0
  17. package/sysroot/aarch64-linux-android/lib/tcc/include/stdbool.h +11 -0
  18. package/sysroot/aarch64-linux-android/lib/tcc/include/stddef.h +39 -0
  19. package/sysroot/aarch64-linux-android/lib/tcc/include/stdnoreturn.h +7 -0
  20. package/sysroot/aarch64-linux-android/lib/tcc/include/tccdefs.h +338 -0
  21. package/sysroot/aarch64-linux-android/lib/tcc/include/tcclib.h +82 -0
  22. package/sysroot/aarch64-linux-android/lib/tcc/include/tgmath.h +89 -0
  23. package/sysroot/aarch64-linux-android/lib/tcc/include/varargs.h +12 -0
  24. package/sysroot/aarch64-linux-android/lib/tcc/libtcc1.a +0 -0
  25. package/sysroot/aarch64-linux-android/manifest.json +17 -0
  26. package/sysroot/aarch64-linux-gnu/include/libtcc.h +116 -0
  27. package/sysroot/aarch64-linux-gnu/include/tinyc_io.h +123 -0
  28. package/sysroot/aarch64-linux-gnu/lib/tcc/include/float.h +75 -0
  29. package/sysroot/aarch64-linux-gnu/lib/tcc/include/stdalign.h +16 -0
  30. package/sysroot/aarch64-linux-gnu/lib/tcc/include/stdarg.h +14 -0
  31. package/sysroot/aarch64-linux-gnu/lib/tcc/include/stdatomic.h +171 -0
  32. package/sysroot/aarch64-linux-gnu/lib/tcc/include/stdbool.h +11 -0
  33. package/sysroot/aarch64-linux-gnu/lib/tcc/include/stddef.h +39 -0
  34. package/sysroot/aarch64-linux-gnu/lib/tcc/include/stdnoreturn.h +7 -0
  35. package/sysroot/aarch64-linux-gnu/lib/tcc/include/tccdefs.h +338 -0
  36. package/sysroot/aarch64-linux-gnu/lib/tcc/include/tcclib.h +82 -0
  37. package/sysroot/aarch64-linux-gnu/lib/tcc/include/tgmath.h +89 -0
  38. package/sysroot/aarch64-linux-gnu/lib/tcc/include/varargs.h +12 -0
  39. package/sysroot/aarch64-linux-gnu/lib/tcc/libtcc1.a +0 -0
  40. package/sysroot/aarch64-linux-gnu/manifest.json +15 -0
  41. package/sysroot/riscv64-linux-gnu/include/libtcc.h +116 -0
  42. package/sysroot/riscv64-linux-gnu/include/tinyc_io.h +123 -0
  43. package/sysroot/riscv64-linux-gnu/lib/tcc/include/float.h +75 -0
  44. package/sysroot/riscv64-linux-gnu/lib/tcc/include/stdalign.h +16 -0
  45. package/sysroot/riscv64-linux-gnu/lib/tcc/include/stdarg.h +14 -0
  46. package/sysroot/riscv64-linux-gnu/lib/tcc/include/stdatomic.h +171 -0
  47. package/sysroot/riscv64-linux-gnu/lib/tcc/include/stdbool.h +11 -0
  48. package/sysroot/riscv64-linux-gnu/lib/tcc/include/stddef.h +39 -0
  49. package/sysroot/riscv64-linux-gnu/lib/tcc/include/stdnoreturn.h +7 -0
  50. package/sysroot/riscv64-linux-gnu/lib/tcc/include/tccdefs.h +338 -0
  51. package/sysroot/riscv64-linux-gnu/lib/tcc/include/tcclib.h +82 -0
  52. package/sysroot/riscv64-linux-gnu/lib/tcc/include/tgmath.h +89 -0
  53. package/sysroot/riscv64-linux-gnu/lib/tcc/include/varargs.h +12 -0
  54. package/sysroot/riscv64-linux-gnu/lib/tcc/libtcc1.a +0 -0
  55. package/sysroot/riscv64-linux-gnu/manifest.json +15 -0
  56. package/sysroot/x86_64-linux-android/include/libtcc.h +116 -0
  57. package/sysroot/x86_64-linux-android/include/tinyc_io.h +123 -0
  58. package/sysroot/x86_64-linux-android/lib/libtcc.a +0 -0
  59. package/sysroot/x86_64-linux-android/lib/tcc/bcheck.o +0 -0
  60. package/sysroot/x86_64-linux-android/lib/tcc/bcheck_run.o +0 -0
  61. package/sysroot/x86_64-linux-android/lib/tcc/bt-exe.o +0 -0
  62. package/sysroot/x86_64-linux-android/lib/tcc/bt-log.o +0 -0
  63. package/sysroot/x86_64-linux-android/lib/tcc/include/float.h +75 -0
  64. package/sysroot/x86_64-linux-android/lib/tcc/include/stdalign.h +16 -0
  65. package/sysroot/x86_64-linux-android/lib/tcc/include/stdarg.h +14 -0
  66. package/sysroot/x86_64-linux-android/lib/tcc/include/stdatomic.h +171 -0
  67. package/sysroot/x86_64-linux-android/lib/tcc/include/stdbool.h +11 -0
  68. package/sysroot/x86_64-linux-android/lib/tcc/include/stddef.h +39 -0
  69. package/sysroot/x86_64-linux-android/lib/tcc/include/stdnoreturn.h +7 -0
  70. package/sysroot/x86_64-linux-android/lib/tcc/include/tccdefs.h +338 -0
  71. package/sysroot/x86_64-linux-android/lib/tcc/include/tcclib.h +82 -0
  72. package/sysroot/x86_64-linux-android/lib/tcc/include/tgmath.h +89 -0
  73. package/sysroot/x86_64-linux-android/lib/tcc/include/varargs.h +12 -0
  74. package/sysroot/x86_64-linux-android/lib/tcc/libtcc1.a +0 -0
  75. package/sysroot/x86_64-linux-android/lib/tcc/runmain.o +0 -0
  76. package/sysroot/x86_64-linux-android/manifest.json +17 -0
  77. package/sysroot/x86_64-linux-gnu/include/libtcc.h +116 -0
  78. package/sysroot/x86_64-linux-gnu/include/tinyc_io.h +123 -0
  79. package/sysroot/x86_64-linux-gnu/lib/libtcc.a +0 -0
  80. package/sysroot/x86_64-linux-gnu/lib/tcc/bcheck.o +0 -0
  81. package/sysroot/x86_64-linux-gnu/lib/tcc/bcheck_run.o +0 -0
  82. package/sysroot/x86_64-linux-gnu/lib/tcc/bt-exe.o +0 -0
  83. package/sysroot/x86_64-linux-gnu/lib/tcc/bt-log.o +0 -0
  84. package/sysroot/x86_64-linux-gnu/lib/tcc/include/float.h +75 -0
  85. package/sysroot/x86_64-linux-gnu/lib/tcc/include/stdalign.h +16 -0
  86. package/sysroot/x86_64-linux-gnu/lib/tcc/include/stdarg.h +14 -0
  87. package/sysroot/x86_64-linux-gnu/lib/tcc/include/stdatomic.h +171 -0
  88. package/sysroot/x86_64-linux-gnu/lib/tcc/include/stdbool.h +11 -0
  89. package/sysroot/x86_64-linux-gnu/lib/tcc/include/stddef.h +39 -0
  90. package/sysroot/x86_64-linux-gnu/lib/tcc/include/stdnoreturn.h +7 -0
  91. package/sysroot/x86_64-linux-gnu/lib/tcc/include/tccdefs.h +338 -0
  92. package/sysroot/x86_64-linux-gnu/lib/tcc/include/tcclib.h +82 -0
  93. package/sysroot/x86_64-linux-gnu/lib/tcc/include/tgmath.h +89 -0
  94. package/sysroot/x86_64-linux-gnu/lib/tcc/include/varargs.h +12 -0
  95. package/sysroot/x86_64-linux-gnu/lib/tcc/libtcc1.a +0 -0
  96. package/sysroot/x86_64-linux-gnu/lib/tcc/runmain.o +0 -0
  97. package/sysroot/x86_64-linux-gnu/manifest.json +15 -0
  98. package/sysroot/x86_64-w64-mingw32/include/libtcc.h +116 -0
  99. package/sysroot/x86_64-w64-mingw32/include/tinyc_io.h +123 -0
  100. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/_mingw.h +171 -0
  101. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/assert.h +62 -0
  102. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/conio.h +409 -0
  103. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/ctype.h +281 -0
  104. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dir.h +31 -0
  105. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/direct.h +68 -0
  106. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dirent.h +135 -0
  107. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dos.h +55 -0
  108. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/errno.h +75 -0
  109. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/excpt.h +123 -0
  110. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fcntl.h +52 -0
  111. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fenv.h +108 -0
  112. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/float.h +75 -0
  113. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/inttypes.h +297 -0
  114. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/io.h +418 -0
  115. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/iso646.h +36 -0
  116. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/limits.h +116 -0
  117. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/locale.h +91 -0
  118. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/malloc.h +181 -0
  119. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/math.h +497 -0
  120. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/mem.h +13 -0
  121. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/memory.h +40 -0
  122. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/process.h +176 -0
  123. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/conio_s.h +42 -0
  124. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/crtdbg_s.h +19 -0
  125. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/io_s.h +33 -0
  126. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/mbstring_s.h +52 -0
  127. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/search_s.h +25 -0
  128. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stdio_s.h +145 -0
  129. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stdlib_s.h +67 -0
  130. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stralign_s.h +30 -0
  131. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/string_s.h +41 -0
  132. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/sys/timeb_s.h +34 -0
  133. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/tchar_s.h +266 -0
  134. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/time_s.h +61 -0
  135. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/wchar_s.h +128 -0
  136. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/setjmp.h +199 -0
  137. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/share.h +28 -0
  138. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/signal.h +63 -0
  139. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdalign.h +16 -0
  140. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdarg.h +14 -0
  141. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdatomic.h +171 -0
  142. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdbool.h +11 -0
  143. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stddef.h +39 -0
  144. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdint.h +212 -0
  145. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdio.h +429 -0
  146. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdlib.h +606 -0
  147. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdnoreturn.h +7 -0
  148. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/string.h +164 -0
  149. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/fcntl.h +13 -0
  150. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/file.h +14 -0
  151. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/locking.h +30 -0
  152. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/stat.h +290 -0
  153. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/time.h +69 -0
  154. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/timeb.h +133 -0
  155. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/types.h +123 -0
  156. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/unistd.h +14 -0
  157. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/utime.h +146 -0
  158. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tcc/tcc_libm.h +618 -0
  159. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tccdefs.h +338 -0
  160. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tcclib.h +82 -0
  161. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tchar.h +1102 -0
  162. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tgmath.h +89 -0
  163. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/time.h +287 -0
  164. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/uchar.h +33 -0
  165. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/unistd.h +1 -0
  166. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/vadefs.h +11 -0
  167. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/values.h +4 -0
  168. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/varargs.h +12 -0
  169. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/wchar.h +873 -0
  170. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/wctype.h +172 -0
  171. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/basetsd.h +149 -0
  172. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/basetyps.h +85 -0
  173. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/guiddef.h +156 -0
  174. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/poppack.h +8 -0
  175. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack1.h +8 -0
  176. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack2.h +8 -0
  177. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack4.h +8 -0
  178. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack8.h +8 -0
  179. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/qos.h +72 -0
  180. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/shellapi.h +59 -0
  181. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winbase.h +2966 -0
  182. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/wincon.h +309 -0
  183. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/windef.h +293 -0
  184. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/windows.h +127 -0
  185. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winerror.h +3166 -0
  186. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/wingdi.h +4080 -0
  187. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winnls.h +778 -0
  188. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winnt.h +5994 -0
  189. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winreg.h +272 -0
  190. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winsock2.h +1474 -0
  191. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winuser.h +5652 -0
  192. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winver.h +160 -0
  193. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/ws2ipdef.h +21 -0
  194. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/ws2tcpip.h +391 -0
  195. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/gdi32.def +337 -0
  196. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/kernel32.def +776 -0
  197. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/libtcc1.a +0 -0
  198. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/msvcrt.def +1320 -0
  199. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/user32.def +658 -0
  200. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/ws2_32.def +198 -0
  201. package/sysroot/x86_64-w64-mingw32/manifest.json +15 -0
@@ -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 */
@@ -0,0 +1,89 @@
1
+ /*
2
+ * ISO C Standard: 7.22 Type-generic math <tgmath.h>
3
+ */
4
+
5
+ #ifndef _TGMATH_H
6
+ #define _TGMATH_H
7
+
8
+ #include <math.h>
9
+
10
+ #ifndef __cplusplus
11
+ #define __tgmath_real(x, F) \
12
+ _Generic ((x), float: F##f, long double: F##l, default: F)(x)
13
+ #define __tgmath_real_2_1(x, y, F) \
14
+ _Generic ((x), float: F##f, long double: F##l, default: F)(x, y)
15
+ #define __tgmath_real_2(x, y, F) \
16
+ _Generic ((x)+(y), float: F##f, long double: F##l, default: F)(x, y)
17
+ #define __tgmath_real_3_2(x, y, z, F) \
18
+ _Generic ((x)+(y), float: F##f, long double: F##l, default: F)(x, y, z)
19
+ #define __tgmath_real_3(x, y, z, F) \
20
+ _Generic ((x)+(y)+(z), float: F##f, long double: F##l, default: F)(x, y, z)
21
+
22
+ /* Functions defined in both <math.h> and <complex.h> (7.22p4) */
23
+ #define acos(z) __tgmath_real(z, acos)
24
+ #define asin(z) __tgmath_real(z, asin)
25
+ #define atan(z) __tgmath_real(z, atan)
26
+ #define acosh(z) __tgmath_real(z, acosh)
27
+ #define asinh(z) __tgmath_real(z, asinh)
28
+ #define atanh(z) __tgmath_real(z, atanh)
29
+ #define cos(z) __tgmath_real(z, cos)
30
+ #define sin(z) __tgmath_real(z, sin)
31
+ #define tan(z) __tgmath_real(z, tan)
32
+ #define cosh(z) __tgmath_real(z, cosh)
33
+ #define sinh(z) __tgmath_real(z, sinh)
34
+ #define tanh(z) __tgmath_real(z, tanh)
35
+ #define exp(z) __tgmath_real(z, exp)
36
+ #define log(z) __tgmath_real(z, log)
37
+ #define pow(z1,z2) __tgmath_real_2(z1, z2, pow)
38
+ #define sqrt(z) __tgmath_real(z, sqrt)
39
+ #define fabs(z) __tgmath_real(z, fabs)
40
+
41
+ /* Functions defined in <math.h> only (7.22p5) */
42
+ #define atan2(x,y) __tgmath_real_2(x, y, atan2)
43
+ #define cbrt(x) __tgmath_real(x, cbrt)
44
+ #define ceil(x) __tgmath_real(x, ceil)
45
+ #define copysign(x,y) __tgmath_real_2(x, y, copysign)
46
+ #define erf(x) __tgmath_real(x, erf)
47
+ #define erfc(x) __tgmath_real(x, erfc)
48
+ #define exp2(x) __tgmath_real(x, exp2)
49
+ #define expm1(x) __tgmath_real(x, expm1)
50
+ #define fdim(x,y) __tgmath_real_2(x, y, fdim)
51
+ #define floor(x) __tgmath_real(x, floor)
52
+ #define fma(x,y,z) __tgmath_real_3(x, y, z, fma)
53
+ #define fmax(x,y) __tgmath_real_2(x, y, fmax)
54
+ #define fmin(x,y) __tgmath_real_2(x, y, fmin)
55
+ #define fmod(x,y) __tgmath_real_2(x, y, fmod)
56
+ #define frexp(x,y) __tgmath_real_2_1(x, y, frexp)
57
+ #define hypot(x,y) __tgmath_real_2(x, y, hypot)
58
+ #define ilogb(x) __tgmath_real(x, ilogb)
59
+ #define ldexp(x,y) __tgmath_real_2_1(x, y, ldexp)
60
+ #define lgamma(x) __tgmath_real(x, lgamma)
61
+ #define llrint(x) __tgmath_real(x, llrint)
62
+ #define llround(x) __tgmath_real(x, llround)
63
+ #define log10(x) __tgmath_real(x, log10)
64
+ #define log1p(x) __tgmath_real(x, log1p)
65
+ #define log2(x) __tgmath_real(x, log2)
66
+ #define logb(x) __tgmath_real(x, logb)
67
+ #define lrint(x) __tgmath_real(x, lrint)
68
+ #define lround(x) __tgmath_real(x, lround)
69
+ #define nearbyint(x) __tgmath_real(x, nearbyint)
70
+ #define nextafter(x,y) __tgmath_real_2(x, y, nextafter)
71
+ #define nexttoward(x,y) __tgmath_real_2(x, y, nexttoward)
72
+ #define remainder(x,y) __tgmath_real_2(x, y, remainder)
73
+ #define remquo(x,y,z) __tgmath_real_3_2(x, y, z, remquo)
74
+ #define rint(x) __tgmath_real(x, rint)
75
+ #define round(x) __tgmath_real(x, round)
76
+ #define scalbln(x,y) __tgmath_real_2_1(x, y, scalbln)
77
+ #define scalbn(x,y) __tgmath_real_2_1(x, y, scalbn)
78
+ #define tgamma(x) __tgmath_real(x, tgamma)
79
+ #define trunc(x) __tgmath_real(x, trunc)
80
+
81
+ /* Functions defined in <complex.h> only (7.22p6)
82
+ #define carg(z) __tgmath_cplx_only(z, carg)
83
+ #define cimag(z) __tgmath_cplx_only(z, cimag)
84
+ #define conj(z) __tgmath_cplx_only(z, conj)
85
+ #define cproj(z) __tgmath_cplx_only(z, cproj)
86
+ #define creal(z) __tgmath_cplx_only(z, creal)
87
+ */
88
+ #endif /* __cplusplus */
89
+ #endif /* _TGMATH_H */
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file has no copyright assigned and is placed in the Public Domain.
3
+ * This file is part of the w64 mingw-runtime package.
4
+ * No warranty is given; refer to the file DISCLAIMER within this package.
5
+ */
6
+ #ifndef _VARARGS_H
7
+ #define _VARARGS_H
8
+
9
+ #error "TinyCC no longer implements <varargs.h>."
10
+ #error "Revise your code to use <stdarg.h>."
11
+
12
+ #endif
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "tinyc",
3
+ "version": "0.9.28rc",
4
+ "target": "riscv64-linux-gnu",
5
+ "isa": "RV64GC baseline (I/M/A/F/D/C); no Vector extension (RVV) support",
6
+ "outputs": {
7
+ "exe": {"format": "ELF executable", "ext": ""},
8
+ "obj": {"format": "ELF relocatable", "ext": ".o"},
9
+ "shared": {"format": "ELF shared object", "ext": ".so"},
10
+ "ar": {"format": "ar archive", "ext": ".a"}
11
+ },
12
+ "dual_file": "bin/tinyc",
13
+ "toolchain_include": "include",
14
+ "libtcc1": "lib/tcc/libtcc1.a"
15
+ }
@@ -0,0 +1,116 @@
1
+ #ifndef LIBTCC_H
2
+ #define LIBTCC_H
3
+
4
+ #ifndef LIBTCCAPI
5
+ # define LIBTCCAPI
6
+ #endif
7
+
8
+ #ifdef __cplusplus
9
+ extern "C" {
10
+ #endif
11
+
12
+ /*****************************/
13
+ /* set custom allocator for all allocations (optional), NULL for default. */
14
+ typedef void *TCCReallocFunc(void *ptr, unsigned long size);
15
+ LIBTCCAPI void tcc_set_realloc(TCCReallocFunc *my_realloc);
16
+
17
+ /*****************************/
18
+ typedef struct TCCState TCCState;
19
+
20
+ /* create a new TCC compilation context */
21
+ LIBTCCAPI TCCState *tcc_new(void);
22
+
23
+ /* free a TCC compilation context */
24
+ LIBTCCAPI void tcc_delete(TCCState *s);
25
+
26
+ /* set CONFIG_TCCDIR at runtime */
27
+ LIBTCCAPI void tcc_set_lib_path(TCCState *s, const char *path);
28
+
29
+ /* set error/warning callback (optional) */
30
+ typedef void TCCErrorFunc(void *opaque, const char *msg);
31
+ LIBTCCAPI void tcc_set_error_func(TCCState *s, void *error_opaque, TCCErrorFunc *error_func);
32
+
33
+ /* set options as from command line (multiple supported) */
34
+ LIBTCCAPI int tcc_set_options(TCCState *s, const char *str);
35
+
36
+ /*****************************/
37
+ /* preprocessor */
38
+
39
+ /* add include path */
40
+ LIBTCCAPI int tcc_add_include_path(TCCState *s, const char *pathname);
41
+
42
+ /* add in system include path */
43
+ LIBTCCAPI int tcc_add_sysinclude_path(TCCState *s, const char *pathname);
44
+
45
+ /* define preprocessor symbol 'sym'. value can be NULL, sym can be "sym=val" */
46
+ LIBTCCAPI void tcc_define_symbol(TCCState *s, const char *sym, const char *value);
47
+
48
+ /* undefine preprocess symbol 'sym' */
49
+ LIBTCCAPI void tcc_undefine_symbol(TCCState *s, const char *sym);
50
+
51
+ /*****************************/
52
+ /* compiling */
53
+
54
+ /* add a file (C file, dll, object, library, ld script). Return -1 if error. */
55
+ LIBTCCAPI int tcc_add_file(TCCState *s, const char *filename);
56
+
57
+ /* compile a string containing a C source. Return -1 if error. */
58
+ LIBTCCAPI int tcc_compile_string(TCCState *s, const char *buf);
59
+
60
+ /* Tip: to have more specific errors/warnings from tcc_compile_string(),
61
+ you can prefix the string with "#line <num> \"<filename>\"\n" */
62
+
63
+ /*****************************/
64
+ /* linking commands */
65
+
66
+ /* set output type. MUST BE CALLED before any compilation */
67
+ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type);
68
+ #define TCC_OUTPUT_MEMORY 1 /* output will be run in memory */
69
+ #define TCC_OUTPUT_EXE 2 /* executable file */
70
+ #define TCC_OUTPUT_DLL 4 /* dynamic library */
71
+ #define TCC_OUTPUT_OBJ 3 /* object file */
72
+ #define TCC_OUTPUT_PREPROCESS 5 /* only preprocess */
73
+
74
+ /* equivalent to -Lpath option */
75
+ LIBTCCAPI int tcc_add_library_path(TCCState *s, const char *pathname);
76
+
77
+ /* the library name is the same as the argument of the '-l' option */
78
+ LIBTCCAPI int tcc_add_library(TCCState *s, const char *libraryname);
79
+
80
+ /* add a symbol to the compiled program */
81
+ LIBTCCAPI int tcc_add_symbol(TCCState *s, const char *name, const void *val);
82
+
83
+ /* output an executable, library or object file. DO NOT call
84
+ tcc_relocate() before. */
85
+ LIBTCCAPI int tcc_output_file(TCCState *s, const char *filename);
86
+
87
+ /* link and run main() function and return its value. DO NOT call
88
+ tcc_relocate() before. */
89
+ LIBTCCAPI int tcc_run(TCCState *s, int argc, char **argv);
90
+
91
+ /* do all relocations (needed before using tcc_get_symbol()) */
92
+ LIBTCCAPI int tcc_relocate(TCCState *s1);
93
+
94
+ /* return symbol value or NULL if not found */
95
+ LIBTCCAPI void *tcc_get_symbol(TCCState *s, const char *name);
96
+
97
+ /* list all (global) symbols and their values via 'symbol_cb()' */
98
+ LIBTCCAPI void tcc_list_symbols(TCCState *s, void *ctx,
99
+ void (*symbol_cb)(void *ctx, const char *name, const void *val));
100
+
101
+ /* experimental/advanced section (see libtcc_test_mt.c for an example) */
102
+
103
+ /* catch runtime exceptions (optionally limit backtraces at top_func),
104
+ when using tcc_set_options("-bt") and when not using tcc_run() */
105
+ LIBTCCAPI void *_tcc_setjmp(TCCState *s1, void *jmp_buf, void *top_func, void *longjmp);
106
+ #define tcc_setjmp(s1,jb,f) setjmp(_tcc_setjmp(s1, jb, f, longjmp))
107
+
108
+ /* custom error printer for runtime exceptions. Returning 0 stops backtrace */
109
+ typedef int TCCBtFunc(void *udata, void *pc, const char *file, int line, const char* func, const char *msg);
110
+ LIBTCCAPI void tcc_set_backtrace_func(TCCState *s1, void* userdata, TCCBtFunc*);
111
+
112
+ #ifdef __cplusplus
113
+ }
114
+ #endif
115
+
116
+ #endif