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,427 @@
1
+ #! /usr/bin/perl -w
2
+
3
+ # Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
4
+
5
+ # This file is part of GNU CC.
6
+
7
+ # GNU CC is free software; you can redistribute it and/or modify
8
+ # it under the terms of the GNU General Public License as published by
9
+ # the Free Software Foundation; either version 2, or (at your option)
10
+ # any later version.
11
+
12
+ # GNU CC is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU General Public License for more details.
16
+
17
+ # You should have received a copy of the GNU General Public License
18
+ # along with GNU CC; see the file COPYING. If not, write to
19
+ # the Free Software Foundation, 59 Temple Place - Suite 330,
20
+ # Boston MA 02111-1307, USA.
21
+
22
+ # This does trivial (and I mean _trivial_) conversion of Texinfo
23
+ # markup to Perl POD format. It's intended to be used to extract
24
+ # something suitable for a manpage from a Texinfo document.
25
+
26
+ $output = 0;
27
+ $skipping = 0;
28
+ %sects = ();
29
+ $section = "";
30
+ @icstack = ();
31
+ @endwstack = ();
32
+ @skstack = ();
33
+ @instack = ();
34
+ $shift = "";
35
+ %defs = ();
36
+ $fnno = 1;
37
+ $inf = "";
38
+ $ibase = "";
39
+
40
+ while ($_ = shift) {
41
+ if (/^-D(.*)$/) {
42
+ if ($1 ne "") {
43
+ $flag = $1;
44
+ } else {
45
+ $flag = shift;
46
+ }
47
+ $value = "";
48
+ ($flag, $value) = ($flag =~ /^([^=]+)(?:=(.+))?/);
49
+ die "no flag specified for -D\n"
50
+ unless $flag ne "";
51
+ die "flags may only contain letters, digits, hyphens, dashes and underscores\n"
52
+ unless $flag =~ /^[a-zA-Z0-9_-]+$/;
53
+ $defs{$flag} = $value;
54
+ } elsif (/^-/) {
55
+ usage();
56
+ } else {
57
+ $in = $_, next unless defined $in;
58
+ $out = $_, next unless defined $out;
59
+ usage();
60
+ }
61
+ }
62
+
63
+ if (defined $in) {
64
+ $inf = gensym();
65
+ open($inf, "<$in") or die "opening \"$in\": $!\n";
66
+ $ibase = $1 if $in =~ m|^(.+)/[^/]+$|;
67
+ } else {
68
+ $inf = \*STDIN;
69
+ }
70
+
71
+ if (defined $out) {
72
+ open(STDOUT, ">$out") or die "opening \"$out\": $!\n";
73
+ }
74
+
75
+ while(defined $inf) {
76
+ while(<$inf>) {
77
+ # Certain commands are discarded without further processing.
78
+ /^\@(?:
79
+ [a-z]+index # @*index: useful only in complete manual
80
+ |need # @need: useful only in printed manual
81
+ |(?:end\s+)?group # @group .. @end group: ditto
82
+ |page # @page: ditto
83
+ |node # @node: useful only in .info file
84
+ |(?:end\s+)?ifnottex # @ifnottex .. @end ifnottex: use contents
85
+ )\b/x and next;
86
+
87
+ chomp;
88
+
89
+ # Look for filename and title markers.
90
+ /^\@setfilename\s+([^.]+)/ and $fn = $1, next;
91
+ /^\@settitle\s+([^.]+)/ and $tl = postprocess($1), next;
92
+
93
+ # Identify a man title but keep only the one we are interested in.
94
+ /^\@c\s+man\s+title\s+([A-Za-z0-9-]+)\s+(.+)/ and do {
95
+ if (exists $defs{$1}) {
96
+ $fn = $1;
97
+ $tl = postprocess($2);
98
+ }
99
+ next;
100
+ };
101
+
102
+ # Look for blocks surrounded by @c man begin SECTION ... @c man end.
103
+ # This really oughta be @ifman ... @end ifman and the like, but such
104
+ # would require rev'ing all other Texinfo translators.
105
+ /^\@c\s+man\s+begin\s+([A-Z]+)\s+([A-Za-z0-9-]+)/ and do {
106
+ $output = 1 if exists $defs{$2};
107
+ $sect = $1;
108
+ next;
109
+ };
110
+ /^\@c\s+man\s+begin\s+([A-Z]+)/ and $sect = $1, $output = 1, next;
111
+ /^\@c\s+man\s+end/ and do {
112
+ $sects{$sect} = "" unless exists $sects{$sect};
113
+ $sects{$sect} .= postprocess($section);
114
+ $section = "";
115
+ $output = 0;
116
+ next;
117
+ };
118
+
119
+ # handle variables
120
+ /^\@set\s+([a-zA-Z0-9_-]+)\s*(.*)$/ and do {
121
+ $defs{$1} = $2;
122
+ next;
123
+ };
124
+ /^\@clear\s+([a-zA-Z0-9_-]+)/ and do {
125
+ delete $defs{$1};
126
+ next;
127
+ };
128
+
129
+ next unless $output;
130
+
131
+ # Discard comments. (Can't do it above, because then we'd never see
132
+ # @c man lines.)
133
+ /^\@c\b/ and next;
134
+
135
+ # End-block handler goes up here because it needs to operate even
136
+ # if we are skipping.
137
+ /^\@end\s+([a-z]+)/ and do {
138
+ # Ignore @end foo, where foo is not an operation which may
139
+ # cause us to skip, if we are presently skipping.
140
+ my $ended = $1;
141
+ next if $skipping && $ended !~ /^(?:ifset|ifclear|ignore|menu|iftex)$/;
142
+
143
+ die "\@end $ended without \@$ended at line $.\n" unless defined $endw;
144
+ die "\@$endw ended by \@end $ended at line $.\n" unless $ended eq $endw;
145
+
146
+ $endw = pop @endwstack;
147
+
148
+ if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex)$/) {
149
+ $skipping = pop @skstack;
150
+ next;
151
+ } elsif ($ended =~ /^(?:example|smallexample|display)$/) {
152
+ $shift = "";
153
+ $_ = ""; # need a paragraph break
154
+ } elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) {
155
+ $_ = "\n=back\n";
156
+ $ic = pop @icstack;
157
+ } else {
158
+ die "unknown command \@end $ended at line $.\n";
159
+ }
160
+ };
161
+
162
+ # We must handle commands which can cause skipping even while we
163
+ # are skipping, otherwise we will not process nested conditionals
164
+ # correctly.
165
+ /^\@ifset\s+([a-zA-Z0-9_-]+)/ and do {
166
+ push @endwstack, $endw;
167
+ push @skstack, $skipping;
168
+ $endw = "ifset";
169
+ $skipping = 1 unless exists $defs{$1};
170
+ next;
171
+ };
172
+
173
+ /^\@ifclear\s+([a-zA-Z0-9_-]+)/ and do {
174
+ push @endwstack, $endw;
175
+ push @skstack, $skipping;
176
+ $endw = "ifclear";
177
+ $skipping = 1 if exists $defs{$1};
178
+ next;
179
+ };
180
+
181
+ /^\@(ignore|menu|iftex)\b/ and do {
182
+ push @endwstack, $endw;
183
+ push @skstack, $skipping;
184
+ $endw = $1;
185
+ $skipping = 1;
186
+ next;
187
+ };
188
+
189
+ next if $skipping;
190
+
191
+ # Character entities. First the ones that can be replaced by raw text
192
+ # or discarded outright:
193
+ s/\@copyright\{\}/(c)/g;
194
+ s/\@dots\{\}/.../g;
195
+ s/\@enddots\{\}/..../g;
196
+ s/\@([.!? ])/$1/g;
197
+ s/\@[:-]//g;
198
+ s/\@bullet(?:\{\})?/*/g;
199
+ s/\@TeX\{\}/TeX/g;
200
+ s/\@pounds\{\}/\#/g;
201
+ s/\@minus(?:\{\})?/-/g;
202
+ s/\\,/,/g;
203
+
204
+ # Now the ones that have to be replaced by special escapes
205
+ # (which will be turned back into text by unmunge())
206
+ s/&/&amp;/g;
207
+ s/\@\{/&lbrace;/g;
208
+ s/\@\}/&rbrace;/g;
209
+ s/\@\@/&at;/g;
210
+
211
+ # Inside a verbatim block, handle @var specially.
212
+ if ($shift ne "") {
213
+ s/\@var\{([^\}]*)\}/<$1>/g;
214
+ }
215
+
216
+ # POD doesn't interpret E<> inside a verbatim block.
217
+ if ($shift eq "") {
218
+ s/</&lt;/g;
219
+ s/>/&gt;/g;
220
+ } else {
221
+ s/</&LT;/g;
222
+ s/>/&GT;/g;
223
+ }
224
+
225
+ # Single line command handlers.
226
+
227
+ /^\@include\s+(.+)$/ and do {
228
+ push @instack, $inf;
229
+ $inf = gensym();
230
+
231
+ # Try cwd and $ibase.
232
+ open($inf, "<" . $1)
233
+ or open($inf, "<" . $ibase . "/" . $1)
234
+ or die "cannot open $1 or $ibase/$1: $!\n";
235
+ next;
236
+ };
237
+
238
+ /^\@(?:section|unnumbered|unnumberedsec|center)\s+(.+)$/
239
+ and $_ = "\n=head2 $1\n";
240
+ /^\@subsection\s+(.+)$/
241
+ and $_ = "\n=head3 $1\n";
242
+
243
+ # Block command handlers:
244
+ /^\@itemize\s+(\@[a-z]+|\*|-)/ and do {
245
+ push @endwstack, $endw;
246
+ push @icstack, $ic;
247
+ $ic = $1;
248
+ $_ = "\n=over 4\n";
249
+ $endw = "itemize";
250
+ };
251
+
252
+ /^\@enumerate(?:\s+([a-zA-Z0-9]+))?/ and do {
253
+ push @endwstack, $endw;
254
+ push @icstack, $ic;
255
+ if (defined $1) {
256
+ $ic = $1 . ".";
257
+ } else {
258
+ $ic = "1.";
259
+ }
260
+ $_ = "\n=over 4\n";
261
+ $endw = "enumerate";
262
+ };
263
+
264
+ /^\@([fv]?table)\s+(\@[a-z]+)/ and do {
265
+ push @endwstack, $endw;
266
+ push @icstack, $ic;
267
+ $endw = $1;
268
+ $ic = $2;
269
+ $ic =~ s/\@(?:samp|strong|key|gcctabopt|option|env)/B/;
270
+ $ic =~ s/\@(?:code|kbd)/C/;
271
+ $ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
272
+ $ic =~ s/\@(?:file)/F/;
273
+ $_ = "\n=over 4\n";
274
+ };
275
+
276
+ /^\@((?:small)?example|display)/ and do {
277
+ push @endwstack, $endw;
278
+ $endw = $1;
279
+ $shift = "\t";
280
+ $_ = ""; # need a paragraph break
281
+ };
282
+
283
+ /^\@itemx?\s*(.+)?$/ and do {
284
+ if (defined $1) {
285
+ # Entity escapes prevent munging by the <> processing below.
286
+ $_ = "\n=item $ic\&LT;$1\&GT;\n";
287
+ } else {
288
+ $_ = "\n=item $ic\n";
289
+ $ic =~ y/A-Ya-y/B-Zb-z/;
290
+ $ic =~ s/(\d+)/$1 + 1/eg;
291
+ }
292
+ };
293
+
294
+ $section .= $shift.$_."\n";
295
+ }
296
+ # End of current file.
297
+ close($inf);
298
+ $inf = pop @instack;
299
+ }
300
+
301
+ die "No filename or title\n" unless defined $fn && defined $tl;
302
+
303
+ $sects{NAME} = "$fn \- $tl\n";
304
+ $sects{FOOTNOTES} .= "=back\n" if exists $sects{FOOTNOTES};
305
+
306
+ for $sect (qw(NAME SYNOPSIS DESCRIPTION OPTIONS ENVIRONMENT FILES
307
+ BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) {
308
+ if(exists $sects{$sect}) {
309
+ $head = $sect;
310
+ $head =~ s/SEEALSO/SEE ALSO/;
311
+ print "=head1 $head\n\n";
312
+ print scalar unmunge ($sects{$sect});
313
+ print "\n";
314
+ }
315
+ }
316
+
317
+ sub usage
318
+ {
319
+ die "usage: $0 [-D toggle...] [infile [outfile]]\n";
320
+ }
321
+
322
+ sub postprocess
323
+ {
324
+ local $_ = $_[0];
325
+
326
+ # @value{foo} is replaced by whatever 'foo' is defined as.
327
+ while (m/(\@value\{([a-zA-Z0-9_-]+)\})/g) {
328
+ if (! exists $defs{$2}) {
329
+ print STDERR "Option $2 not defined\n";
330
+ s/\Q$1\E//;
331
+ } else {
332
+ $value = $defs{$2};
333
+ s/\Q$1\E/$value/;
334
+ }
335
+ }
336
+
337
+ # Formatting commands.
338
+ # Temporary escape for @r.
339
+ s/\@r\{([^\}]*)\}/R<$1>/g;
340
+ s/\@(?:dfn|var|emph|cite|i)\{([^\}]*)\}/I<$1>/g;
341
+ s/\@(?:code|kbd)\{([^\}]*)\}/C<$1>/g;
342
+ s/\@(?:gccoptlist|samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g;
343
+ s/\@sc\{([^\}]*)\}/\U$1/g;
344
+ s/\@file\{([^\}]*)\}/F<$1>/g;
345
+ s/\@w\{([^\}]*)\}/S<$1>/g;
346
+ s/\@(?:dmn|math)\{([^\}]*)\}/$1/g;
347
+
348
+ # Cross references are thrown away, as are @noindent and @refill.
349
+ # (@noindent is impossible in .pod, and @refill is unnecessary.)
350
+ # @* is also impossible in .pod; we discard it and any newline that
351
+ # follows it. Similarly, our macro @gol must be discarded.
352
+
353
+ s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
354
+ s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
355
+ s/;\s+\@pxref\{(?:[^\}]*)\}//g;
356
+ s/\@noindent\s*//g;
357
+ s/\@refill//g;
358
+ s/\@gol//g;
359
+ s/\@\*\s*\n?//g;
360
+
361
+ # @uref can take one, two, or three arguments, with different
362
+ # semantics each time. @url and @email are just like @uref with
363
+ # one argument, for our purposes.
364
+ s/\@(?:uref|url|email)\{([^\},]*)\}/&lt;B<$1>&gt;/g;
365
+ s/\@uref\{([^\},]*),([^\},]*)\}/$2 (C<$1>)/g;
366
+ s/\@uref\{([^\},]*),([^\},]*),([^\},]*)\}/$3/g;
367
+
368
+ # Turn B<blah I<blah> blah> into B<blah> I<blah> B<blah> to
369
+ # match Texinfo semantics of @emph inside @samp. Also handle @r
370
+ # inside bold.
371
+ s/&LT;/</g;
372
+ s/&GT;/>/g;
373
+ 1 while s/B<((?:[^<>]|I<[^<>]*>)*)R<([^>]*)>/B<$1>${2}B</g;
374
+ 1 while (s/B<([^<>]*)I<([^>]+)>/B<$1>I<$2>B</g);
375
+ 1 while (s/I<([^<>]*)B<([^>]+)>/I<$1>B<$2>I</g);
376
+ s/[BI]<>//g;
377
+ s/([BI])<(\s+)([^>]+)>/$2$1<$3>/g;
378
+ s/([BI])<([^>]+?)(\s+)>/$1<$2>$3/g;
379
+
380
+ # Extract footnotes. This has to be done after all other
381
+ # processing because otherwise the regexp will choke on formatting
382
+ # inside @footnote.
383
+ while (/\@footnote/g) {
384
+ s/\@footnote\{([^\}]+)\}/[$fnno]/;
385
+ add_footnote($1, $fnno);
386
+ $fnno++;
387
+ }
388
+
389
+ return $_;
390
+ }
391
+
392
+ sub unmunge
393
+ {
394
+ # Replace escaped symbols with their equivalents.
395
+ local $_ = $_[0];
396
+
397
+ s/&lt;/E<lt>/g;
398
+ s/&gt;/E<gt>/g;
399
+ s/&lbrace;/\{/g;
400
+ s/&rbrace;/\}/g;
401
+ s/&at;/\@/g;
402
+ s/&amp;/&/g;
403
+ return $_;
404
+ }
405
+
406
+ sub add_footnote
407
+ {
408
+ unless (exists $sects{FOOTNOTES}) {
409
+ $sects{FOOTNOTES} = "\n=over 4\n\n";
410
+ }
411
+
412
+ $sects{FOOTNOTES} .= "=item $fnno.\n\n"; $fnno++;
413
+ $sects{FOOTNOTES} .= $_[0];
414
+ $sects{FOOTNOTES} .= "\n\n";
415
+ }
416
+
417
+ # stolen from Symbol.pm
418
+ {
419
+ my $genseq = 0;
420
+ sub gensym
421
+ {
422
+ my $name = "GEN" . $genseq++;
423
+ my $ref = \*{$name};
424
+ delete $::{$name};
425
+ return $ref;
426
+ }
427
+ }
@@ -0,0 +1,60 @@
1
+ @rem ----------------------------------------------------
2
+ @rem batch file to build tcc using mingw gcc
3
+ @rem ----------------------------------------------------
4
+
5
+ @set /p VERSION= < ..\VERSION
6
+ echo>..\config.h #define TCC_VERSION "%VERSION%"
7
+
8
+ @if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
9
+ @if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
10
+
11
+ @set target=-DTCC_TARGET_PE -DTCC_TARGET_I386
12
+ @set CC=gcc -Os -s -fno-strict-aliasing
13
+ @set P=32
14
+ @goto tools
15
+
16
+ :x86_64
17
+ @set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_64
18
+ @rem mingw 64 has an ICE with -Os
19
+ @set CC=x86_64-pc-mingw32-gcc -O0 -s -fno-strict-aliasing
20
+ @set P=64
21
+ @goto tools
22
+
23
+ :tools
24
+ %CC% %target% tools/tiny_impdef.c -o tiny_impdef.exe
25
+ %CC% %target% tools/tiny_libmaker.c -o tiny_libmaker.exe
26
+
27
+ :libtcc
28
+ if not exist libtcc\nul mkdir libtcc
29
+ copy ..\libtcc.h libtcc\libtcc.h
30
+ %CC% %target% -shared -DLIBTCC_AS_DLL -DONE_SOURCE ../libtcc.c -o libtcc.dll -Wl,-out-implib,libtcc/libtcc.a
31
+ tiny_impdef libtcc.dll -o libtcc/libtcc.def
32
+
33
+ :tcc
34
+ %CC% %target% ../tcc.c -o tcc.exe -ltcc -Llibtcc
35
+
36
+ :copy_std_includes
37
+ copy ..\include\*.h include
38
+
39
+ :libtcc1.a
40
+ .\tcc %target% -c ../lib/libtcc1.c
41
+ .\tcc %target% -c lib/crt1.c
42
+ .\tcc %target% -c lib/wincrt1.c
43
+ .\tcc %target% -c lib/dllcrt1.c
44
+ .\tcc %target% -c lib/dllmain.c
45
+ .\tcc %target% -c lib/chkstk.S
46
+ goto lib%P%
47
+
48
+ :lib32
49
+ .\tcc %target% -c ../lib/alloca86.S
50
+ .\tcc %target% -c ../lib/alloca86-bt.S
51
+ .\tcc %target% -c ../lib/bcheck.c
52
+ tiny_libmaker lib/libtcc1.a libtcc1.o alloca86.o alloca86-bt.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o bcheck.o
53
+ @goto the_end
54
+
55
+ :lib64
56
+ .\tcc %target% -c ../lib/alloca86_64.S
57
+ tiny_libmaker lib/libtcc1.a libtcc1.o alloca86_64.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
58
+
59
+ :the_end
60
+ del *.o