tcc 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 (283) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +35 -0
  3. data/README.md +196 -0
  4. data/ext/tcc/extconf.rb +25 -0
  5. data/ext/tcc/tcc-0.9.26.patch +30 -0
  6. data/ext/tcc/tcc-0.9.26/COPYING +504 -0
  7. data/ext/tcc/tcc-0.9.26/Changelog +396 -0
  8. data/ext/tcc/tcc-0.9.26/Makefile +349 -0
  9. data/ext/tcc/tcc-0.9.26/README +101 -0
  10. data/ext/tcc/tcc-0.9.26/TODO +93 -0
  11. data/ext/tcc/tcc-0.9.26/VERSION +1 -0
  12. data/ext/tcc/tcc-0.9.26/arm-gen.c +2005 -0
  13. data/ext/tcc/tcc-0.9.26/c67-gen.c +2560 -0
  14. data/ext/tcc/tcc-0.9.26/coff.h +446 -0
  15. data/ext/tcc/tcc-0.9.26/config.h +8 -0
  16. data/ext/tcc/tcc-0.9.26/config.mak +28 -0
  17. data/ext/tcc/tcc-0.9.26/config.texi +1 -0
  18. data/ext/tcc/tcc-0.9.26/configure +540 -0
  19. data/ext/tcc/tcc-0.9.26/conftest.c +71 -0
  20. data/ext/tcc/tcc-0.9.26/elf.h +1731 -0
  21. data/ext/tcc/tcc-0.9.26/examples/ex1.c +8 -0
  22. data/ext/tcc/tcc-0.9.26/examples/ex2.c +98 -0
  23. data/ext/tcc/tcc-0.9.26/examples/ex3.c +24 -0
  24. data/ext/tcc/tcc-0.9.26/examples/ex4.c +26 -0
  25. data/ext/tcc/tcc-0.9.26/examples/ex5.c +8 -0
  26. data/ext/tcc/tcc-0.9.26/i386-asm.c +1498 -0
  27. data/ext/tcc/tcc-0.9.26/i386-asm.h +473 -0
  28. data/ext/tcc/tcc-0.9.26/i386-gen.c +1096 -0
  29. data/ext/tcc/tcc-0.9.26/i386-tok.h +243 -0
  30. data/ext/tcc/tcc-0.9.26/il-gen.c +667 -0
  31. data/ext/tcc/tcc-0.9.26/il-opcodes.h +251 -0
  32. data/ext/tcc/tcc-0.9.26/include/float.h +57 -0
  33. data/ext/tcc/tcc-0.9.26/include/stdarg.h +41 -0
  34. data/ext/tcc/tcc-0.9.26/include/stdbool.h +10 -0
  35. data/ext/tcc/tcc-0.9.26/include/stddef.h +28 -0
  36. data/ext/tcc/tcc-0.9.26/include/tcclib.h +78 -0
  37. data/ext/tcc/tcc-0.9.26/include/varargs.h +12 -0
  38. data/ext/tcc/tcc-0.9.26/lib/Makefile +102 -0
  39. data/ext/tcc/tcc-0.9.26/lib/alloca86-bt.S +47 -0
  40. data/ext/tcc/tcc-0.9.26/lib/alloca86.S +35 -0
  41. data/ext/tcc/tcc-0.9.26/lib/alloca86_64.S +42 -0
  42. data/ext/tcc/tcc-0.9.26/lib/bcheck.c +875 -0
  43. data/ext/tcc/tcc-0.9.26/lib/libtcc1.c +691 -0
  44. data/ext/tcc/tcc-0.9.26/libtcc.c +1941 -0
  45. data/ext/tcc/tcc-0.9.26/libtcc.h +103 -0
  46. data/ext/tcc/tcc-0.9.26/stab.def +234 -0
  47. data/ext/tcc/tcc-0.9.26/stab.h +17 -0
  48. data/ext/tcc/tcc-0.9.26/tcc-doc.html +2332 -0
  49. data/ext/tcc/tcc-0.9.26/tcc-doc.info +1151 -0
  50. data/ext/tcc/tcc-0.9.26/tcc-doc.texi +1268 -0
  51. data/ext/tcc/tcc-0.9.26/tcc.1 +415 -0
  52. data/ext/tcc/tcc-0.9.26/tcc.c +352 -0
  53. data/ext/tcc/tcc-0.9.26/tcc.h +1379 -0
  54. data/ext/tcc/tcc-0.9.26/tccasm.c +1118 -0
  55. data/ext/tcc/tcc-0.9.26/tcccoff.c +948 -0
  56. data/ext/tcc/tcc-0.9.26/tccelf.c +3129 -0
  57. data/ext/tcc/tcc-0.9.26/tccgen.c +5841 -0
  58. data/ext/tcc/tcc-0.9.26/tccpe.c +1887 -0
  59. data/ext/tcc/tcc-0.9.26/tccpp.c +3128 -0
  60. data/ext/tcc/tcc-0.9.26/tccrun.c +737 -0
  61. data/ext/tcc/tcc-0.9.26/tcctok.h +278 -0
  62. data/ext/tcc/tcc-0.9.26/tests/Makefile +199 -0
  63. data/ext/tcc/tcc-0.9.26/tests/asmtest.S +609 -0
  64. data/ext/tcc/tcc-0.9.26/tests/boundtest.c +233 -0
  65. data/ext/tcc/tcc-0.9.26/tests/gcctestsuite.sh +33 -0
  66. data/ext/tcc/tcc-0.9.26/tests/libtcc_test.c +76 -0
  67. data/ext/tcc/tcc-0.9.26/tests/tcctest.c +2713 -0
  68. data/ext/tcc/tcc-0.9.26/tests/tests2/00_assignment.c +18 -0
  69. data/ext/tcc/tcc-0.9.26/tests/tests2/00_assignment.expect +3 -0
  70. data/ext/tcc/tcc-0.9.26/tests/tests2/01_comment.c +14 -0
  71. data/ext/tcc/tcc-0.9.26/tests/tests2/01_comment.expect +5 -0
  72. data/ext/tcc/tcc-0.9.26/tests/tests2/02_printf.c +18 -0
  73. data/ext/tcc/tcc-0.9.26/tests/tests2/02_printf.expect +15 -0
  74. data/ext/tcc/tcc-0.9.26/tests/tests2/03_struct.c +31 -0
  75. data/ext/tcc/tcc-0.9.26/tests/tests2/03_struct.expect +6 -0
  76. data/ext/tcc/tcc-0.9.26/tests/tests2/04_for.c +15 -0
  77. data/ext/tcc/tcc-0.9.26/tests/tests2/04_for.expect +10 -0
  78. data/ext/tcc/tcc-0.9.26/tests/tests2/05_array.c +21 -0
  79. data/ext/tcc/tcc-0.9.26/tests/tests2/05_array.expect +10 -0
  80. data/ext/tcc/tcc-0.9.26/tests/tests2/06_case.c +29 -0
  81. data/ext/tcc/tcc-0.9.26/tests/tests2/06_case.expect +8 -0
  82. data/ext/tcc/tcc-0.9.26/tests/tests2/07_function.c +30 -0
  83. data/ext/tcc/tcc-0.9.26/tests/tests2/07_function.expect +4 -0
  84. data/ext/tcc/tcc-0.9.26/tests/tests2/08_while.c +24 -0
  85. data/ext/tcc/tcc-0.9.26/tests/tests2/08_while.expect +11 -0
  86. data/ext/tcc/tcc-0.9.26/tests/tests2/09_do_while.c +24 -0
  87. data/ext/tcc/tcc-0.9.26/tests/tests2/09_do_while.expect +11 -0
  88. data/ext/tcc/tcc-0.9.26/tests/tests2/10_pointer.c +40 -0
  89. data/ext/tcc/tcc-0.9.26/tests/tests2/10_pointer.expect +8 -0
  90. data/ext/tcc/tcc-0.9.26/tests/tests2/11_precedence.c +40 -0
  91. data/ext/tcc/tcc-0.9.26/tests/tests2/11_precedence.expect +15 -0
  92. data/ext/tcc/tcc-0.9.26/tests/tests2/12_hashdefine.c +14 -0
  93. data/ext/tcc/tcc-0.9.26/tests/tests2/12_hashdefine.expect +2 -0
  94. data/ext/tcc/tcc-0.9.26/tests/tests2/13_integer_literals.c +20 -0
  95. data/ext/tcc/tcc-0.9.26/tests/tests2/13_integer_literals.expect +5 -0
  96. data/ext/tcc/tcc-0.9.26/tests/tests2/14_if.c +21 -0
  97. data/ext/tcc/tcc-0.9.26/tests/tests2/14_if.expect +2 -0
  98. data/ext/tcc/tcc-0.9.26/tests/tests2/15_recursion.c +21 -0
  99. data/ext/tcc/tcc-0.9.26/tests/tests2/15_recursion.expect +10 -0
  100. data/ext/tcc/tcc-0.9.26/tests/tests2/16_nesting.c +21 -0
  101. data/ext/tcc/tcc-0.9.26/tests/tests2/16_nesting.expect +18 -0
  102. data/ext/tcc/tcc-0.9.26/tests/tests2/17_enum.c +29 -0
  103. data/ext/tcc/tcc-0.9.26/tests/tests2/17_enum.expect +3 -0
  104. data/ext/tcc/tcc-0.9.26/tests/tests2/18_include.c +12 -0
  105. data/ext/tcc/tcc-0.9.26/tests/tests2/18_include.expect +3 -0
  106. data/ext/tcc/tcc-0.9.26/tests/tests2/18_include.h +1 -0
  107. data/ext/tcc/tcc-0.9.26/tests/tests2/19_pointer_arithmetic.c +28 -0
  108. data/ext/tcc/tcc-0.9.26/tests/tests2/19_pointer_arithmetic.expect +3 -0
  109. data/ext/tcc/tcc-0.9.26/tests/tests2/20_pointer_comparison.c +24 -0
  110. data/ext/tcc/tcc-0.9.26/tests/tests2/20_pointer_comparison.expect +6 -0
  111. data/ext/tcc/tcc-0.9.26/tests/tests2/21_char_array.c +33 -0
  112. data/ext/tcc/tcc-0.9.26/tests/tests2/21_char_array.expect +7 -0
  113. data/ext/tcc/tcc-0.9.26/tests/tests2/22_floating_point.c +50 -0
  114. data/ext/tcc/tcc-0.9.26/tests/tests2/22_floating_point.expect +16 -0
  115. data/ext/tcc/tcc-0.9.26/tests/tests2/23_type_coercion.c +54 -0
  116. data/ext/tcc/tcc-0.9.26/tests/tests2/23_type_coercion.expect +12 -0
  117. data/ext/tcc/tcc-0.9.26/tests/tests2/24_math_library.c +28 -0
  118. data/ext/tcc/tcc-0.9.26/tests/tests2/24_math_library.expect +18 -0
  119. data/ext/tcc/tcc-0.9.26/tests/tests2/25_quicksort.c +83 -0
  120. data/ext/tcc/tcc-0.9.26/tests/tests2/25_quicksort.expect +2 -0
  121. data/ext/tcc/tcc-0.9.26/tests/tests2/26_character_constants.c +17 -0
  122. data/ext/tcc/tcc-0.9.26/tests/tests2/26_character_constants.expect +8 -0
  123. data/ext/tcc/tcc-0.9.26/tests/tests2/27_sizeof.c +16 -0
  124. data/ext/tcc/tcc-0.9.26/tests/tests2/27_sizeof.expect +3 -0
  125. data/ext/tcc/tcc-0.9.26/tests/tests2/28_strings.c +46 -0
  126. data/ext/tcc/tcc-0.9.26/tests/tests2/28_strings.expect +19 -0
  127. data/ext/tcc/tcc-0.9.26/tests/tests2/29_array_address.c +13 -0
  128. data/ext/tcc/tcc-0.9.26/tests/tests2/29_array_address.expect +1 -0
  129. data/ext/tcc/tcc-0.9.26/tests/tests2/30_hanoi.c +122 -0
  130. data/ext/tcc/tcc-0.9.26/tests/tests2/30_hanoi.expect +71 -0
  131. data/ext/tcc/tcc-0.9.26/tests/tests2/31_args.c +14 -0
  132. data/ext/tcc/tcc-0.9.26/tests/tests2/31_args.expect +7 -0
  133. data/ext/tcc/tcc-0.9.26/tests/tests2/32_led.c +266 -0
  134. data/ext/tcc/tcc-0.9.26/tests/tests2/32_led.expect +4 -0
  135. data/ext/tcc/tcc-0.9.26/tests/tests2/33_ternary_op.c +15 -0
  136. data/ext/tcc/tcc-0.9.26/tests/tests2/33_ternary_op.expect +10 -0
  137. data/ext/tcc/tcc-0.9.26/tests/tests2/34_array_assignment.c +23 -0
  138. data/ext/tcc/tcc-0.9.26/tests/tests2/34_array_assignment.expect +2 -0
  139. data/ext/tcc/tcc-0.9.26/tests/tests2/35_sizeof.c +14 -0
  140. data/ext/tcc/tcc-0.9.26/tests/tests2/35_sizeof.expect +2 -0
  141. data/ext/tcc/tcc-0.9.26/tests/tests2/36_array_initialisers.c +21 -0
  142. data/ext/tcc/tcc-0.9.26/tests/tests2/36_array_initialisers.expect +20 -0
  143. data/ext/tcc/tcc-0.9.26/tests/tests2/37_sprintf.c +17 -0
  144. data/ext/tcc/tcc-0.9.26/tests/tests2/37_sprintf.expect +20 -0
  145. data/ext/tcc/tcc-0.9.26/tests/tests2/38_multiple_array_index.c +32 -0
  146. data/ext/tcc/tcc-0.9.26/tests/tests2/38_multiple_array_index.expect +4 -0
  147. data/ext/tcc/tcc-0.9.26/tests/tests2/39_typedef.c +31 -0
  148. data/ext/tcc/tcc-0.9.26/tests/tests2/39_typedef.expect +3 -0
  149. data/ext/tcc/tcc-0.9.26/tests/tests2/40_stdio.c +52 -0
  150. data/ext/tcc/tcc-0.9.26/tests/tests2/40_stdio.expect +27 -0
  151. data/ext/tcc/tcc-0.9.26/tests/tests2/41_hashif.c +85 -0
  152. data/ext/tcc/tcc-0.9.26/tests/tests2/41_hashif.expect +6 -0
  153. data/ext/tcc/tcc-0.9.26/tests/tests2/42_function_pointer.c +18 -0
  154. data/ext/tcc/tcc-0.9.26/tests/tests2/42_function_pointer.expect +2 -0
  155. data/ext/tcc/tcc-0.9.26/tests/tests2/43_void_param.c +15 -0
  156. data/ext/tcc/tcc-0.9.26/tests/tests2/43_void_param.expect +1 -0
  157. data/ext/tcc/tcc-0.9.26/tests/tests2/44_scoped_declarations.c +17 -0
  158. data/ext/tcc/tcc-0.9.26/tests/tests2/44_scoped_declarations.expect +1 -0
  159. data/ext/tcc/tcc-0.9.26/tests/tests2/45_empty_for.c +18 -0
  160. data/ext/tcc/tcc-0.9.26/tests/tests2/45_empty_for.expect +10 -0
  161. data/ext/tcc/tcc-0.9.26/tests/tests2/46_grep.c +564 -0
  162. data/ext/tcc/tcc-0.9.26/tests/tests2/47_switch_return.c +24 -0
  163. data/ext/tcc/tcc-0.9.26/tests/tests2/47_switch_return.expect +4 -0
  164. data/ext/tcc/tcc-0.9.26/tests/tests2/48_nested_break.c +26 -0
  165. data/ext/tcc/tcc-0.9.26/tests/tests2/48_nested_break.expect +1 -0
  166. data/ext/tcc/tcc-0.9.26/tests/tests2/49_bracket_evaluation.c +23 -0
  167. data/ext/tcc/tcc-0.9.26/tests/tests2/49_bracket_evaluation.expect +1 -0
  168. data/ext/tcc/tcc-0.9.26/tests/tests2/50_logical_second_arg.c +29 -0
  169. data/ext/tcc/tcc-0.9.26/tests/tests2/50_logical_second_arg.expect +20 -0
  170. data/ext/tcc/tcc-0.9.26/tests/tests2/51_static.c +30 -0
  171. data/ext/tcc/tcc-0.9.26/tests/tests2/51_static.expect +8 -0
  172. data/ext/tcc/tcc-0.9.26/tests/tests2/52_unnamed_enum.c +27 -0
  173. data/ext/tcc/tcc-0.9.26/tests/tests2/52_unnamed_enum.expect +9 -0
  174. data/ext/tcc/tcc-0.9.26/tests/tests2/54_goto.c +56 -0
  175. data/ext/tcc/tcc-0.9.26/tests/tests2/54_goto.expect +8 -0
  176. data/ext/tcc/tcc-0.9.26/tests/tests2/55_lshift_type.c +52 -0
  177. data/ext/tcc/tcc-0.9.26/tests/tests2/55_lshift_type.expect +1 -0
  178. data/ext/tcc/tcc-0.9.26/tests/tests2/LICENSE +37 -0
  179. data/ext/tcc/tcc-0.9.26/tests/tests2/Makefile +98 -0
  180. data/ext/tcc/tcc-0.9.26/texi2pod.pl +427 -0
  181. data/ext/tcc/tcc-0.9.26/win32/build-tcc.bat +60 -0
  182. data/ext/tcc/tcc-0.9.26/win32/examples/dll.c +12 -0
  183. data/ext/tcc/tcc-0.9.26/win32/examples/fib.c +23 -0
  184. data/ext/tcc/tcc-0.9.26/win32/examples/hello_dll.c +19 -0
  185. data/ext/tcc/tcc-0.9.26/win32/examples/hello_win.c +163 -0
  186. data/ext/tcc/tcc-0.9.26/win32/include/_mingw.h +139 -0
  187. data/ext/tcc/tcc-0.9.26/win32/include/assert.h +54 -0
  188. data/ext/tcc/tcc-0.9.26/win32/include/conio.h +409 -0
  189. data/ext/tcc/tcc-0.9.26/win32/include/ctype.h +281 -0
  190. data/ext/tcc/tcc-0.9.26/win32/include/dir.h +31 -0
  191. data/ext/tcc/tcc-0.9.26/win32/include/direct.h +68 -0
  192. data/ext/tcc/tcc-0.9.26/win32/include/dirent.h +135 -0
  193. data/ext/tcc/tcc-0.9.26/win32/include/dos.h +55 -0
  194. data/ext/tcc/tcc-0.9.26/win32/include/errno.h +75 -0
  195. data/ext/tcc/tcc-0.9.26/win32/include/excpt.h +123 -0
  196. data/ext/tcc/tcc-0.9.26/win32/include/fcntl.h +52 -0
  197. data/ext/tcc/tcc-0.9.26/win32/include/fenv.h +108 -0
  198. data/ext/tcc/tcc-0.9.26/win32/include/inttypes.h +297 -0
  199. data/ext/tcc/tcc-0.9.26/win32/include/io.h +418 -0
  200. data/ext/tcc/tcc-0.9.26/win32/include/limits.h +111 -0
  201. data/ext/tcc/tcc-0.9.26/win32/include/locale.h +91 -0
  202. data/ext/tcc/tcc-0.9.26/win32/include/malloc.h +175 -0
  203. data/ext/tcc/tcc-0.9.26/win32/include/math.h +777 -0
  204. data/ext/tcc/tcc-0.9.26/win32/include/mem.h +13 -0
  205. data/ext/tcc/tcc-0.9.26/win32/include/memory.h +40 -0
  206. data/ext/tcc/tcc-0.9.26/win32/include/process.h +176 -0
  207. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/conio_s.h +42 -0
  208. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/crtdbg_s.h +19 -0
  209. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/io_s.h +33 -0
  210. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/mbstring_s.h +52 -0
  211. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/search_s.h +25 -0
  212. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/stdio_s.h +145 -0
  213. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/stdlib_s.h +67 -0
  214. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/stralign_s.h +30 -0
  215. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/string_s.h +41 -0
  216. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/sys/timeb_s.h +34 -0
  217. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/tchar_s.h +266 -0
  218. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/time_s.h +61 -0
  219. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/wchar_s.h +128 -0
  220. data/ext/tcc/tcc-0.9.26/win32/include/setjmp.h +160 -0
  221. data/ext/tcc/tcc-0.9.26/win32/include/share.h +28 -0
  222. data/ext/tcc/tcc-0.9.26/win32/include/signal.h +63 -0
  223. data/ext/tcc/tcc-0.9.26/win32/include/stdint.h +209 -0
  224. data/ext/tcc/tcc-0.9.26/win32/include/stdio.h +429 -0
  225. data/ext/tcc/tcc-0.9.26/win32/include/stdlib.h +580 -0
  226. data/ext/tcc/tcc-0.9.26/win32/include/string.h +164 -0
  227. data/ext/tcc/tcc-0.9.26/win32/include/sys/fcntl.h +13 -0
  228. data/ext/tcc/tcc-0.9.26/win32/include/sys/file.h +14 -0
  229. data/ext/tcc/tcc-0.9.26/win32/include/sys/locking.h +30 -0
  230. data/ext/tcc/tcc-0.9.26/win32/include/sys/stat.h +290 -0
  231. data/ext/tcc/tcc-0.9.26/win32/include/sys/time.h +69 -0
  232. data/ext/tcc/tcc-0.9.26/win32/include/sys/timeb.h +133 -0
  233. data/ext/tcc/tcc-0.9.26/win32/include/sys/types.h +118 -0
  234. data/ext/tcc/tcc-0.9.26/win32/include/sys/unistd.h +14 -0
  235. data/ext/tcc/tcc-0.9.26/win32/include/sys/utime.h +146 -0
  236. data/ext/tcc/tcc-0.9.26/win32/include/tchar.h +1102 -0
  237. data/ext/tcc/tcc-0.9.26/win32/include/time.h +287 -0
  238. data/ext/tcc/tcc-0.9.26/win32/include/vadefs.h +11 -0
  239. data/ext/tcc/tcc-0.9.26/win32/include/values.h +4 -0
  240. data/ext/tcc/tcc-0.9.26/win32/include/wchar.h +871 -0
  241. data/ext/tcc/tcc-0.9.26/win32/include/wctype.h +172 -0
  242. data/ext/tcc/tcc-0.9.26/win32/include/winapi/basetsd.h +149 -0
  243. data/ext/tcc/tcc-0.9.26/win32/include/winapi/basetyps.h +85 -0
  244. data/ext/tcc/tcc-0.9.26/win32/include/winapi/guiddef.h +151 -0
  245. data/ext/tcc/tcc-0.9.26/win32/include/winapi/intrin.h +11 -0
  246. data/ext/tcc/tcc-0.9.26/win32/include/winapi/poppack.h +8 -0
  247. data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack1.h +8 -0
  248. data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack2.h +8 -0
  249. data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack4.h +8 -0
  250. data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack8.h +8 -0
  251. data/ext/tcc/tcc-0.9.26/win32/include/winapi/reason.h +80 -0
  252. data/ext/tcc/tcc-0.9.26/win32/include/winapi/specstrings.h +7 -0
  253. data/ext/tcc/tcc-0.9.26/win32/include/winapi/stralign.h +154 -0
  254. data/ext/tcc/tcc-0.9.26/win32/include/winapi/tvout.h +79 -0
  255. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winbase.h +2951 -0
  256. data/ext/tcc/tcc-0.9.26/win32/include/winapi/wincon.h +301 -0
  257. data/ext/tcc/tcc-0.9.26/win32/include/winapi/windef.h +293 -0
  258. data/ext/tcc/tcc-0.9.26/win32/include/winapi/windows.h +123 -0
  259. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winerror.h +3166 -0
  260. data/ext/tcc/tcc-0.9.26/win32/include/winapi/wingdi.h +4080 -0
  261. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winnetwk.h +476 -0
  262. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winnls.h +765 -0
  263. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winnt.h +5770 -0
  264. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winreg.h +272 -0
  265. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winuser.h +5651 -0
  266. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winver.h +160 -0
  267. data/ext/tcc/tcc-0.9.26/win32/lib/chkstk.S +191 -0
  268. data/ext/tcc/tcc-0.9.26/win32/lib/crt1.c +34 -0
  269. data/ext/tcc/tcc-0.9.26/win32/lib/dllcrt1.c +13 -0
  270. data/ext/tcc/tcc-0.9.26/win32/lib/dllmain.c +9 -0
  271. data/ext/tcc/tcc-0.9.26/win32/lib/gdi32.def +337 -0
  272. data/ext/tcc/tcc-0.9.26/win32/lib/kernel32.def +765 -0
  273. data/ext/tcc/tcc-0.9.26/win32/lib/msvcrt.def +1399 -0
  274. data/ext/tcc/tcc-0.9.26/win32/lib/user32.def +654 -0
  275. data/ext/tcc/tcc-0.9.26/win32/lib/wincrt1.c +64 -0
  276. data/ext/tcc/tcc-0.9.26/win32/tcc-win32.txt +156 -0
  277. data/ext/tcc/tcc-0.9.26/win32/tools/tiny_impdef.c +243 -0
  278. data/ext/tcc/tcc-0.9.26/win32/tools/tiny_libmaker.c +258 -0
  279. data/ext/tcc/tcc-0.9.26/x86_64-asm.h +448 -0
  280. data/ext/tcc/tcc-0.9.26/x86_64-gen.c +1701 -0
  281. data/lib/tcc.rb +291 -0
  282. data/tcc.gemspec +15 -0
  283. metadata +343 -0
