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.
- checksums.yaml +7 -0
- data/LICENSE +35 -0
- data/README.md +196 -0
- data/ext/tcc/extconf.rb +25 -0
- data/ext/tcc/tcc-0.9.26.patch +30 -0
- data/ext/tcc/tcc-0.9.26/COPYING +504 -0
- data/ext/tcc/tcc-0.9.26/Changelog +396 -0
- data/ext/tcc/tcc-0.9.26/Makefile +349 -0
- data/ext/tcc/tcc-0.9.26/README +101 -0
- data/ext/tcc/tcc-0.9.26/TODO +93 -0
- data/ext/tcc/tcc-0.9.26/VERSION +1 -0
- data/ext/tcc/tcc-0.9.26/arm-gen.c +2005 -0
- data/ext/tcc/tcc-0.9.26/c67-gen.c +2560 -0
- data/ext/tcc/tcc-0.9.26/coff.h +446 -0
- data/ext/tcc/tcc-0.9.26/config.h +8 -0
- data/ext/tcc/tcc-0.9.26/config.mak +28 -0
- data/ext/tcc/tcc-0.9.26/config.texi +1 -0
- data/ext/tcc/tcc-0.9.26/configure +540 -0
- data/ext/tcc/tcc-0.9.26/conftest.c +71 -0
- data/ext/tcc/tcc-0.9.26/elf.h +1731 -0
- data/ext/tcc/tcc-0.9.26/examples/ex1.c +8 -0
- data/ext/tcc/tcc-0.9.26/examples/ex2.c +98 -0
- data/ext/tcc/tcc-0.9.26/examples/ex3.c +24 -0
- data/ext/tcc/tcc-0.9.26/examples/ex4.c +26 -0
- data/ext/tcc/tcc-0.9.26/examples/ex5.c +8 -0
- data/ext/tcc/tcc-0.9.26/i386-asm.c +1498 -0
- data/ext/tcc/tcc-0.9.26/i386-asm.h +473 -0
- data/ext/tcc/tcc-0.9.26/i386-gen.c +1096 -0
- data/ext/tcc/tcc-0.9.26/i386-tok.h +243 -0
- data/ext/tcc/tcc-0.9.26/il-gen.c +667 -0
- data/ext/tcc/tcc-0.9.26/il-opcodes.h +251 -0
- data/ext/tcc/tcc-0.9.26/include/float.h +57 -0
- data/ext/tcc/tcc-0.9.26/include/stdarg.h +41 -0
- data/ext/tcc/tcc-0.9.26/include/stdbool.h +10 -0
- data/ext/tcc/tcc-0.9.26/include/stddef.h +28 -0
- data/ext/tcc/tcc-0.9.26/include/tcclib.h +78 -0
- data/ext/tcc/tcc-0.9.26/include/varargs.h +12 -0
- data/ext/tcc/tcc-0.9.26/lib/Makefile +102 -0
- data/ext/tcc/tcc-0.9.26/lib/alloca86-bt.S +47 -0
- data/ext/tcc/tcc-0.9.26/lib/alloca86.S +35 -0
- data/ext/tcc/tcc-0.9.26/lib/alloca86_64.S +42 -0
- data/ext/tcc/tcc-0.9.26/lib/bcheck.c +875 -0
- data/ext/tcc/tcc-0.9.26/lib/libtcc1.c +691 -0
- data/ext/tcc/tcc-0.9.26/libtcc.c +1941 -0
- data/ext/tcc/tcc-0.9.26/libtcc.h +103 -0
- data/ext/tcc/tcc-0.9.26/stab.def +234 -0
- data/ext/tcc/tcc-0.9.26/stab.h +17 -0
- data/ext/tcc/tcc-0.9.26/tcc-doc.html +2332 -0
- data/ext/tcc/tcc-0.9.26/tcc-doc.info +1151 -0
- data/ext/tcc/tcc-0.9.26/tcc-doc.texi +1268 -0
- data/ext/tcc/tcc-0.9.26/tcc.1 +415 -0
- data/ext/tcc/tcc-0.9.26/tcc.c +352 -0
- data/ext/tcc/tcc-0.9.26/tcc.h +1379 -0
- data/ext/tcc/tcc-0.9.26/tccasm.c +1118 -0
- data/ext/tcc/tcc-0.9.26/tcccoff.c +948 -0
- data/ext/tcc/tcc-0.9.26/tccelf.c +3129 -0
- data/ext/tcc/tcc-0.9.26/tccgen.c +5841 -0
- data/ext/tcc/tcc-0.9.26/tccpe.c +1887 -0
- data/ext/tcc/tcc-0.9.26/tccpp.c +3128 -0
- data/ext/tcc/tcc-0.9.26/tccrun.c +737 -0
- data/ext/tcc/tcc-0.9.26/tcctok.h +278 -0
- data/ext/tcc/tcc-0.9.26/tests/Makefile +199 -0
- data/ext/tcc/tcc-0.9.26/tests/asmtest.S +609 -0
- data/ext/tcc/tcc-0.9.26/tests/boundtest.c +233 -0
- data/ext/tcc/tcc-0.9.26/tests/gcctestsuite.sh +33 -0
- data/ext/tcc/tcc-0.9.26/tests/libtcc_test.c +76 -0
- data/ext/tcc/tcc-0.9.26/tests/tcctest.c +2713 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/00_assignment.c +18 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/00_assignment.expect +3 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/01_comment.c +14 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/01_comment.expect +5 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/02_printf.c +18 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/02_printf.expect +15 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/03_struct.c +31 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/03_struct.expect +6 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/04_for.c +15 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/04_for.expect +10 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/05_array.c +21 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/05_array.expect +10 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/06_case.c +29 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/06_case.expect +8 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/07_function.c +30 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/07_function.expect +4 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/08_while.c +24 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/08_while.expect +11 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/09_do_while.c +24 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/09_do_while.expect +11 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/10_pointer.c +40 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/10_pointer.expect +8 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/11_precedence.c +40 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/11_precedence.expect +15 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/12_hashdefine.c +14 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/12_hashdefine.expect +2 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/13_integer_literals.c +20 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/13_integer_literals.expect +5 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/14_if.c +21 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/14_if.expect +2 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/15_recursion.c +21 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/15_recursion.expect +10 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/16_nesting.c +21 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/16_nesting.expect +18 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/17_enum.c +29 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/17_enum.expect +3 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/18_include.c +12 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/18_include.expect +3 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/18_include.h +1 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/19_pointer_arithmetic.c +28 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/19_pointer_arithmetic.expect +3 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/20_pointer_comparison.c +24 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/20_pointer_comparison.expect +6 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/21_char_array.c +33 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/21_char_array.expect +7 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/22_floating_point.c +50 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/22_floating_point.expect +16 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/23_type_coercion.c +54 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/23_type_coercion.expect +12 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/24_math_library.c +28 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/24_math_library.expect +18 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/25_quicksort.c +83 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/25_quicksort.expect +2 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/26_character_constants.c +17 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/26_character_constants.expect +8 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/27_sizeof.c +16 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/27_sizeof.expect +3 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/28_strings.c +46 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/28_strings.expect +19 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/29_array_address.c +13 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/29_array_address.expect +1 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/30_hanoi.c +122 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/30_hanoi.expect +71 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/31_args.c +14 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/31_args.expect +7 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/32_led.c +266 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/32_led.expect +4 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/33_ternary_op.c +15 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/33_ternary_op.expect +10 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/34_array_assignment.c +23 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/34_array_assignment.expect +2 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/35_sizeof.c +14 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/35_sizeof.expect +2 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/36_array_initialisers.c +21 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/36_array_initialisers.expect +20 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/37_sprintf.c +17 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/37_sprintf.expect +20 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/38_multiple_array_index.c +32 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/38_multiple_array_index.expect +4 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/39_typedef.c +31 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/39_typedef.expect +3 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/40_stdio.c +52 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/40_stdio.expect +27 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/41_hashif.c +85 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/41_hashif.expect +6 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/42_function_pointer.c +18 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/42_function_pointer.expect +2 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/43_void_param.c +15 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/43_void_param.expect +1 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/44_scoped_declarations.c +17 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/44_scoped_declarations.expect +1 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/45_empty_for.c +18 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/45_empty_for.expect +10 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/46_grep.c +564 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/47_switch_return.c +24 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/47_switch_return.expect +4 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/48_nested_break.c +26 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/48_nested_break.expect +1 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/49_bracket_evaluation.c +23 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/49_bracket_evaluation.expect +1 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/50_logical_second_arg.c +29 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/50_logical_second_arg.expect +20 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/51_static.c +30 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/51_static.expect +8 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/52_unnamed_enum.c +27 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/52_unnamed_enum.expect +9 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/54_goto.c +56 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/54_goto.expect +8 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/55_lshift_type.c +52 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/55_lshift_type.expect +1 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/LICENSE +37 -0
- data/ext/tcc/tcc-0.9.26/tests/tests2/Makefile +98 -0
- data/ext/tcc/tcc-0.9.26/texi2pod.pl +427 -0
- data/ext/tcc/tcc-0.9.26/win32/build-tcc.bat +60 -0
- data/ext/tcc/tcc-0.9.26/win32/examples/dll.c +12 -0
- data/ext/tcc/tcc-0.9.26/win32/examples/fib.c +23 -0
- data/ext/tcc/tcc-0.9.26/win32/examples/hello_dll.c +19 -0
- data/ext/tcc/tcc-0.9.26/win32/examples/hello_win.c +163 -0
- data/ext/tcc/tcc-0.9.26/win32/include/_mingw.h +139 -0
- data/ext/tcc/tcc-0.9.26/win32/include/assert.h +54 -0
- data/ext/tcc/tcc-0.9.26/win32/include/conio.h +409 -0
- data/ext/tcc/tcc-0.9.26/win32/include/ctype.h +281 -0
- data/ext/tcc/tcc-0.9.26/win32/include/dir.h +31 -0
- data/ext/tcc/tcc-0.9.26/win32/include/direct.h +68 -0
- data/ext/tcc/tcc-0.9.26/win32/include/dirent.h +135 -0
- data/ext/tcc/tcc-0.9.26/win32/include/dos.h +55 -0
- data/ext/tcc/tcc-0.9.26/win32/include/errno.h +75 -0
- data/ext/tcc/tcc-0.9.26/win32/include/excpt.h +123 -0
- data/ext/tcc/tcc-0.9.26/win32/include/fcntl.h +52 -0
- data/ext/tcc/tcc-0.9.26/win32/include/fenv.h +108 -0
- data/ext/tcc/tcc-0.9.26/win32/include/inttypes.h +297 -0
- data/ext/tcc/tcc-0.9.26/win32/include/io.h +418 -0
- data/ext/tcc/tcc-0.9.26/win32/include/limits.h +111 -0
- data/ext/tcc/tcc-0.9.26/win32/include/locale.h +91 -0
- data/ext/tcc/tcc-0.9.26/win32/include/malloc.h +175 -0
- data/ext/tcc/tcc-0.9.26/win32/include/math.h +777 -0
- data/ext/tcc/tcc-0.9.26/win32/include/mem.h +13 -0
- data/ext/tcc/tcc-0.9.26/win32/include/memory.h +40 -0
- data/ext/tcc/tcc-0.9.26/win32/include/process.h +176 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/conio_s.h +42 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/crtdbg_s.h +19 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/io_s.h +33 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/mbstring_s.h +52 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/search_s.h +25 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/stdio_s.h +145 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/stdlib_s.h +67 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/stralign_s.h +30 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/string_s.h +41 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/sys/timeb_s.h +34 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/tchar_s.h +266 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/time_s.h +61 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sec_api/wchar_s.h +128 -0
- data/ext/tcc/tcc-0.9.26/win32/include/setjmp.h +160 -0
- data/ext/tcc/tcc-0.9.26/win32/include/share.h +28 -0
- data/ext/tcc/tcc-0.9.26/win32/include/signal.h +63 -0
- data/ext/tcc/tcc-0.9.26/win32/include/stdint.h +209 -0
- data/ext/tcc/tcc-0.9.26/win32/include/stdio.h +429 -0
- data/ext/tcc/tcc-0.9.26/win32/include/stdlib.h +580 -0
- data/ext/tcc/tcc-0.9.26/win32/include/string.h +164 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sys/fcntl.h +13 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sys/file.h +14 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sys/locking.h +30 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sys/stat.h +290 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sys/time.h +69 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sys/timeb.h +133 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sys/types.h +118 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sys/unistd.h +14 -0
- data/ext/tcc/tcc-0.9.26/win32/include/sys/utime.h +146 -0
- data/ext/tcc/tcc-0.9.26/win32/include/tchar.h +1102 -0
- data/ext/tcc/tcc-0.9.26/win32/include/time.h +287 -0
- data/ext/tcc/tcc-0.9.26/win32/include/vadefs.h +11 -0
- data/ext/tcc/tcc-0.9.26/win32/include/values.h +4 -0
- data/ext/tcc/tcc-0.9.26/win32/include/wchar.h +871 -0
- data/ext/tcc/tcc-0.9.26/win32/include/wctype.h +172 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/basetsd.h +149 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/basetyps.h +85 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/guiddef.h +151 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/intrin.h +11 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/poppack.h +8 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack1.h +8 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack2.h +8 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack4.h +8 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack8.h +8 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/reason.h +80 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/specstrings.h +7 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/stralign.h +154 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/tvout.h +79 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/winbase.h +2951 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/wincon.h +301 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/windef.h +293 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/windows.h +123 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/winerror.h +3166 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/wingdi.h +4080 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/winnetwk.h +476 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/winnls.h +765 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/winnt.h +5770 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/winreg.h +272 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/winuser.h +5651 -0
- data/ext/tcc/tcc-0.9.26/win32/include/winapi/winver.h +160 -0
- data/ext/tcc/tcc-0.9.26/win32/lib/chkstk.S +191 -0
- data/ext/tcc/tcc-0.9.26/win32/lib/crt1.c +34 -0
- data/ext/tcc/tcc-0.9.26/win32/lib/dllcrt1.c +13 -0
- data/ext/tcc/tcc-0.9.26/win32/lib/dllmain.c +9 -0
- data/ext/tcc/tcc-0.9.26/win32/lib/gdi32.def +337 -0
- data/ext/tcc/tcc-0.9.26/win32/lib/kernel32.def +765 -0
- data/ext/tcc/tcc-0.9.26/win32/lib/msvcrt.def +1399 -0
- data/ext/tcc/tcc-0.9.26/win32/lib/user32.def +654 -0
- data/ext/tcc/tcc-0.9.26/win32/lib/wincrt1.c +64 -0
- data/ext/tcc/tcc-0.9.26/win32/tcc-win32.txt +156 -0
- data/ext/tcc/tcc-0.9.26/win32/tools/tiny_impdef.c +243 -0
- data/ext/tcc/tcc-0.9.26/win32/tools/tiny_libmaker.c +258 -0
- data/ext/tcc/tcc-0.9.26/x86_64-asm.h +448 -0
- data/ext/tcc/tcc-0.9.26/x86_64-gen.c +1701 -0
- data/lib/tcc.rb +291 -0
- data/tcc.gemspec +15 -0
- metadata +343 -0
@@ -0,0 +1,64 @@
|
|
1
|
+
//+---------------------------------------------------------------------------
|
2
|
+
|
3
|
+
#include <windows.h>
|
4
|
+
#include <stdlib.h>
|
5
|
+
|
6
|
+
#define __UNKNOWN_APP 0
|
7
|
+
#define __CONSOLE_APP 1
|
8
|
+
#define __GUI_APP 2
|
9
|
+
void __set_app_type(int);
|
10
|
+
void _controlfp(unsigned a, unsigned b);
|
11
|
+
|
12
|
+
int _winstart(void)
|
13
|
+
{
|
14
|
+
__TRY__
|
15
|
+
char *szCmd;
|
16
|
+
STARTUPINFO startinfo;
|
17
|
+
int fShow;
|
18
|
+
int ret;
|
19
|
+
|
20
|
+
__set_app_type(__GUI_APP);
|
21
|
+
_controlfp(0x10000, 0x30000);
|
22
|
+
|
23
|
+
szCmd = GetCommandLine();
|
24
|
+
if (szCmd) {
|
25
|
+
while (' ' == *szCmd)
|
26
|
+
szCmd++;
|
27
|
+
if ('\"' == *szCmd) {
|
28
|
+
while (*++szCmd)
|
29
|
+
if ('\"' == *szCmd) {
|
30
|
+
szCmd++;
|
31
|
+
break;
|
32
|
+
}
|
33
|
+
} else {
|
34
|
+
while (*szCmd && ' ' != *szCmd)
|
35
|
+
szCmd++;
|
36
|
+
}
|
37
|
+
while (' ' == *szCmd)
|
38
|
+
szCmd++;
|
39
|
+
}
|
40
|
+
|
41
|
+
GetStartupInfo(&startinfo);
|
42
|
+
fShow = startinfo.wShowWindow;
|
43
|
+
if (0 == (startinfo.dwFlags & STARTF_USESHOWWINDOW))
|
44
|
+
fShow = SW_SHOWDEFAULT;
|
45
|
+
|
46
|
+
ret = WinMain(GetModuleHandle(NULL), NULL, szCmd, fShow);
|
47
|
+
exit(ret);
|
48
|
+
}
|
49
|
+
|
50
|
+
int _runwinmain(int argc, char **argv)
|
51
|
+
{
|
52
|
+
char *szCmd, *p;
|
53
|
+
|
54
|
+
p = GetCommandLine();
|
55
|
+
szCmd = NULL;
|
56
|
+
if (argc > 1)
|
57
|
+
szCmd = strstr(p, argv[1]);
|
58
|
+
if (NULL == szCmd)
|
59
|
+
szCmd = "";
|
60
|
+
else if (szCmd > p && szCmd[-1] == '\"')
|
61
|
+
--szCmd;
|
62
|
+
return WinMain(GetModuleHandle(NULL), NULL, szCmd, SW_SHOWDEFAULT);
|
63
|
+
}
|
64
|
+
|
@@ -0,0 +1,156 @@
|
|
1
|
+
|
2
|
+
TinyCC
|
3
|
+
======
|
4
|
+
|
5
|
+
This file contains specific information for usage of TinyCC
|
6
|
+
under MS-Windows. See tcc-doc.html to have all the features.
|
7
|
+
|
8
|
+
|
9
|
+
Installation from the binary ZIP package:
|
10
|
+
-----------------------------------------
|
11
|
+
Unzip the package to a directory of your choice.
|
12
|
+
|
13
|
+
|
14
|
+
Set the system PATH:
|
15
|
+
--------------------
|
16
|
+
To be able to invoke the compiler from everywhere on your computer by
|
17
|
+
just typing "tcc", please add the directory containing tcc.exe to your
|
18
|
+
system PATH.
|
19
|
+
|
20
|
+
|
21
|
+
Examples:
|
22
|
+
---------
|
23
|
+
Open a console window (DOS box) and 'cd' to the examples directory.
|
24
|
+
|
25
|
+
For the 'Fibonacci' example type:
|
26
|
+
|
27
|
+
tcc fib.c
|
28
|
+
|
29
|
+
For the 'Hello Windows' GUI example type:
|
30
|
+
|
31
|
+
tcc hello_win.c
|
32
|
+
|
33
|
+
For the 'Hello DLL' example type
|
34
|
+
|
35
|
+
tcc -shared dll.c
|
36
|
+
tiny_impdef dll.dll (optional)
|
37
|
+
tcc hello_dll.c dll.def
|
38
|
+
|
39
|
+
|
40
|
+
Using libtcc as JIT compiler in your program
|
41
|
+
--------------------------------------------
|
42
|
+
Check out the 'libtcc_test' example:
|
43
|
+
|
44
|
+
- Running it from source:
|
45
|
+
tcc -I libtcc libtcc/libtcc.def -run examples/libtcc_test.c
|
46
|
+
|
47
|
+
- Compiling with TCC:
|
48
|
+
tcc examples/libtcc_test.c -I libtcc libtcc/libtcc.def
|
49
|
+
|
50
|
+
- Compiling with MinGW:
|
51
|
+
gcc examples/libtcc_test.c -I libtcc libtcc.dll
|
52
|
+
|
53
|
+
- Compiling with MSVC:
|
54
|
+
lib /def:libtcc\libtcc.def /out:libtcc.lib
|
55
|
+
cl /MD examples/libtcc_test.c -I libtcc libtcc.lib
|
56
|
+
|
57
|
+
|
58
|
+
Import Definition Files:
|
59
|
+
------------------------
|
60
|
+
To link with Windows system DLLs, TCC uses import definition
|
61
|
+
files (.def) instead of libraries.
|
62
|
+
|
63
|
+
The included 'tiny_impdef' program may be used to make additional
|
64
|
+
.def files for any DLL. For example:
|
65
|
+
|
66
|
+
tiny_impdef.exe opengl32.dll
|
67
|
+
|
68
|
+
Put opengl32.def into the tcc/lib directory. Specify -lopengl32 at
|
69
|
+
the TCC commandline to link a program that uses opengl32.dll.
|
70
|
+
|
71
|
+
|
72
|
+
Header Files:
|
73
|
+
-------------
|
74
|
+
The system header files (except _mingw.h) are from the MinGW
|
75
|
+
distribution:
|
76
|
+
|
77
|
+
http://www.mingw.org/
|
78
|
+
|
79
|
+
From the windows headers, only a minimal set is included. If you need
|
80
|
+
more, get MinGW's "w32api" package. Extract the files from "include"
|
81
|
+
into your "tcc/include/winapi" directory.
|
82
|
+
|
83
|
+
|
84
|
+
Resource Files:
|
85
|
+
---------------
|
86
|
+
TCC can link windows resources in coff format as generated by MinGW's
|
87
|
+
windres.exe. For example:
|
88
|
+
|
89
|
+
windres -O coff app.rc -o appres.o
|
90
|
+
tcc app.c appres.o -o app.exe
|
91
|
+
|
92
|
+
|
93
|
+
Tiny Libmaker:
|
94
|
+
--------------
|
95
|
+
The included tiny_libmaker tool by Timovj Lahde can be used as
|
96
|
+
'ar' replacement to make a library from several object files:
|
97
|
+
|
98
|
+
tiny_libmaker [rcs] library objectfiles ...
|
99
|
+
|
100
|
+
|
101
|
+
Compilation from source:
|
102
|
+
------------------------
|
103
|
+
* You can use the MinGW and MSYS tools available at
|
104
|
+
|
105
|
+
http://www.mingw.org
|
106
|
+
|
107
|
+
Untar the TCC archive and type in the MSYS shell:
|
108
|
+
|
109
|
+
./configure [--prefix installpath]
|
110
|
+
make
|
111
|
+
make install
|
112
|
+
|
113
|
+
The default install location is c:\Program Files\tcc
|
114
|
+
|
115
|
+
* Alternatively you can compile TCC with just GCC from MinGW using
|
116
|
+
|
117
|
+
build-tcc.bat (from the win32 directory)
|
118
|
+
|
119
|
+
To install, copy the entire contents of the win32 directory to
|
120
|
+
where you want.
|
121
|
+
|
122
|
+
|
123
|
+
Limitations:
|
124
|
+
------------
|
125
|
+
- On the object file level, currently TCC supports only the ELF format,
|
126
|
+
not COFF as used by MinGW and MSVC. It is not possible to exchange
|
127
|
+
object files or libraries between TCC and these compilers. However
|
128
|
+
libraries for TCC from objects by TCC can be made using tiny_libmaker
|
129
|
+
or MinGW's ar.
|
130
|
+
|
131
|
+
- No leading underscore is generated in the ELF symbols.
|
132
|
+
|
133
|
+
- Bounds checking (option -b) is not supported on 64-bit OS.
|
134
|
+
|
135
|
+
|
136
|
+
Documentation and License:
|
137
|
+
--------------------------
|
138
|
+
TCC is distributed under the GNU Lesser General Public License. (See
|
139
|
+
COPYING file or http://www.gnu.org/licenses/lgpl-2.1.html)
|
140
|
+
|
141
|
+
TinyCC homepage is at:
|
142
|
+
|
143
|
+
http://fabrice.bellard.free.fr/tcc/
|
144
|
+
|
145
|
+
|
146
|
+
WinAPI Help and 3rd-party tools:
|
147
|
+
--------------------------------
|
148
|
+
The Windows API documentation (Win95) in a single .hlp file is
|
149
|
+
available on the lcc-win32 site as "win32hlp.exe" or from other
|
150
|
+
locations as "win32hlp_big.zip".
|
151
|
+
|
152
|
+
A nice RAD tool to create windows resources (dialog boxes etc.) is
|
153
|
+
"ResEd", available at the RadASM website.
|
154
|
+
|
155
|
+
|
156
|
+
--- grischka
|
@@ -0,0 +1,243 @@
|
|
1
|
+
/* -------------------------------------------------------------- */
|
2
|
+
/*
|
3
|
+
* tiny_impdef creates an export definition file (.def) from a dll
|
4
|
+
* on MS-Windows. Usage: tiny_impdef library.dll [-o outputfile]"
|
5
|
+
*
|
6
|
+
* Copyright (c) 2005,2007 grischka
|
7
|
+
*
|
8
|
+
* This program is free software; you can redistribute it and/or modify
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
10
|
+
* the Free Software Foundation; either version 2 of the License, or
|
11
|
+
* (at your option) any later version.
|
12
|
+
*
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
* GNU General Public License for more details.
|
17
|
+
*
|
18
|
+
* You should have received a copy of the GNU General Public License
|
19
|
+
* along with this program; if not, write to the Free Software
|
20
|
+
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
21
|
+
*/
|
22
|
+
|
23
|
+
#ifndef TINY_IMPDEF_GET_EXPORT_NAMES_ONLY
|
24
|
+
|
25
|
+
#define WIN32_LEAN_AND_MEAN
|
26
|
+
#include <windows.h>
|
27
|
+
#include <stdio.h>
|
28
|
+
#include <io.h>
|
29
|
+
#include <malloc.h>
|
30
|
+
|
31
|
+
char *get_export_names(int fd);
|
32
|
+
#define tcc_free free
|
33
|
+
#define tcc_realloc realloc
|
34
|
+
|
35
|
+
/* extract the basename of a file */
|
36
|
+
static char *file_basename(const char *name)
|
37
|
+
{
|
38
|
+
const char *p = strchr(name, 0);
|
39
|
+
while (p > name
|
40
|
+
&& p[-1] != '/'
|
41
|
+
&& p[-1] != '\\'
|
42
|
+
)
|
43
|
+
--p;
|
44
|
+
return (char*)p;
|
45
|
+
}
|
46
|
+
|
47
|
+
int main(int argc, char **argv)
|
48
|
+
{
|
49
|
+
int ret, v, i;
|
50
|
+
char infile[MAX_PATH];
|
51
|
+
char outfile[MAX_PATH];
|
52
|
+
|
53
|
+
static const char *ext[] = { ".dll", ".exe", NULL };
|
54
|
+
const char *file, **pp;
|
55
|
+
char path[MAX_PATH], *p, *q;
|
56
|
+
FILE *fp, *op;
|
57
|
+
|
58
|
+
infile[0] = 0;
|
59
|
+
outfile[0] = 0;
|
60
|
+
fp = op = NULL;
|
61
|
+
v = 0;
|
62
|
+
ret = 1;
|
63
|
+
p = NULL;
|
64
|
+
|
65
|
+
for (i = 1; i < argc; ++i) {
|
66
|
+
const char *a = argv[i];
|
67
|
+
if ('-' == a[0]) {
|
68
|
+
if (0 == strcmp(a, "-v")) {
|
69
|
+
v = 1;
|
70
|
+
} else if (0 == strcmp(a, "-o")) {
|
71
|
+
if (++i == argc)
|
72
|
+
goto usage;
|
73
|
+
strcpy(outfile, argv[i]);
|
74
|
+
} else
|
75
|
+
goto usage;
|
76
|
+
} else if (0 == infile[0])
|
77
|
+
strcpy(infile, a);
|
78
|
+
else
|
79
|
+
goto usage;
|
80
|
+
}
|
81
|
+
|
82
|
+
if (0 == infile[0]) {
|
83
|
+
usage:
|
84
|
+
fprintf(stderr,
|
85
|
+
"tiny_impdef: create export definition file (.def) from a dll\n"
|
86
|
+
"Usage: tiny_impdef library.dll [-o outputfile]\n"
|
87
|
+
);
|
88
|
+
goto the_end;
|
89
|
+
}
|
90
|
+
|
91
|
+
if (0 == outfile[0])
|
92
|
+
{
|
93
|
+
strcpy(outfile, file_basename(infile));
|
94
|
+
q = strrchr(outfile, '.');
|
95
|
+
if (NULL == q)
|
96
|
+
q = strchr(outfile, 0);
|
97
|
+
strcpy(q, ".def");
|
98
|
+
}
|
99
|
+
|
100
|
+
file = infile;
|
101
|
+
|
102
|
+
#ifdef _WIN32
|
103
|
+
pp = ext;
|
104
|
+
do if (SearchPath(NULL, file, *pp, sizeof path, path, NULL)) {
|
105
|
+
file = path;
|
106
|
+
break;
|
107
|
+
} while (*pp++);
|
108
|
+
#endif
|
109
|
+
|
110
|
+
fp = fopen(file, "rb");
|
111
|
+
if (NULL == fp) {
|
112
|
+
fprintf(stderr, "tiny_impdef: no such file: %s\n", infile);
|
113
|
+
goto the_end;
|
114
|
+
}
|
115
|
+
if (v)
|
116
|
+
printf("--> %s\n", file);
|
117
|
+
|
118
|
+
p = get_export_names(fileno(fp));
|
119
|
+
if (NULL == p) {
|
120
|
+
fprintf(stderr, "tiny_impdef: could not get exported function names.\n");
|
121
|
+
goto the_end;
|
122
|
+
}
|
123
|
+
|
124
|
+
op = fopen(outfile, "w");
|
125
|
+
if (NULL == op) {
|
126
|
+
fprintf(stderr, "tiny_impdef: could not create output file: %s\n", outfile);
|
127
|
+
goto the_end;
|
128
|
+
}
|
129
|
+
|
130
|
+
fprintf(op, "LIBRARY %s\n\nEXPORTS\n", file_basename(file));
|
131
|
+
for (q = p, i = 0; *q; ++i) {
|
132
|
+
fprintf(op, "%s\n", q);
|
133
|
+
q += strlen(q) + 1;
|
134
|
+
}
|
135
|
+
|
136
|
+
if (v) {
|
137
|
+
printf("<-- %s\n", outfile);
|
138
|
+
printf("%d symbol(s) found\n", i);
|
139
|
+
}
|
140
|
+
|
141
|
+
ret = 0;
|
142
|
+
|
143
|
+
the_end:
|
144
|
+
if (p)
|
145
|
+
free(p);
|
146
|
+
if (fp)
|
147
|
+
fclose(fp);
|
148
|
+
if (op)
|
149
|
+
fclose(op);
|
150
|
+
return ret;
|
151
|
+
}
|
152
|
+
|
153
|
+
int read_mem(int fd, unsigned offset, void *buffer, unsigned len)
|
154
|
+
{
|
155
|
+
lseek(fd, offset, SEEK_SET);
|
156
|
+
return len == read(fd, buffer, len);
|
157
|
+
}
|
158
|
+
|
159
|
+
/* -------------------------------------------------------------- */
|
160
|
+
|
161
|
+
/* -------------------------------------------------------------- */
|
162
|
+
#endif
|
163
|
+
|
164
|
+
char *get_export_names(int fd)
|
165
|
+
{
|
166
|
+
int l, i, n, n0;
|
167
|
+
char *p;
|
168
|
+
|
169
|
+
IMAGE_SECTION_HEADER ish;
|
170
|
+
IMAGE_EXPORT_DIRECTORY ied;
|
171
|
+
IMAGE_DOS_HEADER dh;
|
172
|
+
IMAGE_FILE_HEADER ih;
|
173
|
+
DWORD sig, ref, addr, ptr, namep;
|
174
|
+
#ifdef TCC_TARGET_X86_64
|
175
|
+
IMAGE_OPTIONAL_HEADER64 oh;
|
176
|
+
const int MACHINE = 0x8664;
|
177
|
+
#else
|
178
|
+
IMAGE_OPTIONAL_HEADER32 oh;
|
179
|
+
const int MACHINE = 0x014C;
|
180
|
+
#endif
|
181
|
+
int pef_hdroffset, opt_hdroffset, sec_hdroffset;
|
182
|
+
|
183
|
+
n = n0 = 0;
|
184
|
+
p = NULL;
|
185
|
+
|
186
|
+
if (!read_mem(fd, 0, &dh, sizeof dh))
|
187
|
+
goto the_end;
|
188
|
+
if (!read_mem(fd, dh.e_lfanew, &sig, sizeof sig))
|
189
|
+
goto the_end;
|
190
|
+
if (sig != 0x00004550)
|
191
|
+
goto the_end;
|
192
|
+
pef_hdroffset = dh.e_lfanew + sizeof sig;
|
193
|
+
if (!read_mem(fd, pef_hdroffset, &ih, sizeof ih))
|
194
|
+
goto the_end;
|
195
|
+
if (MACHINE != ih.Machine)
|
196
|
+
goto the_end;
|
197
|
+
opt_hdroffset = pef_hdroffset + sizeof ih;
|
198
|
+
sec_hdroffset = opt_hdroffset + sizeof oh;
|
199
|
+
if (!read_mem(fd, opt_hdroffset, &oh, sizeof oh))
|
200
|
+
goto the_end;
|
201
|
+
|
202
|
+
if (IMAGE_DIRECTORY_ENTRY_EXPORT >= oh.NumberOfRvaAndSizes)
|
203
|
+
goto the_end;
|
204
|
+
|
205
|
+
addr = oh.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
|
206
|
+
//printf("addr: %08x\n", addr);
|
207
|
+
for (i = 0; i < ih.NumberOfSections; ++i) {
|
208
|
+
if (!read_mem(fd, sec_hdroffset + i * sizeof ish, &ish, sizeof ish))
|
209
|
+
goto the_end;
|
210
|
+
//printf("vaddr: %08x\n", ish.VirtualAddress);
|
211
|
+
if (addr >= ish.VirtualAddress && addr < ish.VirtualAddress + ish.SizeOfRawData)
|
212
|
+
goto found;
|
213
|
+
}
|
214
|
+
goto the_end;
|
215
|
+
|
216
|
+
found:
|
217
|
+
ref = ish.VirtualAddress - ish.PointerToRawData;
|
218
|
+
if (!read_mem(fd, addr - ref, &ied, sizeof ied))
|
219
|
+
goto the_end;
|
220
|
+
|
221
|
+
namep = ied.AddressOfNames - ref;
|
222
|
+
for (i = 0; i < ied.NumberOfNames; ++i) {
|
223
|
+
if (!read_mem(fd, namep, &ptr, sizeof ptr))
|
224
|
+
goto the_end;
|
225
|
+
namep += sizeof ptr;
|
226
|
+
for (l = 0;;) {
|
227
|
+
if (n+1 >= n0)
|
228
|
+
p = tcc_realloc(p, n0 = n0 ? n0 * 2 : 256);
|
229
|
+
if (!read_mem(fd, ptr - ref + l, p + n, 1) || ++l >= 80) {
|
230
|
+
tcc_free(p), p = NULL;
|
231
|
+
goto the_end;
|
232
|
+
}
|
233
|
+
if (p[n++] == 0)
|
234
|
+
break;
|
235
|
+
}
|
236
|
+
}
|
237
|
+
if (p)
|
238
|
+
p[n] = 0;
|
239
|
+
the_end:
|
240
|
+
return p;
|
241
|
+
}
|
242
|
+
|
243
|
+
/* -------------------------------------------------------------- */
|