@@ -0,0 +1,251 @@
1
+ /*
2
+ * CIL opcode definition
3
+ *
4
+ * Copyright (c) 2002 Fabrice Bellard
5
+ *
6
+ * This program is free software; you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation; either version 2 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program; if not, write to the Free Software
18
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
+ */
20
+ OP(NOP, "nop", 0x00)
21
+ OP(BREAK, "break", 0x01)
22
+ OP(LDARG_0, "ldarg.0", 0x02)
23
+ OP(LDARG_1, "ldarg.1", 0x03)
24
+ OP(LDARG_2, "ldarg.2", 0x04)
25
+ OP(LDARG_3, "ldarg.3", 0x05)
26
+ OP(LDLOC_0, "ldloc.0", 0x06)
27
+ OP(LDLOC_1, "ldloc.1", 0x07)
28
+ OP(LDLOC_2, "ldloc.2", 0x08)
29
+ OP(LDLOC_3, "ldloc.3", 0x09)
30
+ OP(STLOC_0, "stloc.0", 0x0a)
31
+ OP(STLOC_1, "stloc.1", 0x0b)
32
+ OP(STLOC_2, "stloc.2", 0x0c)
33
+ OP(STLOC_3, "stloc.3", 0x0d)
34
+ OP(LDARG_S, "ldarg.s", 0x0e)
35
+ OP(LDARGA_S, "ldarga.s", 0x0f)
36
+ OP(STARG_S, "starg.s", 0x10)
37
+ OP(LDLOC_S, "ldloc.s", 0x11)
38
+ OP(LDLOCA_S, "ldloca.s", 0x12)
39
+ OP(STLOC_S, "stloc.s", 0x13)
40
+ OP(LDNULL, "ldnull", 0x14)
41
+ OP(LDC_I4_M1, "ldc.i4.m1", 0x15)
42
+ OP(LDC_I4_0, "ldc.i4.0", 0x16)
43
+ OP(LDC_I4_1, "ldc.i4.1", 0x17)
44
+ OP(LDC_I4_2, "ldc.i4.2", 0x18)
45
+ OP(LDC_I4_3, "ldc.i4.3", 0x19)
46
+ OP(LDC_I4_4, "ldc.i4.4", 0x1a)
47
+ OP(LDC_I4_5, "ldc.i4.5", 0x1b)
48
+ OP(LDC_I4_6, "ldc.i4.6", 0x1c)
49
+ OP(LDC_I4_7, "ldc.i4.7", 0x1d)
50
+ OP(LDC_I4_8, "ldc.i4.8", 0x1e)
51
+ OP(LDC_I4_S, "ldc.i4.s", 0x1f)
52
+ OP(LDC_I4, "ldc.i4", 0x20)
53
+ OP(LDC_I8, "ldc.i8", 0x21)
54
+ OP(LDC_R4, "ldc.r4", 0x22)
55
+ OP(LDC_R8, "ldc.r8", 0x23)
56
+ OP(LDPTR, "ldptr", 0x24)
57
+ OP(DUP, "dup", 0x25)
58
+ OP(POP, "pop", 0x26)
59
+ OP(JMP, "jmp", 0x27)
60
+ OP(CALL, "call", 0x28)
61
+ OP(CALLI, "calli", 0x29)
62
+ OP(RET, "ret", 0x2a)
63
+ OP(BR_S, "br.s", 0x2b)
64
+ OP(BRFALSE_S, "brfalse.s", 0x2c)
65
+ OP(BRTRUE_S, "brtrue.s", 0x2d)
66
+ OP(BEQ_S, "beq.s", 0x2e)
67
+ OP(BGE_S, "bge.s", 0x2f)
68
+ OP(BGT_S, "bgt.s", 0x30)
69
+ OP(BLE_S, "ble.s", 0x31)
70
+ OP(BLT_S, "blt.s", 0x32)
71
+ OP(BNE_UN_S, "bne.un.s", 0x33)
72
+ OP(BGE_UN_S, "bge.un.s", 0x34)
73
+ OP(BGT_UN_S, "bgt.un.s", 0x35)
74
+ OP(BLE_UN_S, "ble.un.s", 0x36)
75
+ OP(BLT_UN_S, "blt.un.s", 0x37)
76
+ OP(BR, "br", 0x38)
77
+ OP(BRFALSE, "brfalse", 0x39)
78
+ OP(BRTRUE, "brtrue", 0x3a)
79
+ OP(BEQ, "beq", 0x3b)
80
+ OP(BGE, "bge", 0x3c)
81
+ OP(BGT, "bgt", 0x3d)
82
+ OP(BLE, "ble", 0x3e)
83
+ OP(BLT, "blt", 0x3f)
84
+ OP(BNE_UN, "bne.un", 0x40)
85
+ OP(BGE_UN, "bge.un", 0x41)
86
+ OP(BGT_UN, "bgt.un", 0x42)
87
+ OP(BLE_UN, "ble.un", 0x43)
88
+ OP(BLT_UN, "blt.un", 0x44)
89
+ OP(SWITCH, "switch", 0x45)
90
+ OP(LDIND_I1, "ldind.i1", 0x46)
91
+ OP(LDIND_U1, "ldind.u1", 0x47)
92
+ OP(LDIND_I2, "ldind.i2", 0x48)
93
+ OP(LDIND_U2, "ldind.u2", 0x49)
94
+ OP(LDIND_I4, "ldind.i4", 0x4a)
95
+ OP(LDIND_U4, "ldind.u4", 0x4b)
96
+ OP(LDIND_I8, "ldind.i8", 0x4c)
97
+ OP(LDIND_I, "ldind.i", 0x4d)
98
+ OP(LDIND_R4, "ldind.r4", 0x4e)
99
+ OP(LDIND_R8, "ldind.r8", 0x4f)
100
+ OP(LDIND_REF, "ldind.ref", 0x50)
101
+ OP(STIND_REF, "stind.ref", 0x51)
102
+ OP(STIND_I1, "stind.i1", 0x52)
103
+ OP(STIND_I2, "stind.i2", 0x53)
104
+ OP(STIND_I4, "stind.i4", 0x54)
105
+ OP(STIND_I8, "stind.i8", 0x55)
106
+ OP(STIND_R4, "stind.r4", 0x56)
107
+ OP(STIND_R8, "stind.r8", 0x57)
108
+ OP(ADD, "add", 0x58)
109
+ OP(SUB, "sub", 0x59)
110
+ OP(MUL, "mul", 0x5a)
111
+ OP(DIV, "div", 0x5b)
112
+ OP(DIV_UN, "div.un", 0x5c)
113
+ OP(REM, "rem", 0x5d)
114
+ OP(REM_UN, "rem.un", 0x5e)
115
+ OP(AND, "and", 0x5f)
116
+ OP(OR, "or", 0x60)
117
+ OP(XOR, "xor", 0x61)
118
+ OP(SHL, "shl", 0x62)
119
+ OP(SHR, "shr", 0x63)
120
+ OP(SHR_UN, "shr.un", 0x64)
121
+ OP(NEG, "neg", 0x65)
122
+ OP(NOT, "not", 0x66)
123
+ OP(CONV_I1, "conv.i1", 0x67)
124
+ OP(CONV_I2, "conv.i2", 0x68)
125
+ OP(CONV_I4, "conv.i4", 0x69)
126
+ OP(CONV_I8, "conv.i8", 0x6a)
127
+ OP(CONV_R4, "conv.r4", 0x6b)
128
+ OP(CONV_R8, "conv.r8", 0x6c)
129
+ OP(CONV_U4, "conv.u4", 0x6d)
130
+ OP(CONV_U8, "conv.u8", 0x6e)
131
+ OP(CALLVIRT, "callvirt", 0x6f)
132
+ OP(CPOBJ, "cpobj", 0x70)
133
+ OP(LDOBJ, "ldobj", 0x71)
134
+ OP(LDSTR, "ldstr", 0x72)
135
+ OP(NEWOBJ, "newobj", 0x73)
136
+ OP(CASTCLASS, "castclass", 0x74)
137
+ OP(ISINST, "isinst", 0x75)
138
+ OP(CONV_R_UN, "conv.r.un", 0x76)
139
+ OP(ANN_DATA_S, "ann.data.s", 0x77)
140
+ OP(UNBOX, "unbox", 0x79)
141
+ OP(THROW, "throw", 0x7a)
142
+ OP(LDFLD, "ldfld", 0x7b)
143
+ OP(LDFLDA, "ldflda", 0x7c)
144
+ OP(STFLD, "stfld", 0x7d)
145
+ OP(LDSFLD, "ldsfld", 0x7e)
146
+ OP(LDSFLDA, "ldsflda", 0x7f)
147
+ OP(STSFLD, "stsfld", 0x80)
148
+ OP(STOBJ, "stobj", 0x81)
149
+ OP(CONV_OVF_I1_UN, "conv.ovf.i1.un", 0x82)
150
+ OP(CONV_OVF_I2_UN, "conv.ovf.i2.un", 0x83)
151
+ OP(CONV_OVF_I4_UN, "conv.ovf.i4.un", 0x84)
152
+ OP(CONV_OVF_I8_UN, "conv.ovf.i8.un", 0x85)
153
+ OP(CONV_OVF_U1_UN, "conv.ovf.u1.un", 0x86)
154
+ OP(CONV_OVF_U2_UN, "conv.ovf.u2.un", 0x87)
155
+ OP(CONV_OVF_U4_UN, "conv.ovf.u4.un", 0x88)
156
+ OP(CONV_OVF_U8_UN, "conv.ovf.u8.un", 0x89)
157
+ OP(CONV_OVF_I_UN, "conv.ovf.i.un", 0x8a)
158
+ OP(CONV_OVF_U_UN, "conv.ovf.u.un", 0x8b)
159
+ OP(BOX, "box", 0x8c)
160
+ OP(NEWARR, "newarr", 0x8d)
161
+ OP(LDLEN, "ldlen", 0x8e)
162
+ OP(LDELEMA, "ldelema", 0x8f)
163
+ OP(LDELEM_I1, "ldelem.i1", 0x90)
164
+ OP(LDELEM_U1, "ldelem.u1", 0x91)
165
+ OP(LDELEM_I2, "ldelem.i2", 0x92)
166
+ OP(LDELEM_U2, "ldelem.u2", 0x93)
167
+ OP(LDELEM_I4, "ldelem.i4", 0x94)
168
+ OP(LDELEM_U4, "ldelem.u4", 0x95)
169
+ OP(LDELEM_I8, "ldelem.i8", 0x96)
170
+ OP(LDELEM_I, "ldelem.i", 0x97)
171
+ OP(LDELEM_R4, "ldelem.r4", 0x98)
172
+ OP(LDELEM_R8, "ldelem.r8", 0x99)
173
+ OP(LDELEM_REF, "ldelem.ref", 0x9a)
174
+ OP(STELEM_I, "stelem.i", 0x9b)
175
+ OP(STELEM_I1, "stelem.i1", 0x9c)
176
+ OP(STELEM_I2, "stelem.i2", 0x9d)
177
+ OP(STELEM_I4, "stelem.i4", 0x9e)
178
+ OP(STELEM_I8, "stelem.i8", 0x9f)
179
+ OP(STELEM_R4, "stelem.r4", 0xa0)
180
+ OP(STELEM_R8, "stelem.r8", 0xa1)
181
+ OP(STELEM_REF, "stelem.ref", 0xa2)
182
+ OP(CONV_OVF_I1, "conv.ovf.i1", 0xb3)
183
+ OP(CONV_OVF_U1, "conv.ovf.u1", 0xb4)
184
+ OP(CONV_OVF_I2, "conv.ovf.i2", 0xb5)
185
+ OP(CONV_OVF_U2, "conv.ovf.u2", 0xb6)
186
+ OP(CONV_OVF_I4, "conv.ovf.i4", 0xb7)
187
+ OP(CONV_OVF_U4, "conv.ovf.u4", 0xb8)
188
+ OP(CONV_OVF_I8, "conv.ovf.i8", 0xb9)
189
+ OP(CONV_OVF_U8, "conv.ovf.u8", 0xba)
190
+ OP(REFANYVAL, "refanyval", 0xc2)
191
+ OP(CKFINITE, "ckfinite", 0xc3)
192
+ OP(MKREFANY, "mkrefany", 0xc6)
193
+ OP(ANN_CALL, "ann.call", 0xc7)
194
+ OP(ANN_CATCH, "ann.catch", 0xc8)
195
+ OP(ANN_DEAD, "ann.dead", 0xc9)
196
+ OP(ANN_HOISTED, "ann.hoisted", 0xca)
197
+ OP(ANN_HOISTED_CALL, "ann.hoisted.call", 0xcb)
198
+ OP(ANN_LAB, "ann.lab", 0xcc)
199
+ OP(ANN_DEF, "ann.def", 0xcd)
200
+ OP(ANN_REF_S, "ann.ref.s", 0xce)
201
+ OP(ANN_PHI, "ann.phi", 0xcf)
202
+ OP(LDTOKEN, "ldtoken", 0xd0)
203
+ OP(CONV_U2, "conv.u2", 0xd1)
204
+ OP(CONV_U1, "conv.u1", 0xd2)
205
+ OP(CONV_I, "conv.i", 0xd3)
206
+ OP(CONV_OVF_I, "conv.ovf.i", 0xd4)
207
+ OP(CONV_OVF_U, "conv.ovf.u", 0xd5)
208
+ OP(ADD_OVF, "add.ovf", 0xd6)
209
+ OP(ADD_OVF_UN, "add.ovf.un", 0xd7)
210
+ OP(MUL_OVF, "mul.ovf", 0xd8)
211
+ OP(MUL_OVF_UN, "mul.ovf.un", 0xd9)
212
+ OP(SUB_OVF, "sub.ovf", 0xda)
213
+ OP(SUB_OVF_UN, "sub.ovf.un", 0xdb)
214
+ OP(ENDFINALLY, "endfinally", 0xdc)
215
+ OP(LEAVE, "leave", 0xdd)
216
+ OP(LEAVE_S, "leave.s", 0xde)
217
+ OP(STIND_I, "stind.i", 0xdf)
218
+ OP(CONV_U, "conv.u", 0xe0)
219
+
220
+ /* prefix instructions. we use an opcode >= 256 to ease coding */
221
+
222
+ OP(ARGLIST, "arglist", 0x100)
223
+ OP(CEQ, "ceq", 0x101)
224
+ OP(CGT, "cgt", 0x102)
225
+ OP(CGT_UN, "cgt.un", 0x103)
226
+ OP(CLT, "clt", 0x104)
227
+ OP(CLT_UN, "clt.un", 0x105)
228
+ OP(LDFTN, "ldftn", 0x106)
229
+ OP(LDVIRTFTN, "ldvirtftn", 0x107)
230
+ OP(JMPI, "jmpi", 0x108)
231
+ OP(LDARG, "ldarg", 0x109)
232
+ OP(LDARGA, "ldarga", 0x10a)
233
+ OP(STARG, "starg", 0x10b)
234
+ OP(LDLOC, "ldloc", 0x10c)
235
+ OP(LDLOCA, "ldloca", 0x10d)
236
+ OP(STLOC, "stloc", 0x10e)
237
+ OP(LOCALLOC, "localloc", 0x10f)
238
+ OP(ENDFILTER, "endfilter", 0x111)
239
+ OP(UNALIGNED, "unaligned", 0x112)
240
+ OP(VOLATILE, "volatile", 0x113)
241
+ OP(TAIL, "tail", 0x114)
242
+ OP(INITOBJ, "initobj", 0x115)
243
+ OP(ANN_LIVE, "ann.live", 0x116)
244
+ OP(CPBLK, "cpblk", 0x117)
245
+ OP(INITBLK, "initblk", 0x118)
246
+ OP(ANN_REF, "ann.ref", 0x119)
247
+ OP(RETHROW, "rethrow", 0x11a)
248
+ OP(SIZEOF, "sizeof", 0x11c)
249
+ OP(REFANYTYPE, "refanytype", 0x11d)
250
+ OP(ANN_DATA, "ann.data", 0x122)
251
+ OP(ANN_ARG, "ann.arg", 0x123)
@@ -0,0 +1,57 @@
1
+ #ifndef _FLOAT_H_
2
+ #define _FLOAT_H_
3
+
4
+ #define FLT_RADIX 2
5
+
6
+ /* IEEE float */
7
+ #define FLT_MANT_DIG 24
8
+ #define FLT_DIG 6
9
+ #define FLT_ROUNDS 1
10
+ #define FLT_EPSILON 1.19209290e-07F
11
+ #define FLT_MIN_EXP (-125)
12
+ #define FLT_MIN 1.17549435e-38F
13
+ #define FLT_MIN_10_EXP (-37)
14
+ #define FLT_MAX_EXP 128
15
+ #define FLT_MAX 3.40282347e+38F
16
+ #define FLT_MAX_10_EXP 38
17
+
18
+ /* IEEE double */
19
+ #define DBL_MANT_DIG 53
20
+ #define DBL_DIG 15
21
+ #define DBL_EPSILON 2.2204460492503131e-16
22
+ #define DBL_MIN_EXP (-1021)
23
+ #define DBL_MIN 2.2250738585072014e-308
24
+ #define DBL_MIN_10_EXP (-307)
25
+ #define DBL_MAX_EXP 1024
26
+ #define DBL_MAX 1.7976931348623157e+308
27
+ #define DBL_MAX_10_EXP 308
28
+
29
+ /* horrible intel long double */
30
+ #ifdef __i386__
31
+
32
+ #define LDBL_MANT_DIG 64
33
+ #define LDBL_DIG 18
34
+ #define LDBL_EPSILON 1.08420217248550443401e-19L
35
+ #define LDBL_MIN_EXP (-16381)
36
+ #define LDBL_MIN 3.36210314311209350626e-4932L
37
+ #define LDBL_MIN_10_EXP (-4931)
38
+ #define LDBL_MAX_EXP 16384
39
+ #define LDBL_MAX 1.18973149535723176502e+4932L
40
+ #define LDBL_MAX_10_EXP 4932
41
+
42
+ #else
43
+
44
+ /* same as IEEE double */
45
+ #define LDBL_MANT_DIG 53
46
+ #define LDBL_DIG 15
47
+ #define LDBL_EPSILON 2.2204460492503131e-16
48
+ #define LDBL_MIN_EXP (-1021)
49
+ #define LDBL_MIN 2.2250738585072014e-308
50
+ #define LDBL_MIN_10_EXP (-307)
51
+ #define LDBL_MAX_EXP 1024
52
+ #define LDBL_MAX 1.7976931348623157e+308
53
+ #define LDBL_MAX_10_EXP 308
54
+
55
+ #endif
56
+
57
+ #endif /* _FLOAT_H_ */
@@ -0,0 +1,41 @@
1
+ #ifndef _STDARG_H
2
+ #define _STDARG_H
3
+
4
+ #ifdef __x86_64__
5
+ #ifndef _WIN64
6
+
7
+ typedef void *va_list;
8
+
9
+ va_list __va_start(void *fp);
10
+ void *__va_arg(va_list ap, int arg_type, int size);
11
+ va_list __va_copy(va_list src);
12
+ void __va_end(va_list ap);
13
+
14
+ #define va_start(ap, last) ((ap) = __va_start(__builtin_frame_address(0)))
15
+ #define va_arg(ap, type) \
16
+ (*(type *)(__va_arg(ap, __builtin_va_arg_types(type), sizeof(type))))
17
+ #define va_copy(dest, src) ((dest) = __va_copy(src))
18
+ #define va_end(ap) __va_end(ap)
19
+
20
+ #else /* _WIN64 */
21
+ typedef char *va_list;
22
+ #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+7)&~7)
23
+ #define va_arg(ap,type) (ap += (sizeof(type)+7)&~7, *(type *)(ap - ((sizeof(type)+7)&~7)))
24
+ #define va_copy(dest, src) (dest) = (src)
25
+ #define va_end(ap)
26
+ #endif
27
+
28
+ #else /* __i386__ */
29
+ typedef char *va_list;
30
+ /* only correct for i386 */
31
+ #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3)
32
+ #define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3)))
33
+ #define va_copy(dest, src) (dest) = (src)
34
+ #define va_end(ap)
35
+ #endif
36
+
37
+ /* fix a buggy dependency on GCC in libio.h */
38
+ typedef va_list __gnuc_va_list;
39
+ #define _VA_LIST_DEFINED
40
+
41
+ #endif /* _STDARG_H */
@@ -0,0 +1,10 @@
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
+
10
+ #endif /* _STDBOOL_H */
@@ -0,0 +1,28 @@
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
+ #ifndef __int8_t_defined
12
+ #define __int8_t_defined
13
+ typedef signed char int8_t;
14
+ typedef signed short int int16_t;
15
+ typedef signed int int32_t;
16
+ typedef signed long long int int64_t;
17
+ typedef unsigned char uint8_t;
18
+ typedef unsigned short int uint16_t;
19
+ typedef unsigned int uint32_t;
20
+ typedef unsigned long long int uint64_t;
21
+ #endif
22
+
23
+ #define NULL ((void*)0)
24
+ #define offsetof(type, field) ((size_t)&((type *)0)->field)
25
+
26
+ void *alloca(size_t size);
27
+
28
+ #endif
@@ -0,0 +1,78 @@
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
+
23
+ /* stdio.h */
24
+ typedef struct __FILE FILE;
25
+ #define EOF (-1)
26
+ extern FILE *stdin;
27
+ extern FILE *stdout;
28
+ extern FILE *stderr;
29
+ FILE *fopen(const char *path, const char *mode);
30
+ FILE *fdopen(int fildes, const char *mode);
31
+ FILE *freopen(const char *path, const char *mode, FILE *stream);
32
+ int fclose(FILE *stream);
33
+ size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
34
+ size_t fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream);
35
+ int fgetc(FILE *stream);
36
+ char *fgets(char *s, int size, FILE *stream);
37
+ int getc(FILE *stream);
38
+ int getchar(void);
39
+ char *gets(char *s);
40
+ int ungetc(int c, FILE *stream);
41
+ int fflush(FILE *stream);
42
+
43
+ int printf(const char *format, ...);
44
+ int fprintf(FILE *stream, const char *format, ...);
45
+ int sprintf(char *str, const char *format, ...);
46
+ int snprintf(char *str, size_t size, const char *format, ...);
47
+ int asprintf(char **strp, const char *format, ...);
48
+ int dprintf(int fd, const char *format, ...);
49
+ int vprintf(const char *format, va_list ap);
50
+ int vfprintf(FILE *stream, const char *format, va_list ap);
51
+ int vsprintf(char *str, const char *format, va_list ap);
52
+ int vsnprintf(char *str, size_t size, const char *format, va_list ap);
53
+ int vasprintf(char **strp, const char *format, va_list ap);
54
+ int vdprintf(int fd, const char *format, va_list ap);
55
+
56
+ void perror(const char *s);
57
+
58
+ /* string.h */
59
+ char *strcat(char *dest, const char *src);
60
+ char *strchr(const char *s, int c);
61
+ char *strrchr(const char *s, int c);
62
+ char *strcpy(char *dest, const char *src);
63
+ void *memcpy(void *dest, const void *src, size_t n);
64
+ void *memmove(void *dest, const void *src, size_t n);
65
+ void *memset(void *s, int c, size_t n);
66
+ char *strdup(const char *s);
67
+
68
+ /* dlfcn.h */
69
+ #define RTLD_LAZY 0x001
70
+ #define RTLD_NOW 0x002
71
+ #define RTLD_GLOBAL 0x100
72
+
73
+ void *dlopen(const char *filename, int flag);
74
+ const char *dlerror(void);
75
+ void *dlsym(void *handle, char *symbol);
76
+ int dlclose(void *handle);
77
+
78
+ #endif /* _TCCLIB_H */