├── VERSION ├── tests ├── pp │ ├── 04.expect │ ├── 06.expect │ ├── 07.expect │ ├── 09.expect │ ├── 08.expect │ ├── 01.expect │ ├── 13.expect │ ├── 16.expect │ ├── 22.expect │ ├── 07.c │ ├── 06.c │ ├── 10.expect │ ├── 16.c │ ├── 18.expect │ ├── 04.c │ ├── 23.expect │ ├── 09.c │ ├── 12.expect │ ├── 14.expect │ ├── 05.expect │ ├── 15.expect │ ├── 17.expect │ ├── 08.c │ ├── 20.expect │ ├── 13.S │ ├── 03.expect │ ├── 19.expect │ ├── 01.c │ ├── 10.c │ ├── 11.expect │ ├── 22.c │ ├── 14.c │ ├── 12.S │ ├── 21.expect │ ├── 05.c │ ├── 02.expect │ ├── pp-counter.expect │ ├── 23.S │ ├── 17.c │ ├── 03.c │ ├── 15.c │ ├── 20.c │ ├── pp-counter.c │ └── 02.c ├── tests2 │ ├── 81_types.expect │ ├── 117_gcc_test.expect │ ├── 129_scopes.expect │ ├── 80_flexarray.expect │ ├── 100_c99array-decls.expect │ ├── 106_pthread.expect │ ├── 106_versym.expect │ ├── 115_bound_setjmp.expect │ ├── 116_bound_setjmp2.expect │ ├── 92_enum_bitfield.expect │ ├── 103_implicit_memmove.expect │ ├── 107_stack_safe.expect │ ├── 110_average.expect │ ├── 111_conversion.expect │ ├── 122_vla_reuse.expect │ ├── 43_void_param.expect │ ├── 48_nested_break.expect │ ├── 64_macro_nesting.expect │ ├── 86_memory-model.expect │ ├── 99_fastcall.expect │ ├── 105_local_extern.expect │ ├── 29_array_address.expect │ ├── 35_sizeof.expect │ ├── 71_macro_empty_arg.expect │ ├── 84_hex-float.expect │ ├── 132_bound_test.expect │ ├── 27_sizeof.expect │ ├── 82_attribs_position.expect │ ├── 85_asm-outside-function.expect │ ├── 00_assignment.expect │ ├── 109_float_struct_calling.expect │ ├── 114_bound_signal.expect │ ├── 12_hashdefine.expect │ ├── 133_old_func.expect │ ├── 135_func_arg_struct_compare.expect │ ├── 14_if.expect │ ├── 39_typedef.expect │ ├── 42_function_pointer.expect │ ├── 55_lshift_type.expect │ ├── 44_scoped_declarations.expect │ ├── 47_switch_return.expect │ ├── 88_codeopt.expect │ ├── 07_function.expect │ ├── 121_struct_return.expect │ ├── 49_bracket_evaluation.expect │ ├── 67_macro_concat.expect │ ├── 91_ptr_longlong_arith32.expect │ ├── 34_array_assignment.expect │ ├── 72_long_long_constant.expect │ ├── 79_vla_continue.expect │ ├── 83_utf8_in_identifiers.expect │ ├── 06_case.expect │ ├── 108_constructor.expect │ ├── 124_atomic_counter.expect │ ├── 137_funcall_struct_args.expect │ ├── 41_hashif.expect │ ├── 78_vla_label.expect │ ├── 01_comment.expect │ ├── 19_pointer_arithmetic.expect │ ├── 20_pointer_comparison.expect │ ├── 17_enum.expect │ ├── 18_include2.h │ ├── 95_bitfields_ms.c │ ├── 130_large_argument.expect │ ├── 13_integer_literals.expect │ ├── 04_for.expect │ ├── 102_alignas.expect │ ├── 26_character_constants.expect │ ├── 51_static.expect │ ├── 05_array.expect │ ├── 45_empty_for.expect │ ├── 46_grep.expect │ ├── 08_while.expect │ ├── 134_double_to_signed.expect │ ├── 09_do_while.expect │ ├── 52_unnamed_enum.expect │ ├── 77_push_pop_macro.expect │ ├── 38_multiple_array_index.expect │ ├── 15_recursion.expect │ ├── 21_char_array.expect │ ├── 31_args.expect │ ├── 54_goto.expect │ ├── 123_vla_bug.expect │ ├── 32_led.expect │ ├── 25_quicksort.expect │ ├── 97_utf8_string_literal.expect │ ├── 03_struct.expect │ ├── 18_include.h │ ├── 94_generic.expect │ ├── 11_precedence.expect │ ├── 18_include.expect │ ├── 127_asm_goto.expect │ ├── 10_pointer.expect │ ├── 119_random_stuff.expect │ ├── 28_strings.expect │ ├── 117_builtins.expect │ ├── 50_logical_second_arg.expect │ ├── 71_macro_empty_arg.c │ ├── 126_bound_global.expect │ ├── 33_ternary_op.expect │ ├── 23_type_coercion.expect │ ├── 98_al_ax_extend.expect │ ├── 16_nesting.expect │ ├── 89_nocode_wanted.expect │ ├── 76_dollars_in_identifiers.expect │ ├── 43_void_param.c │ ├── 83_utf8_in_identifiers.c │ ├── 120_alias.expect │ ├── 37_sprintf.expect │ ├── 64_macro_nesting.c │ ├── 29_array_address.c │ ├── 126_bound_global.c │ ├── 04_for.c │ ├── 24_math_library.expect │ ├── 128_run_atexit.expect │ ├── 105_local_extern.c │ ├── 113_btdll.expect │ ├── 35_sizeof.c │ ├── 02_printf.expect │ ├── 44_scoped_declarations.c │ ├── 87_dead_code.expect │ ├── 12_hashdefine.c │ ├── 85_asm-outside-function.c │ ├── 45_empty_for.c │ ├── 84_hex-float.c │ ├── 67_macro_concat.c │ ├── 00_assignment.c │ ├── 31_args.c │ ├── 37_sprintf.c │ ├── 01_comment.c │ ├── 107_stack_safe.c │ ├── 27_sizeof.c │ ├── 36_array_initialisers.expect │ ├── 91_ptr_longlong_arith32.c │ ├── 111_conversion.c │ ├── 08_while.c │ ├── 09_do_while.c │ ├── 14_if.c │ ├── 131_return_struct_in_reg.expect │ ├── 108_constructor.c │ ├── 15_recursion.c │ ├── 16_nesting.c │ ├── 26_character_constants.c │ ├── 05_array.c │ ├── 13_integer_literals.c │ ├── 34_array_assignment.c │ ├── 136_atomic_gcc_style.expect │ ├── 47_switch_return.c │ ├── 40_stdio.expect │ ├── 72_long_long_constant.c │ ├── 106_pthread.c │ ├── 48_nested_break.c │ ├── 02_printf.c │ ├── 134_double_to_signed.c │ ├── 49_bracket_evaluation.c │ ├── 20_pointer_comparison.c │ ├── 103_implicit_memmove.c │ ├── 133_old_func.c │ ├── 106_versym.c │ ├── 120+_alias.c │ ├── 19_pointer_arithmetic.c │ ├── 137_funcall_struct_args.c │ ├── 07_function.c │ ├── 110_average.c │ ├── 42_function_pointer.c │ ├── 109_float_struct_calling.c │ ├── 51_static.c │ ├── 135_func_arg_struct_compare.c │ ├── 52_unnamed_enum.c │ ├── 06_case.c │ ├── 38_multiple_array_index.c │ ├── 21_char_array.c │ ├── 122_vla_reuse.c │ ├── 50_logical_second_arg.c │ ├── 80_flexarray.c │ ├── 97_utf8_string_literal.c │ ├── 132_bound_test.c │ ├── 113_btdll.c │ └── 36_array_initialisers.c ├── tcctest.h ├── 42test.h └── bug.c ├── win32 ├── cake │ ├── FUNDING.yml │ ├── ownership.md │ ├── cake.url │ └── src │ │ ├── file.c │ │ ├── version.h │ │ ├── include │ │ ├── assert.h │ │ ├── stddef.h │ │ └── assert.h.include │ │ ├── pre_expressions.h │ │ ├── osstream.h │ │ └── error.h ├── include │ ├── unistd.h │ ├── values.h │ ├── stdnoreturn.h │ ├── stdbool.h │ ├── winapi │ │ ├── poppack.h │ │ ├── pshpack1.h │ │ ├── pshpack2.h │ │ ├── pshpack4.h │ │ ├── pshpack8.h │ │ └── ws2ipdef.h │ ├── vadefs.h │ ├── stdarg.h │ ├── mem.h │ ├── varargs.h │ ├── sys │ │ ├── unistd.h │ │ ├── fcntl.h │ │ └── file.h │ ├── stdalign.h │ ├── sec_api │ │ └── crtdbg_s.h │ └── iso646.h ├── include_w32api │ ├── gdiplus.h │ ├── poppack.h │ ├── pshpack1.h │ ├── pshpack2.h │ ├── pshpack4.h │ ├── pshpack8.h │ ├── GL │ │ └── gl.h │ ├── ddk │ │ ├── ndis.h │ │ └── ntifs.h │ ├── ole2ver.h │ ├── lmuseflg.h │ ├── idispids.h │ ├── xprtdefs.h │ ├── winresrc.h │ ├── cplext.h │ ├── isguids.h │ ├── schnlsp.h │ ├── initguid.h │ ├── ntdll.h │ ├── control.h │ ├── exdispid.h │ ├── ks.h │ ├── afxres.h │ ├── vidcap.h │ ├── stm.h │ ├── lmapibuf.h │ ├── wsipx.h │ ├── lm.h │ ├── lmconfig.h │ ├── mpegtype.h │ └── objsafe.h ├── lib_w32api │ ├── wst.def │ ├── directx │ │ ├── dpnet.def │ │ ├── d3dxof.def │ │ ├── dinput8.def │ │ ├── dpvoice.def │ │ ├── dpnaddr.def │ │ ├── dpnlobby.def │ │ ├── dinput.def │ │ ├── ksuser.def │ │ ├── dplayx.def │ │ ├── d3d8.def │ │ ├── ksproxy.def │ │ ├── test.c │ │ ├── d3d9.def │ │ ├── dsound.def │ │ ├── d3dim.def │ │ ├── msdmo.def │ │ ├── ddraw.def │ │ ├── dsetup.def │ │ ├── dxerr8.c │ │ ├── dxerr9.c │ │ ├── d3drm.def │ │ ├── dxerr8w.c │ │ └── dxerr9w.c │ ├── res.rc │ ├── cap.def │ ├── dlcapi.def │ ├── icmui.def │ ├── shfolder.def │ ├── msimg32.def │ ├── vfw32.mri │ ├── aclui.def │ ├── faultrep.def │ ├── quartz.def │ ├── igmpagnt.def │ ├── ddk │ │ ├── apcups.def │ │ ├── mcd.def │ │ ├── dxapi.def │ │ ├── newdev.def │ │ ├── usbcamd.def │ │ └── usbcamd2.def │ ├── winstrm.def │ ├── rasdlg.def │ ├── avicap32.def │ ├── dhcpcsvc.def │ ├── bthprops.def │ ├── url.def │ ├── lz32.def │ ├── olepro32.def │ ├── ws2_32.c │ ├── mfcuia32.def │ ├── userenv.def │ ├── mgmtapi.def │ ├── olesvr32.def │ ├── win32spl.def │ ├── unknwn-uuid.c │ ├── objsafe-uuid.c │ ├── servprov-uuid.c │ ├── vdmdbg.def │ ├── wow32.def │ ├── oleacc.def │ ├── version.def │ ├── mlang-uuid.c │ ├── svrapi.def │ ├── rtm.def │ ├── oleacc-uuid.c │ ├── comdlg32.def │ ├── shobjidl-uuid.c │ ├── mswsock.def │ ├── oledlg.def │ ├── hlguids-uuid.c │ ├── ctl3d32.def │ ├── psapi.def │ ├── powrprof.def │ └── rpcdce4.def ├── tccboot │ ├── test.c │ ├── tccboot │ ├── initrd.img │ ├── qemu-tccboot │ └── example │ │ ├── boot │ │ └── tccargs │ │ └── hello.c ├── tcc.exe ├── cake.exe ├── lib │ ├── crt1w.c │ ├── bcheck.o │ ├── bt-dll.o │ ├── bt-exe.o │ ├── bt-log.o │ ├── wincrt1w.c │ ├── libtcc1.a │ ├── runmain.o │ ├── libtcc1-32.a │ ├── libtcc1-64.a │ ├── dllmain.c │ └── dllcrt1.c ├── libtcc.dll ├── make-tcc.bat ├── include_extn │ ├── ddk │ │ ├── ide.h │ │ ├── ntifs.h │ │ ├── drivinit.h │ │ ├── dxapi.h │ │ ├── warning.h │ │ ├── objerror.h │ │ ├── fltsafe.h │ │ ├── usbkern.h │ │ ├── xmldsodid.h │ │ ├── ieverp.h │ │ ├── d3dhalex.h │ │ ├── dderror.h │ │ ├── atsmedia.h │ │ ├── ntddft.h │ │ ├── polarity.h │ │ ├── ntddbeep.h │ │ ├── isguids.h │ │ └── lmon.h │ ├── sdks │ │ ├── _mingw_directx.h │ │ └── _mingw_ddk.h │ ├── ieeefp.h │ ├── utime.h │ ├── winapi │ │ ├── bh.h │ │ ├── msado15.h │ │ ├── mtsgrp.h │ │ ├── txctx.h │ │ ├── mtsevents.h │ │ ├── objerror.h │ │ ├── scarddat.h │ │ ├── scardmgr.h │ │ ├── scardsrv.h │ │ ├── sspsidl.h │ │ ├── adsdb.h │ │ ├── initguid.h │ │ ├── issperr.h │ │ ├── mtx.h │ │ ├── scode.h │ │ ├── sipbase.h │ │ ├── msterr.h │ │ ├── olectlid.h │ │ ├── schnlsp.h │ │ ├── sspserr.h │ │ ├── ole2ver.h │ │ ├── adoid.h │ │ ├── dvobj.h │ │ ├── compobj.h │ │ ├── dispatch.h │ │ ├── moniker.h │ │ ├── storage.h │ │ ├── lmuseflg.h │ │ ├── activeds.h │ │ ├── blberr.h │ │ ├── wbemidl.h │ │ ├── mspab.h │ │ ├── wab.h │ │ ├── wpftpmsg.h │ │ ├── afxres.h │ │ ├── smpab.h │ │ ├── wppstmsg.h │ │ ├── mdcommsg.h │ │ ├── sspguid.h │ │ ├── cplext.h │ │ ├── rnderr.h │ │ ├── mtxdm.h │ │ ├── minmax.h │ │ ├── polarity.h │ │ ├── wsipx.h │ │ ├── scrptids.h │ │ ├── idispids.h │ │ ├── xmldsodid.h │ │ ├── ieverp.h │ │ ├── wsvns.h │ │ ├── msstkppg.h │ │ ├── winable.h │ │ ├── stllock.h │ │ ├── recguids.h │ │ └── dde.rh │ ├── stdexcpt.h │ ├── sehmap.h │ ├── sys │ │ └── cdefs.h │ ├── libgen.h │ ├── readme.txt │ ├── crtdefs.h │ ├── strings.h │ ├── syslimits.h │ ├── setjmpex.h │ └── ivec.h └── examples │ ├── dll.c │ ├── fib.c │ └── hello_dll.c ├── lib ├── dsohandle.c ├── alloca-arm.S ├── fetch_and_add_riscv64.S ├── fetch_and_add_arm.S └── fetch_and_add_arm64.S ├── tcc_0.9.27 ├── tcc.exe ├── libtcc.dll ├── lib │ ├── libtcc1-32.a │ └── libtcc1-64.a ├── i386-win32-tcc.exe ├── x86_64-win32-tcc.exe ├── include │ ├── values.h │ ├── stdbool.h │ ├── winapi │ │ ├── poppack.h │ │ ├── pshpack1.h │ │ ├── pshpack2.h │ │ ├── pshpack4.h │ │ └── pshpack8.h │ ├── vadefs.h │ ├── mem.h │ ├── varargs.h │ ├── sys │ │ ├── unistd.h │ │ ├── fcntl.h │ │ └── file.h │ └── sec_api │ │ └── crtdbg_s.h └── examples │ ├── dll.c │ ├── fib.c │ └── hello_dll.c ├── examples ├── ex5.c ├── ex1.c └── ex3.c ├── include ├── stdnoreturn.h ├── stdbool.h ├── stdarg.h ├── varargs.h └── stdalign.h ├── config.h └── stab.h /VERSION: -------------------------------------------------------------------------------- 1 | 0.9.28rc -------------------------------------------------------------------------------- /tests/pp/04.expect: -------------------------------------------------------------------------------- 1 | (1) 2 | -------------------------------------------------------------------------------- /tests/pp/06.expect: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /tests/tests2/81_types.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/pp/07.expect: -------------------------------------------------------------------------------- 1 | a 2 | YES 3 | -------------------------------------------------------------------------------- /tests/pp/09.expect: -------------------------------------------------------------------------------- 1 | aaaaoooo 2 | -------------------------------------------------------------------------------- /tests/tests2/117_gcc_test.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tests2/129_scopes.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tests2/80_flexarray.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/pp/08.expect: -------------------------------------------------------------------------------- 1 | (hej.s_s.s_pos) 2 | -------------------------------------------------------------------------------- /tests/tests2/100_c99array-decls.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tests2/106_pthread.expect: -------------------------------------------------------------------------------- 1 | ok 2 | -------------------------------------------------------------------------------- /tests/tests2/106_versym.expect: -------------------------------------------------------------------------------- 1 | ok 2 | -------------------------------------------------------------------------------- /tests/tests2/115_bound_setjmp.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tests2/116_bound_setjmp2.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tests2/92_enum_bitfield.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/pp/01.expect: -------------------------------------------------------------------------------- 1 | char p[] = "x ## y"; 2 | -------------------------------------------------------------------------------- /tests/pp/13.expect: -------------------------------------------------------------------------------- 1 | .text 2 | endtext: 3 | -------------------------------------------------------------------------------- /tests/tests2/103_implicit_memmove.expect: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tests2/107_stack_safe.expect: -------------------------------------------------------------------------------- 1 | 1 2 3 4 -------------------------------------------------------------------------------- /tests/tests2/110_average.expect: -------------------------------------------------------------------------------- 1 | 15 2 2 | -------------------------------------------------------------------------------- /tests/tests2/111_conversion.expect: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /tests/tests2/122_vla_reuse.expect: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /tests/tests2/43_void_param.expect: -------------------------------------------------------------------------------- 1 | yo 2 | -------------------------------------------------------------------------------- /tests/tests2/48_nested_break.expect: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /tests/tests2/64_macro_nesting.expect: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /tests/tests2/86_memory-model.expect: -------------------------------------------------------------------------------- 1 | Ok 2 | -------------------------------------------------------------------------------- /tests/tests2/99_fastcall.expect: -------------------------------------------------------------------------------- 1 | TEST OK 2 | -------------------------------------------------------------------------------- /win32/cake/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: thradams 2 | -------------------------------------------------------------------------------- /tests/tests2/105_local_extern.expect: -------------------------------------------------------------------------------- 1 | f 2 | f 3 | -------------------------------------------------------------------------------- /tests/tests2/29_array_address.expect: -------------------------------------------------------------------------------- 1 | bcdef 2 | -------------------------------------------------------------------------------- /tests/tests2/35_sizeof.expect: -------------------------------------------------------------------------------- 1 | 1 1 2 | 2 2 3 | -------------------------------------------------------------------------------- /tests/tests2/71_macro_empty_arg.expect: -------------------------------------------------------------------------------- 1 | 17 2 | -------------------------------------------------------------------------------- /tests/tests2/84_hex-float.expect: -------------------------------------------------------------------------------- 1 | n+1 = 15 2 | -------------------------------------------------------------------------------- /tests/tests2/132_bound_test.expect: -------------------------------------------------------------------------------- 1 | 42000 2 | 8 3 | -------------------------------------------------------------------------------- /tests/tests2/27_sizeof.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 4 3 | 8 4 | 4 5 | -------------------------------------------------------------------------------- /tests/tests2/82_attribs_position.expect: -------------------------------------------------------------------------------- 1 | 42 2 | 42 3 | -------------------------------------------------------------------------------- /tests/tests2/85_asm-outside-function.expect: -------------------------------------------------------------------------------- 1 | okay 2 | -------------------------------------------------------------------------------- /win32/include/unistd.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /tests/pp/16.expect: -------------------------------------------------------------------------------- 1 | 2 | 16.c:3: warning: A redefined 3 | -------------------------------------------------------------------------------- /tests/tests2/00_assignment.expect: -------------------------------------------------------------------------------- 1 | 42 2 | 64 3 | 12, 34 4 | -------------------------------------------------------------------------------- /tests/tests2/109_float_struct_calling.expect: -------------------------------------------------------------------------------- 1 | 5.000000 2 | -------------------------------------------------------------------------------- /tests/tests2/114_bound_signal.expect: -------------------------------------------------------------------------------- 1 | start 2 | end 3 | -------------------------------------------------------------------------------- /tests/tests2/12_hashdefine.expect: -------------------------------------------------------------------------------- 1 | 12 2 | 12, 24, 36 3 | -------------------------------------------------------------------------------- /tests/tests2/133_old_func.expect: -------------------------------------------------------------------------------- 1 | 4 30 2 | 4 30 3 | 1 4 | -------------------------------------------------------------------------------- /tests/tests2/135_func_arg_struct_compare.expect: -------------------------------------------------------------------------------- 1 | done 2 | -------------------------------------------------------------------------------- /tests/tests2/14_if.expect: -------------------------------------------------------------------------------- 1 | a is true 2 | b is false 3 | -------------------------------------------------------------------------------- /tests/tests2/39_typedef.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 12,34 3 | 12,34 4 | -------------------------------------------------------------------------------- /tests/tests2/42_function_pointer.expect: -------------------------------------------------------------------------------- 1 | yo 24 2 | 42 3 | -------------------------------------------------------------------------------- /tests/tests2/55_lshift_type.expect: -------------------------------------------------------------------------------- 1 | 0 test(s) failed 2 | -------------------------------------------------------------------------------- /tests/pp/22.expect: -------------------------------------------------------------------------------- 1 | A 1 B 2 | X ARG_1 X ARG_2 X ARG_3 X; 3 | -------------------------------------------------------------------------------- /tests/tests2/44_scoped_declarations.expect: -------------------------------------------------------------------------------- 1 | it's all good 2 | -------------------------------------------------------------------------------- /tests/tests2/47_switch_return.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | out 4 | 3 5 | -------------------------------------------------------------------------------- /tests/tests2/88_codeopt.expect: -------------------------------------------------------------------------------- 1 | okay 2 | okay 3 | okay: 42 1 4 | -------------------------------------------------------------------------------- /win32/include_w32api/gdiplus.h: -------------------------------------------------------------------------------- 1 | #include "gdiplus/gdiplus.h" 2 | -------------------------------------------------------------------------------- /tests/tests2/07_function.expect: -------------------------------------------------------------------------------- 1 | 9 2 | 16 3 | a=1234 4 | qfunc() 5 | -------------------------------------------------------------------------------- /tests/tests2/121_struct_return.expect: -------------------------------------------------------------------------------- 1 | 0 1 2 3 1234 2345 2 | 29 3 | -------------------------------------------------------------------------------- /tests/tests2/49_bracket_evaluation.expect: -------------------------------------------------------------------------------- 1 | 12.340000, 56.780000 2 | -------------------------------------------------------------------------------- /tests/tests2/67_macro_concat.expect: -------------------------------------------------------------------------------- 1 | jim: 21, bob: 42 2 | jim: 63 3 | -------------------------------------------------------------------------------- /tests/tests2/91_ptr_longlong_arith32.expect: -------------------------------------------------------------------------------- 1 | data = "0123-5678" 2 | -------------------------------------------------------------------------------- /win32/lib_w32api/wst.def: -------------------------------------------------------------------------------- 1 | LIBRARY WST.DLL 2 | EXPORTS 3 | _penter 4 | -------------------------------------------------------------------------------- /tests/pp/07.c: -------------------------------------------------------------------------------- 1 | #define a() YES 2 | #define b() a 3 | b() 4 | b()() 5 | -------------------------------------------------------------------------------- /tests/tests2/34_array_assignment.expect: -------------------------------------------------------------------------------- 1 | 12 23 34 45 2 | 12 23 34 45 3 | -------------------------------------------------------------------------------- /tests/tests2/72_long_long_constant.expect: -------------------------------------------------------------------------------- 1 | long long constant test ok. 2 | -------------------------------------------------------------------------------- /tests/tests2/79_vla_continue.expect: -------------------------------------------------------------------------------- 1 | OK 2 | OK 3 | OK 4 | OK 5 | OK 6 | -------------------------------------------------------------------------------- /tests/tests2/83_utf8_in_identifiers.expect: -------------------------------------------------------------------------------- 1 | привет=0.1 2 | Lefèvre=2 3 | -------------------------------------------------------------------------------- /win32/tccboot/test.c: -------------------------------------------------------------------------------- 1 | int _start(void) 2 | { 3 | while(1); 4 | } 5 | -------------------------------------------------------------------------------- /tests/pp/06.c: -------------------------------------------------------------------------------- 1 | #define X(a,b, \ 2 | c,d) \ 3 | foo 4 | 5 | X(1,2,3,4) 6 | -------------------------------------------------------------------------------- /tests/tests2/06_case.expect: -------------------------------------------------------------------------------- 1 | 0 2 | 0 3 | 1 4 | 1 5 | 2 6 | 2 7 | 3 8 | 0 9 | -------------------------------------------------------------------------------- /tests/tests2/108_constructor.expect: -------------------------------------------------------------------------------- 1 | constructor 2 | main 3 | destructor 4 | -------------------------------------------------------------------------------- /tests/tests2/124_atomic_counter.expect: -------------------------------------------------------------------------------- 1 | SUCCESS 2 | SUCCESS 3 | SUCCESS 4 | -------------------------------------------------------------------------------- /tests/tests2/137_funcall_struct_args.expect: -------------------------------------------------------------------------------- 1 | x=999.500000 2 | y=999.500000 3 | -------------------------------------------------------------------------------- /tests/tests2/41_hashif.expect: -------------------------------------------------------------------------------- 1 | #include test 2 | b 3 | g 4 | i 5 | p 6 | r 7 | -------------------------------------------------------------------------------- /tests/tests2/78_vla_label.expect: -------------------------------------------------------------------------------- 1 | boom! 2 | boom! 3 | 11 4 | 12 5 | 0 6 | 1 7 | -------------------------------------------------------------------------------- /tests/tests2/01_comment.expect: -------------------------------------------------------------------------------- 1 | Hello 2 | Hello 3 | Hello 4 | Hello 5 | Hello 6 | -------------------------------------------------------------------------------- /tests/tests2/19_pointer_arithmetic.expect: -------------------------------------------------------------------------------- 1 | 42 2 | b is not NULL 3 | c is NULL 4 | -------------------------------------------------------------------------------- /tests/tests2/20_pointer_comparison.expect: -------------------------------------------------------------------------------- 1 | 12 2 | 34 3 | 0 4 | 1 5 | 1 6 | 0 7 | -------------------------------------------------------------------------------- /win32/tcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/tcc.exe -------------------------------------------------------------------------------- /tests/pp/10.expect: -------------------------------------------------------------------------------- 1 | x 2 | x x 3 | x x x x 4 | x x x x x x x x 5 | x x x x x x x x)))) 6 | -------------------------------------------------------------------------------- /tests/pp/16.c: -------------------------------------------------------------------------------- 1 | /* The following should warn */ 2 | #define A ... 3 | #define A <<= 4 | -------------------------------------------------------------------------------- /tests/tests2/17_enum.expect: -------------------------------------------------------------------------------- 1 | 0 1 2 3 54 73 74 75 2 | 12 3 | 54 4 | enum to int: 1 5 | -------------------------------------------------------------------------------- /tests/tests2/18_include2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | printf ("counter %d\n", __COUNTER__); 3 | -------------------------------------------------------------------------------- /tests/tests2/95_bitfields_ms.c: -------------------------------------------------------------------------------- 1 | #define MS_BITFIELDS 1 2 | #include "95_bitfields.c" 3 | -------------------------------------------------------------------------------- /win32/cake.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/cake.exe -------------------------------------------------------------------------------- /win32/include_w32api/poppack.h: -------------------------------------------------------------------------------- 1 | #ifndef RC_INVOKED 2 | #pragma pack(pop) 3 | #endif 4 | -------------------------------------------------------------------------------- /win32/lib/crt1w.c: -------------------------------------------------------------------------------- 1 | #define _UNICODE 1 2 | #define UNICODE 1 3 | #include "crt1.c" 4 | -------------------------------------------------------------------------------- /win32/libtcc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/libtcc.dll -------------------------------------------------------------------------------- /lib/dsohandle.c: -------------------------------------------------------------------------------- 1 | void * __dso_handle __attribute((visibility("hidden"))) = &__dso_handle; 2 | -------------------------------------------------------------------------------- /tcc_0.9.27/tcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/tcc_0.9.27/tcc.exe -------------------------------------------------------------------------------- /tests/pp/18.expect: -------------------------------------------------------------------------------- 1 | X181 1 2 | X182 0 3 | X183 yeah 4 | ABC : a b c 5 | TEST : t e s t 6 | -------------------------------------------------------------------------------- /tests/tests2/130_large_argument.expect: -------------------------------------------------------------------------------- 1 | 1 2 2 | 3 4 5 3 | 13 12 11 10 9 8 7 6 5 4 3 2 1 4 | -------------------------------------------------------------------------------- /tests/tests2/13_integer_literals.expect: -------------------------------------------------------------------------------- 1 | 24680 2 | 342391 3 | 2386092 4 | 2386092 5 | 1365 6 | -------------------------------------------------------------------------------- /win32/include_w32api/pshpack1.h: -------------------------------------------------------------------------------- 1 | #ifndef RC_INVOKED 2 | #pragma pack(push,1) 3 | #endif 4 | -------------------------------------------------------------------------------- /win32/include_w32api/pshpack2.h: -------------------------------------------------------------------------------- 1 | #ifndef RC_INVOKED 2 | #pragma pack(push,2) 3 | #endif 4 | -------------------------------------------------------------------------------- /win32/include_w32api/pshpack4.h: -------------------------------------------------------------------------------- 1 | #ifndef RC_INVOKED 2 | #pragma pack(push,4) 3 | #endif 4 | -------------------------------------------------------------------------------- /win32/include_w32api/pshpack8.h: -------------------------------------------------------------------------------- 1 | #ifndef RC_INVOKED 2 | #pragma pack(push,8) 3 | #endif 4 | -------------------------------------------------------------------------------- /win32/lib/bcheck.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/lib/bcheck.o -------------------------------------------------------------------------------- /win32/lib/bt-dll.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/lib/bt-dll.o -------------------------------------------------------------------------------- /win32/lib/bt-exe.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/lib/bt-exe.o -------------------------------------------------------------------------------- /win32/lib/bt-log.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/lib/bt-log.o -------------------------------------------------------------------------------- /win32/lib/wincrt1w.c: -------------------------------------------------------------------------------- 1 | #define _UNICODE 1 2 | #define UNICODE 1 3 | #include "wincrt1.c" 4 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dpnet.def: -------------------------------------------------------------------------------- 1 | LIBRARY dpnet.dll 2 | EXPORTS 3 | DirectPlay8Create@12 4 | -------------------------------------------------------------------------------- /tcc_0.9.27/libtcc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/tcc_0.9.27/libtcc.dll -------------------------------------------------------------------------------- /tests/pp/04.c: -------------------------------------------------------------------------------- 1 | #define foobar 1 2 | #define C(x,y) x##y 3 | #define D(x) (C(x,bar)) 4 | D(foo) 5 | -------------------------------------------------------------------------------- /tests/pp/23.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 3 3 | 20 4 | 22 5 | 30 6 | 40 "23.S" 7 | 50 "file1" 8 | 60 "file2" 9 | -------------------------------------------------------------------------------- /tests/tests2/04_for.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 | 6 7 | 7 8 | 8 9 | 9 10 | 10 11 | -------------------------------------------------------------------------------- /tests/tests2/102_alignas.expect: -------------------------------------------------------------------------------- 1 | 102_alignas.c:4: warning: type defaults to int 2 | 1 1 1 1 3 | -------------------------------------------------------------------------------- /win32/lib/libtcc1.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/lib/libtcc1.a -------------------------------------------------------------------------------- /win32/lib/runmain.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/lib/runmain.o -------------------------------------------------------------------------------- /win32/lib_w32api/directx/d3dxof.def: -------------------------------------------------------------------------------- 1 | LIBRARY d3dxof.dll 2 | EXPORTS 3 | DirectXFileCreate@4 4 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dinput8.def: -------------------------------------------------------------------------------- 1 | LIBRARY dinput8.dll 2 | EXPORTS 3 | DirectInput8Create@20 4 | -------------------------------------------------------------------------------- /win32/tccboot/tccboot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/tccboot/tccboot -------------------------------------------------------------------------------- /tests/tests2/26_character_constants.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 8 3 | 64 4 | 1 5 | 14 6 | 16 7 | 64 8 | test @ 9 | -------------------------------------------------------------------------------- /tests/tests2/51_static.expect: -------------------------------------------------------------------------------- 1 | 1234 2 | 4567 3 | 4568 4 | 4569 5 | 4570 6 | 1234 7 | 8901 8 | 2345 9 | -------------------------------------------------------------------------------- /win32/cake/ownership.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/cake/ownership.md -------------------------------------------------------------------------------- /win32/lib/libtcc1-32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/lib/libtcc1-32.a -------------------------------------------------------------------------------- /win32/lib/libtcc1-64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/lib/libtcc1-64.a -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dpvoice.def: -------------------------------------------------------------------------------- 1 | LIBRARY dpvoice.dll 2 | EXPORTS 3 | DirectPlayVoiceCreate@12 4 | -------------------------------------------------------------------------------- /tests/pp/09.c: -------------------------------------------------------------------------------- 1 | #define C(a,b,c) a##b##c 2 | #define N(x,y) C(x,_,y) 3 | #define A_O aaaaoooo 4 | N(A,O) 5 | -------------------------------------------------------------------------------- /tests/tests2/05_array.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 4 3 | 9 4 | 16 5 | 25 6 | 36 7 | 49 8 | 64 9 | 81 10 | 100 11 | -------------------------------------------------------------------------------- /tests/tests2/45_empty_for.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 | 6 7 | 7 8 | 8 9 | 9 10 | 10 11 | -------------------------------------------------------------------------------- /tests/tests2/46_grep.expect: -------------------------------------------------------------------------------- 1 | File 46_grep.c: 2 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 3 | 4 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dpnaddr.def: -------------------------------------------------------------------------------- 1 | LIBRARY dpnaddr.dll 2 | EXPORTS 3 | DirectPlay8AddressCreate@12 4 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dpnlobby.def: -------------------------------------------------------------------------------- 1 | LIBRARY dpnlobby.def 2 | EXPORTS 3 | DirectPlay8LobbyCreate@12 4 | -------------------------------------------------------------------------------- /win32/lib_w32api/res.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | STRINGTABLE 4 | { 5 | 100 "Dummy string" 6 | } 7 | -------------------------------------------------------------------------------- /win32/make-tcc.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | build-tcc.bat -c ..\tcc_0.9.27\tcc.exe -v "0.9.28.19fdef4" -t 64 4 | -------------------------------------------------------------------------------- /win32/tccboot/initrd.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/tccboot/initrd.img -------------------------------------------------------------------------------- /tcc_0.9.27/lib/libtcc1-32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/tcc_0.9.27/lib/libtcc1-32.a -------------------------------------------------------------------------------- /tcc_0.9.27/lib/libtcc1-64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/tcc_0.9.27/lib/libtcc1-64.a -------------------------------------------------------------------------------- /tests/pp/12.expect: -------------------------------------------------------------------------------- 1 | 9999: 1: movw (%esi), %bx; .section __ex_table, "a"; .long 9999b, 6001f ; 2 | 6001: 3 | -------------------------------------------------------------------------------- /tests/tests2/08_while.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 2 4 | 3 5 | 5 6 | 8 7 | 13 8 | 21 9 | 34 10 | 55 11 | 89 12 | -------------------------------------------------------------------------------- /tests/tests2/134_double_to_signed.expect: -------------------------------------------------------------------------------- 1 | -1 2 | -1 3 | -2147483648 4 | -2147483648 5 | 10000000000000000000 6 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/ide.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/include_extn/ddk/ide.h -------------------------------------------------------------------------------- /win32/include_w32api/GL/gl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/include_w32api/GL/gl.h -------------------------------------------------------------------------------- /win32/lib_w32api/cap.def: -------------------------------------------------------------------------------- 1 | LIBRARY CAP.DLL 2 | EXPORTS 3 | DumpCAP@0 4 | StartCAP@0 5 | StopCAP@0 6 | _penter 7 | -------------------------------------------------------------------------------- /win32/lib_w32api/dlcapi.def: -------------------------------------------------------------------------------- 1 | LIBRARY DLCAPI.DLL 2 | EXPORTS 3 | AcsLan@8 4 | DlcCallDriver@24 5 | NtAcsLan@16 6 | -------------------------------------------------------------------------------- /win32/lib_w32api/icmui.def: -------------------------------------------------------------------------------- 1 | LIBRARY ICMUI.DLL 2 | EXPORTS 3 | SetupColorMatchingA@4 4 | SetupColorMatchingW@4 5 | -------------------------------------------------------------------------------- /tcc_0.9.27/i386-win32-tcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/tcc_0.9.27/i386-win32-tcc.exe -------------------------------------------------------------------------------- /tcc_0.9.27/x86_64-win32-tcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/tcc_0.9.27/x86_64-win32-tcc.exe -------------------------------------------------------------------------------- /tests/pp/14.expect: -------------------------------------------------------------------------------- 1 | return Z(Z(1,2),2); 2 | return Q(1,2); 3 | return ((A + A) * (A + A)) + ((B * B) + (B * B)); 4 | -------------------------------------------------------------------------------- /tests/tests2/09_do_while.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 2 4 | 3 5 | 5 6 | 8 7 | 13 8 | 21 9 | 34 10 | 55 11 | 89 12 | -------------------------------------------------------------------------------- /tests/tests2/52_unnamed_enum.expect: -------------------------------------------------------------------------------- 1 | a=0 2 | b=1 3 | c=2 4 | e=0 5 | f=1 6 | g=2 7 | i=0 8 | j=1 9 | k=2 10 | -------------------------------------------------------------------------------- /tests/tests2/77_push_pop_macro.expect: -------------------------------------------------------------------------------- 1 | abort = 111 2 | abort = 222 3 | abort = 333 4 | abort = 222 5 | abort = 111 6 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/ntifs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/include_extn/ddk/ntifs.h -------------------------------------------------------------------------------- /win32/include_w32api/ddk/ndis.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/include_w32api/ddk/ndis.h -------------------------------------------------------------------------------- /win32/lib_w32api/shfolder.def: -------------------------------------------------------------------------------- 1 | LIBRARY SHFOLDER.DLL 2 | EXPORTS 3 | SHGetFolderPathA@20 4 | SHGetFolderPathW@20 5 | -------------------------------------------------------------------------------- /tests/pp/05.expect: -------------------------------------------------------------------------------- 1 | int j[] = { 123, 45, 67, 89, 2 | 10, 11, 12, }; 3 | int j[] = { 123, 45, 67, 89, 10, 11, 12, }; 4 | -------------------------------------------------------------------------------- /tests/pp/15.expect: -------------------------------------------------------------------------------- 1 | return (long double)d; 2 | return A+++B; 3 | return A+ ++B; 4 | return A+++ +B; 5 | return 0x1E -1; 6 | -------------------------------------------------------------------------------- /tests/tests2/38_multiple_array_index.expect: -------------------------------------------------------------------------------- 1 | x=0: 1 2 3 4 2 | x=1: 5 6 7 8 3 | x=2: 9 10 11 12 4 | x=3: 13 14 15 16 5 | -------------------------------------------------------------------------------- /win32/include_w32api/ddk/ntifs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kochise/tinycc_win32/HEAD/win32/include_w32api/ddk/ntifs.h -------------------------------------------------------------------------------- /tests/tests2/15_recursion.expect: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 6 4 | 24 5 | 120 6 | 720 7 | 5040 8 | 40320 9 | 362880 10 | 3628800 11 | -------------------------------------------------------------------------------- /tests/tests2/21_char_array.expect: -------------------------------------------------------------------------------- 1 | hello 2 | h: 104 3 | e: 101 4 | l: 108 5 | l: 108 6 | o: 111 7 | copied string is hello 8 | -------------------------------------------------------------------------------- /tests/tests2/31_args.expect: -------------------------------------------------------------------------------- 1 | hello world 6 2 | arg 1: arg1 3 | arg 2: arg2 4 | arg 3: arg3 5 | arg 4: arg4 6 | arg 5: arg5 7 | -------------------------------------------------------------------------------- /tests/tests2/54_goto.expect: -------------------------------------------------------------------------------- 1 | In fred() 2 | At end 3 | In joe() 4 | c = 1234 5 | done 6 | In henry() 7 | b = 1234 8 | done 9 | -------------------------------------------------------------------------------- /win32/lib_w32api/msimg32.def: -------------------------------------------------------------------------------- 1 | LIBRARY MSIMG32.DLL 2 | EXPORTS 3 | AlphaBlend@44 4 | GradientFill@24 5 | TransparentBlt@44 6 | -------------------------------------------------------------------------------- /tests/pp/17.expect: -------------------------------------------------------------------------------- 1 | X162 "onetok" 2 | X161 "onetok" 3 | X163 "one##tok" 4 | X170 x ## y 5 | X171 x ## y 6 | X180 return Z(Z(1)); 7 | -------------------------------------------------------------------------------- /tests/tests2/123_vla_bug.expect: -------------------------------------------------------------------------------- 1 | default: i = 0 2 | reached 3 3 | after do_cmddefault: i = 2 4 | default: i = 3 5 | default: i = 4 6 | -------------------------------------------------------------------------------- /tests/tests2/32_led.expect: -------------------------------------------------------------------------------- 1 | _ _ _ _ 2 | | _| _| |_| |_ |_ | 3 | | |_ _| | _| |_| | 4 | 5 | -------------------------------------------------------------------------------- /tests/pp/08.c: -------------------------------------------------------------------------------- 1 | // test macro expansion in arguments 2 | #define s_pos s_s.s_pos 3 | #define foo(x) (x) 4 | foo(hej.s_pos) 5 | -------------------------------------------------------------------------------- /tests/tests2/25_quicksort.expect: -------------------------------------------------------------------------------- 1 | 62 83 4 89 36 21 74 37 65 33 96 38 53 16 74 55 2 | 4 16 21 33 36 37 38 53 55 62 65 74 74 83 89 96 3 | -------------------------------------------------------------------------------- /win32/lib_w32api/vfw32.mri: -------------------------------------------------------------------------------- 1 | CREATE libvfw32.a 2 | ADDLIB libmsvfw32.a 3 | ADDLIB libavicap32.a 4 | ADDLIB libavifil32.a 5 | SAVE 6 | END 7 | -------------------------------------------------------------------------------- /examples/ex5.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | printf("Hello World\n"); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /tests/tests2/97_utf8_string_literal.expect: -------------------------------------------------------------------------------- 1 | 0068 0065 006C 006C 006F 0024 0024 4F60 597D 00A2 00A2 4E16 754C 20AC 20AC 0077 006F 0072 006C 0064 2 | -------------------------------------------------------------------------------- /win32/lib_w32api/aclui.def: -------------------------------------------------------------------------------- 1 | LIBRARY ACLUI.dll 2 | 3 | EXPORTS 4 | CreateSecurityPage@4 5 | EditSecurity@8 6 | IID_ISecurityInformation DATA 7 | 8 | -------------------------------------------------------------------------------- /win32/lib_w32api/faultrep.def: -------------------------------------------------------------------------------- 1 | LIBRARY faultrep.DLL 2 | EXPORTS 3 | AddERExcludedApplicationA@4 4 | AddERExcludedApplicationW@4 5 | ReportFault@8 6 | -------------------------------------------------------------------------------- /examples/ex1.c: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/tcc -run 2 | #include 3 | 4 | int main() 5 | { 6 | printf("Hello World\n"); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /tests/tests2/03_struct.expect: -------------------------------------------------------------------------------- 1 | 03_struct.c:14: warning: attribute '__cleanup__' ignored on type 2 | 12 3 | 34 4 | 12 5 | 34 6 | 56 7 | 78 8 | ~fred() 9 | -------------------------------------------------------------------------------- /tests/tests2/18_include.h: -------------------------------------------------------------------------------- 1 | printf("included\n"); 2 | /* test file with missing newline */ 3 | #ifndef INCLUDE 4 | #define INCLUDE 5 | #endif /* INCLUDE */ -------------------------------------------------------------------------------- /tests/tests2/94_generic.expect: -------------------------------------------------------------------------------- 1 | 20 2 | 10 3 | 20 4 | 123 5 | 2 6 | 0 7 | 5 8 | 1 9 | 2 10 | 3 11 | 4 12 | long 13 | 1 14 | 3 15 | 5 16 | 1 17 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dinput.def: -------------------------------------------------------------------------------- 1 | LIBRARY dinput.dll 2 | EXPORTS 3 | DirectInputCreateA@16 4 | DirectInputCreateEx@20 5 | DirectInputCreateW@16 6 | -------------------------------------------------------------------------------- /win32/lib_w32api/quartz.def: -------------------------------------------------------------------------------- 1 | LIBRARY quartz.dll 2 | EXPORTS 3 | AMGetErrorTextA@12 4 | AMGetErrorTextW@12 5 | AmpFactorToDB@4 6 | DBToAmpFactor@4 7 | 8 | -------------------------------------------------------------------------------- /tests/pp/20.expect: -------------------------------------------------------------------------------- 1 | X1 printk(KERN_WARNING "pipapo",bla); 2 | X2 printk(KERN_WARNING "bla",foo); 3 | X2 twoopq 4 | X3 otwopq 5 | X4 optwoq 6 | X5 opqtwo 7 | -------------------------------------------------------------------------------- /tests/tests2/11_precedence.expect: -------------------------------------------------------------------------------- 1 | 134 2 | 134 3 | 0 4 | 1 5 | 1 6 | 1 7 | 1 8 | 46 9 | 1, 0 10 | 0, 1 11 | 1 12 | 1916 13 | 1916 14 | 64 15 | 4 16 | -------------------------------------------------------------------------------- /tests/tests2/18_include.expect: -------------------------------------------------------------------------------- 1 | including 2 | included 3 | done 4 | has_include 5 | has_include 6 | has_include_next 7 | has_include_next 8 | counter 0 9 | -------------------------------------------------------------------------------- /win32/cake/cake.url: -------------------------------------------------------------------------------- 1 | [{000214A0-0000-0000-C000-000000000046}] 2 | Prop3=19,11 3 | [InternetShortcut] 4 | IDList= 5 | URL=https://github.com/thradams/cake 6 | -------------------------------------------------------------------------------- /win32/include_extn/sdks/_mingw_directx.h: -------------------------------------------------------------------------------- 1 | #ifndef MINGW_HAS_DDRAW_H 2 | 3 | #define MINGW_HAS_DDRAW_H 1 4 | #define MINGW_DDRAW_VERSION 7 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /tests/tests2/127_asm_goto.expect: -------------------------------------------------------------------------------- 1 | simple_jump: okay 2 | another_jump: okay 3 | three_way_jump(0): okay 4 | three_way_jump(1): okay 5 | three_way_jump(-1): okay 6 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/drivinit.h: -------------------------------------------------------------------------------- 1 | 2 | /* This are empty and is left for be compatible with building some older windows nt4/2000/2003/XP drivers */ 3 | 4 | 5 | -------------------------------------------------------------------------------- /win32/include_extn/sdks/_mingw_ddk.h: -------------------------------------------------------------------------------- 1 | #ifndef MINGW_HAS_DDK_H 2 | 3 | #define MINGW_HAS_DDK_H 1 4 | /* DDK Version of ReactOS rev40585. */ 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/ksuser.def: -------------------------------------------------------------------------------- 1 | LIBRARY ksuser.dll 2 | EXPORTS 3 | KsCreateAllocator@12 4 | KsCreateClock@12 5 | KsCreatePin@16 6 | KsCreateTopologyNode@16 7 | -------------------------------------------------------------------------------- /win32/include/values.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TODO: Nothing here yet. Should provide UNIX compatibility constants 3 | * comparable to those in limits.h and float.h. 4 | */ 5 | -------------------------------------------------------------------------------- /win32/lib_w32api/igmpagnt.def: -------------------------------------------------------------------------------- 1 | LIBRARY igmpagnt.dll 2 | EXPORTS 3 | SnmpExtensionClose@0 4 | SnmpExtensionInit@12 5 | SnmpExtensionQuery@16 6 | SnmpExtensionTrap@20 7 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/values.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TODO: Nothing here yet. Should provide UNIX compatibility constants 3 | * comparable to those in limits.h and float.h. 4 | */ 5 | -------------------------------------------------------------------------------- /include/stdnoreturn.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDNORETURN_H 2 | #define _STDNORETURN_H 3 | 4 | /* ISOC11 noreturn */ 5 | #define noreturn _Noreturn 6 | 7 | #endif /* _STDNORETURN_H */ 8 | -------------------------------------------------------------------------------- /tests/tests2/10_pointer.expect: -------------------------------------------------------------------------------- 1 | a = 42 2 | bolshevic.a = 12 3 | bolshevic.b = 34 4 | bolshevic.c = 56 5 | tsar->a = 12 6 | tsar->b = 34 7 | tsar->c = 56 8 | bolshevic.b = 34 9 | -------------------------------------------------------------------------------- /win32/cake/src/file.c: -------------------------------------------------------------------------------- 1 | 2 | struct X { 3 | int x; 4 | }; 5 | 6 | int main() { 7 | constexpr struct X x = (struct X){ .x = 50 }; 8 | static_assert(x.x == 50); 9 | } -------------------------------------------------------------------------------- /win32/lib_w32api/ddk/apcups.def: -------------------------------------------------------------------------------- 1 | LIBRARY apcups.dll 2 | EXPORTS 3 | UPSCancelWait@0 4 | UPSGetState@0 5 | UPSInit@0 6 | UPSStop@0 7 | UPSTurnOff@4 8 | UPSWaitForStateChange@8 9 | -------------------------------------------------------------------------------- /win32/lib_w32api/winstrm.def: -------------------------------------------------------------------------------- 1 | LIBRARY WINSTRM.DLL 2 | EXPORTS 3 | OpenStream@4 4 | getmsg@16 5 | poll@12 6 | putmsg@16 7 | s_ioctl@12 8 | s_open@12 9 | s_perror@8 10 | -------------------------------------------------------------------------------- /tests/pp/13.S: -------------------------------------------------------------------------------- 1 | # `modelist' label. Each video mode record looks like: 2 | #ifdef AAA 3 | # modelist' label. Each video mode record looks like: 4 | #endif 5 | .text 6 | endtext: 7 | -------------------------------------------------------------------------------- /win32/include/stdnoreturn.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDNORETURN_H 2 | #define _STDNORETURN_H 3 | 4 | /* ISOC11 noreturn */ 5 | #define noreturn _Noreturn 6 | 7 | #endif /* _STDNORETURN_H */ 8 | -------------------------------------------------------------------------------- /tests/tests2/119_random_stuff.expect: -------------------------------------------------------------------------------- 1 | tst_branch -- -- 2 | tst_adr 5 3 | tst_compare: ok 4 | tst_pack: j.f = 5, i.f = 5 5 | schar to ushort cast: ffff0033 6 | tst_indir_func 10 7 | 5 8 | -------------------------------------------------------------------------------- /win32/include_w32api/ole2ver.h: -------------------------------------------------------------------------------- 1 | #ifndef _OLE2VER_H 2 | #define _OLE2VER_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | #define rmm 23 7 | #define rup 639 8 | #endif 9 | -------------------------------------------------------------------------------- /win32/lib_w32api/rasdlg.def: -------------------------------------------------------------------------------- 1 | LIBRARY RASDLG.DLL 2 | EXPORTS 3 | RasDialDlgA@16 4 | RasDialDlgW@16 5 | RasEntryDlgA@12 6 | RasEntryDlgW@12 7 | RasPhonebookDlgA@12 8 | RasPhonebookDlgW@12 9 | -------------------------------------------------------------------------------- /config.h: -------------------------------------------------------------------------------- 1 | #define TCC_VERSION "0.9.28.19fdef4" 2 | #define TCC_GITHASH "2022-04-17_master@78d337c*" 3 | #ifdef TCC_TARGET_I386 4 | #define CONFIG_TCC_CROSSPREFIX "i386-win32-" 5 | #endif 6 | -------------------------------------------------------------------------------- /tests/tests2/28_strings.expect: -------------------------------------------------------------------------------- 1 | hello 2 | gollo 3 | 1 4 | 1 5 | 1 6 | 5 7 | gollo! 8 | 1 9 | 1 10 | 1 11 | 1 12 | ollo! 13 | lo! 14 | 1 15 | grrrr! 16 | grgrr! 17 | 1 18 | 1 19 | 1 20 | -------------------------------------------------------------------------------- /tests/pp/03.expect: -------------------------------------------------------------------------------- 1 | printf("x" "1" "= %d, x" "2" "= %s", x1, x2); 2 | fputs("strncmp(\"abc\\0d\", \"abc\", '\\4') == 0" ": @\n", s); 3 | \#include "vers2.h" 4 | "hello"; 5 | "hello" ", world" 6 | -------------------------------------------------------------------------------- /tests/pp/19.expect: -------------------------------------------------------------------------------- 1 | X92 M_IFI_1 2 | X93 KO 3 | X94 KO 4 | X95 a 5 | X96 M_IFI_1 6 | X97 ok 7 | X98 (1)(ok, nok) 8 | X99 ok 9 | X1 ok 10 | X2 1 11 | X3 ok 12 | X4 1 13 | X5 nok 14 | X6 ok 15 | -------------------------------------------------------------------------------- /win32/include_extn/ieeefp.h: -------------------------------------------------------------------------------- 1 | #ifndef _IEEEFP_H_ 2 | #define _IEEEFP_H_ 3 | 4 | #include <_mingw.h> 5 | #include 6 | #include 7 | 8 | #endif /* _IEEE_FP_H_ */ 9 | 10 | -------------------------------------------------------------------------------- /tests/pp/01.c: -------------------------------------------------------------------------------- 1 | #define hash_hash # ## # 2 | #define mkstr(a) # a 3 | #define in_between(a) mkstr(a) 4 | #define join(c, d) in_between(c hash_hash d) 5 | char p[] = join(x, y); 6 | // char p[] = "x ## y"; 7 | -------------------------------------------------------------------------------- /tests/tests2/117_builtins.expect: -------------------------------------------------------------------------------- 1 | BOUNDS OFF: 2 | 1:1 2:1 3:1 4:1 5:1 6:1 7:1 8:1 9:1 10:1 11:1 12:1 13:1 14:1 15:1 3 | BOUNDS ON: 4 | 1:1 2:1 3:1 4:1 5:1 6:1 7:1 8:1 9:1 10:1 11:1 12:1 13:1 14:1 15:1 5 | -------------------------------------------------------------------------------- /lib/alloca-arm.S: -------------------------------------------------------------------------------- 1 | .text 2 | .align 2 3 | .global alloca 4 | .type alloca, %function 5 | alloca: 6 | rsb sp, r0, sp 7 | bic sp, sp, #7 8 | mov r0, sp 9 | mov pc, lr 10 | .size alloca, .-alloca 11 | -------------------------------------------------------------------------------- /tests/pp/10.c: -------------------------------------------------------------------------------- 1 | #define f(x) x 2 | #define g(x) f(x) f(x 3 | #define i(x) g(x)) g(x 4 | #define h(x) i(x))) i(x 5 | #define k(x) i(x))) i(x)))) 6 | f(x) 7 | g(x)) 8 | i(x))) 9 | h(x)))) 10 | k(x)))) 11 | -------------------------------------------------------------------------------- /tests/tests2/50_logical_second_arg.expect: -------------------------------------------------------------------------------- 1 | fred 2 | 0 3 | fred 4 | joe 5 | 1 6 | joe 7 | fred 8 | 0 9 | joe 10 | 1 11 | fred 12 | 0 13 | fred 14 | joe 15 | 1 16 | joe 17 | fred 18 | 0 19 | joe 20 | 1 21 | -------------------------------------------------------------------------------- /tests/tests2/71_macro_empty_arg.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define T(a,b,c) a b c 4 | 5 | int main(void) 6 | { 7 | printf("%d", T(1,+,2) T(+,,) T(,2,*) T(,7,) T(,,)); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /win32/cake/src/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of cake compiler 3 | * https://github.com/thradams/cake 4 | */ 5 | 6 | #pragma once 7 | 8 | #define CAKE_VERSION "0.10.42" 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/dxapi.h: -------------------------------------------------------------------------------- 1 | 2 | ULONG DxApiGetVersion(); 3 | ULONG DxApi( IN ULONG dwFunctionNum,IN PVOID lpvInBuffer, IN ULONG cbInBuffer, 4 | IN PVOID lpvOutBuffer, IN ULONG cbOutBuffer); 5 | -------------------------------------------------------------------------------- /tests/tests2/126_bound_global.expect: -------------------------------------------------------------------------------- 1 | 126_bound_global.c:11: at main: BCHECK: ........ (size 4) is outside of the region (..................) 2 | 126_bound_global.c:11: at main: RUNTIME ERROR: invalid memory access 3 | -------------------------------------------------------------------------------- /win32/lib_w32api/ddk/mcd.def: -------------------------------------------------------------------------------- 1 | LIBRARY mcd.sys 2 | EXPORTS 3 | ChangerClassAllocatePool@8 4 | ChangerClassDebugPrint@8 5 | ChangerClassFreePool@4 6 | ChangerClassInitialize@12 7 | ChangerClassSendSrbSynchronous@20 8 | -------------------------------------------------------------------------------- /win32/tccboot/qemu-tccboot: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ~/qemu-current/i386-softmmu/qemu -snapshot -user-net -serial stdio \ 3 | -kernel tccboot \ 4 | -initrd initrd.img \ 5 | -append "root=/dev/hda" \ 6 | -hda example.romfs 7 | -------------------------------------------------------------------------------- /tests/tcctest.h: -------------------------------------------------------------------------------- 1 | static inline const char *get_basefile_from_header(void) 2 | { 3 | return __BASE_FILE__; 4 | } 5 | 6 | static inline const char *get_file_from_header(void) 7 | { 8 | return __FILE__; 9 | } 10 | -------------------------------------------------------------------------------- /tests/tests2/33_ternary_op.expect: -------------------------------------------------------------------------------- 1 | 33_ternary_op.c:26: warning: pointer/integer mismatch in conditional expression 2 | 0 3 | 1 4 | 4 5 | 9 6 | 16 7 | 15 8 | 18 9 | 21 10 | 24 11 | 27 12 | 152 13 | okay 14 | 1 15 | -------------------------------------------------------------------------------- /tests/tests2/23_type_coercion.expect: -------------------------------------------------------------------------------- 1 | char: a 2 | char: b 3 | char: c 4 | int: 97 5 | int: 98 6 | int: 99 7 | float: 97.000000 8 | float: 98.000000 9 | float: 99.000000 10 | 97 97 11 | 97 97 12 | 97.000000 97.000000 13 | -------------------------------------------------------------------------------- /tests/tests2/98_al_ax_extend.expect: -------------------------------------------------------------------------------- 1 | 0000ABCE 0000ABCE 2 | FFFFABCE FFFFABCE 3 | 000000CE 000000CE 4 | FFFFFFCE FFFFFFCE 5 | 6 | 0000ABCE 0000ABCE 7 | FFFFABCE FFFFABCE 8 | 000000CE 000000CE 9 | FFFFFFCE FFFFFFCE 10 | -------------------------------------------------------------------------------- /tests/pp/11.expect: -------------------------------------------------------------------------------- 1 | a 2 | a b 3 | a b c 4 | a b c d 5 | x a b c d y 6 | x a b c y 7 | x a b y 8 | x a y 9 | x y 10 | x A,B,C y 11 | x A,B y 12 | x A y 13 | x y 14 | __attribute__((__noreturn__)) 15 | 1 2 16 | D_B_D_A 17 | -------------------------------------------------------------------------------- /tests/tests2/16_nesting.expect: -------------------------------------------------------------------------------- 1 | 0 0 0 2 | 0 0 1 3 | 0 0 2 4 | 0 1 0 5 | 0 1 1 6 | 0 1 2 7 | 0 2 0 8 | 0 2 1 9 | 0 2 2 10 | 1 0 0 11 | 1 0 1 12 | 1 0 2 13 | 1 1 0 14 | 1 1 1 15 | 1 1 2 16 | 1 2 0 17 | 1 2 1 18 | 1 2 2 19 | -------------------------------------------------------------------------------- /win32/lib_w32api/avicap32.def: -------------------------------------------------------------------------------- 1 | LIBRARY AVICAP32.DLL 2 | EXPORTS 3 | videoThunk32@20 4 | capGetDriverDescriptionW@20 5 | capGetDriverDescriptionA@20 6 | capCreateCaptureWindowW@32 7 | capCreateCaptureWindowA@32 8 | AppCleanup@4 9 | -------------------------------------------------------------------------------- /win32/lib_w32api/ddk/dxapi.def: -------------------------------------------------------------------------------- 1 | LIBRARY dxapi.sys 2 | EXPORTS 3 | ;_DxApi@20 4 | ;_DxApiGetVersion@0 5 | ;_DxApiInitialize@32 6 | ;_DxAutoflipUpdate@20 7 | ;_DxEnableIRQ@8 8 | ;_DxLoseObject@8 9 | ;_DxUpdateCapture@12 10 | -------------------------------------------------------------------------------- /tests/tests2/89_nocode_wanted.expect: -------------------------------------------------------------------------------- 1 | begin 2 | timeout=2 3 | timeout=1 4 | timeout=2 5 | timeout=1 6 | timeout=2 7 | timeout=1 8 | timeout=2 9 | timeout=1 10 | timeout=2 11 | timeout=1 12 | timeout=2 13 | timeout=1 14 | end 15 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dplayx.def: -------------------------------------------------------------------------------- 1 | LIBRARY dplayx.dll 2 | EXPORTS 3 | DirectPlayCreate@12 4 | DirectPlayEnumerate@8 5 | DirectPlayEnumerateA@8 6 | DirectPlayEnumerateW@8 7 | DirectPlayLobbyCreateA@20 8 | DirectPlayLobbyCreateW@20 9 | -------------------------------------------------------------------------------- /win32/lib_w32api/dhcpcsvc.def: -------------------------------------------------------------------------------- 1 | LIBRARY DHCPCSVC.DLL 2 | EXPORTS 3 | DhcpCApiCleanup@0 4 | DhcpCApiInitialize@4 5 | DhcpDeRegisterParamChange@12 6 | DhcpRegisterParamChange@28 7 | DhcpRemoveDNSRegistrations@0 8 | DhcpUndoRequestParams@16 9 | -------------------------------------------------------------------------------- /tests/pp/22.c: -------------------------------------------------------------------------------- 1 | #define TRACE(a,b,c) X a X b X c X 2 | #define rettrue(x) 1 3 | A rettrue(bla) B 4 | TRACE( 5 | ARG_1, 6 | #if rettrue(bla) 7 | ARG_2, 8 | #else 9 | ARG_2_wrong, 10 | #endif 11 | ARG_3 12 | ); 13 | -------------------------------------------------------------------------------- /tests/tests2/76_dollars_in_identifiers.expect: -------------------------------------------------------------------------------- 1 | fred=10 2 | joe=20 3 | henry=30 4 | fred2=10 5 | joe2=20 6 | henry2=30 7 | fred10=100 8 | joe_10=2 9 | local=10 10 | a100$=100 11 | a$$=1000 12 | a$c$b=2121 13 | $100=10000 14 | $$$=money 15 | -------------------------------------------------------------------------------- /win32/lib_w32api/bthprops.def: -------------------------------------------------------------------------------- 1 | LIBRARY BTHPROPS.CPL 2 | EXPORTS 3 | BluetoothFindFirstRadio@8 4 | BluetoothFindFirstDevice@8 5 | BluetoothFindNextDevice@8 6 | BluetoothFindDeviceClose@4 7 | BluetoothFindNextRadio@8 8 | BluetoothFindRadioClose@4 9 | -------------------------------------------------------------------------------- /win32/lib_w32api/url.def: -------------------------------------------------------------------------------- 1 | LIBRARY URL.DLL 2 | EXPORTS 3 | URLAssociationDialogW@24 4 | URLAssociationDialogA@24 5 | TranslateURLW@12 6 | TranslateURLA@12 7 | MIMEAssociationDialogW@24 8 | MIMEAssociationDialogA@24 9 | InetIsOffline@4 10 | -------------------------------------------------------------------------------- /include/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | /* ISOC99 boolean */ 5 | 6 | #define bool _Bool 7 | #define true 1 8 | #define false 0 9 | #define __bool_true_false_are_defined 1 10 | 11 | #endif /* _STDBOOL_H */ 12 | -------------------------------------------------------------------------------- /tests/tests2/43_void_param.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void fred(void) 4 | { 5 | printf("yo\n"); 6 | } 7 | 8 | int main() 9 | { 10 | fred(); 11 | 12 | return 0; 13 | } 14 | 15 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 16 | -------------------------------------------------------------------------------- /tests/tests2/83_utf8_in_identifiers.c: -------------------------------------------------------------------------------- 1 | #include 2 | double привет=0.1; 3 | int Lefèvre=2; 4 | int main(){ 5 | printf("привет=%g\n",привет); 6 | printf("Lefèvre=%d\n",Lefèvre); 7 | return 0; 8 | } 9 | // pcc & tcc only 10 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/warning.h: -------------------------------------------------------------------------------- 1 | 2 | /* FIXME 3 | here we putting #pragma warning and disable or enable them 4 | I known gcc and msvc using diffent pragma and I do not known 5 | the gcc pragma well to achive msvs and gcc compatible with this */ -------------------------------------------------------------------------------- /win32/include_w32api/lmuseflg.h: -------------------------------------------------------------------------------- 1 | #ifndef _LMUSEFLG_H 2 | #define _LMUSEFLG_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #define USE_NOFORCE 0 8 | #define USE_FORCE 1 9 | #define USE_LOTS_OF_FORCE 2 10 | #endif 11 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/d3d8.def: -------------------------------------------------------------------------------- 1 | LIBRARY d3d8.dll 2 | EXPORTS 3 | DebugSetMute 4 | Direct3DCreate8@4 5 | _Z19ValidatePixelShaderPKmPK9_D3DCAPS8mPPc@16=ValidatePixelShader 6 | _Z20ValidateVertexShaderPKmS0_PK9_D3DCAPS8mPPc@20=ValidateVertexShader 7 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/ksproxy.def: -------------------------------------------------------------------------------- 1 | LIBRARY ksproxy.ax 2 | EXPORTS 3 | KsGetMediaType@16 4 | KsGetMediaTypeCount@12 5 | KsGetMultiplePinFactoryItems@16 6 | KsOpenDefaultDevice@12 7 | KsResolveRequiredAttributes@8 8 | KsSynchronousDeviceControl@28 9 | -------------------------------------------------------------------------------- /tests/pp/14.c: -------------------------------------------------------------------------------- 1 | #define W Z 2 | #define Z(X) W(X,2) 3 | #define Y(X) Z(X) 4 | #define X Y 5 | return X(X(1)); 6 | 7 | #define P Q 8 | #define Q(n) P(n,2) 9 | return P(1); 10 | 11 | #define A (B * B) 12 | #define B (A + A) 13 | return A + B; 14 | -------------------------------------------------------------------------------- /tests/tests2/120_alias.expect: -------------------------------------------------------------------------------- 1 | in target function 2 | in target function 3 | in target function 4 | g_int = 34 5 | alias_int = 34 6 | asm_int = 34 7 | in unit2: 8 | in target function 9 | in target function 10 | g_int = 34 11 | alias_int = 34 12 | -------------------------------------------------------------------------------- /win32/include/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | /* ISOC99 boolean */ 5 | 6 | #define bool _Bool 7 | #define true 1 8 | #define false 0 9 | #define __bool_true_false_are_defined 1 10 | 11 | #endif /* _STDBOOL_H */ 12 | -------------------------------------------------------------------------------- /win32/lib/dllmain.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | 3 | #include 4 | 5 | BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) 6 | { 7 | return TRUE; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | /* ISOC99 boolean */ 5 | 6 | #define bool _Bool 7 | #define true 1 8 | #define false 0 9 | #define __bool_true_false_are_defined 1 10 | 11 | #endif /* _STDBOOL_H */ 12 | -------------------------------------------------------------------------------- /win32/cake/src/include/assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of cake compiler 3 | * https://github.com/thradams/cake 4 | */ 5 | 6 | #ifdef NDEBUG 7 | #define assert(...) ((void)0) 8 | #else 9 | #define assert(...) assert(__VA_ARGS__) 10 | #endif 11 | -------------------------------------------------------------------------------- /tests/pp/12.S: -------------------------------------------------------------------------------- 1 | #define SRC(y...) \ 2 | 9999: y; \ 3 | .section __ex_table, "a"; \ 4 | .long 9999b, 6001f ; \ 5 | // .previous 6 | 7 | SRC(1: movw (%esi), %bx) 8 | 6001: 9 | -------------------------------------------------------------------------------- /tests/pp/21.expect: -------------------------------------------------------------------------------- 1 | ----- 1 ------ 2 | OK 3 | ----- 2 ------ 4 | OK 5 | ----- 3 ------ 6 | OK 7 | ----- 4 ------ 8 | OK 9 | ----- 5 ------ 10 | line 39 11 | line ## 12 | ----- 10 ------ 13 | 1 true 14 | 2 true 15 | 3 true 16 | 4 true 17 | 5 true 18 | 6 true 19 | -------------------------------------------------------------------------------- /tests/tests2/37_sprintf.expect: -------------------------------------------------------------------------------- 1 | ->01<- 2 | ->02<- 3 | ->03<- 4 | ->04<- 5 | ->05<- 6 | ->06<- 7 | ->07<- 8 | ->08<- 9 | ->09<- 10 | ->10<- 11 | ->11<- 12 | ->12<- 13 | ->13<- 14 | ->14<- 15 | ->15<- 16 | ->16<- 17 | ->17<- 18 | ->18<- 19 | ->19<- 20 | ->20<- 21 | -------------------------------------------------------------------------------- /win32/include_w32api/idispids.h: -------------------------------------------------------------------------------- 1 | #ifndef _IDISPIDS_H 2 | #define _IDISPIDS_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #define DISPID_AMBIENT_OFFLINEIFNOTCONNECTED (-5501) 8 | #define DISPID_AMBIENT_SILENT (-5502) 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /win32/lib_w32api/lz32.def: -------------------------------------------------------------------------------- 1 | LIBRARY LZ32.DLL 2 | EXPORTS 3 | CopyLZFile@8 4 | GetExpandedNameA@8 5 | GetExpandedNameW@8 6 | LZClose@4 7 | LZCopy@8 8 | LZDone@0 9 | LZInit@4 10 | LZOpenFileA@12 11 | LZOpenFileW@12 12 | LZRead@12 13 | LZSeek@12 14 | LZStart@0 15 | -------------------------------------------------------------------------------- /win32/lib_w32api/olepro32.def: -------------------------------------------------------------------------------- 1 | LIBRARY OLEPRO32.DLL 2 | EXPORTS 3 | OleCreateFontIndirect@12 4 | OleCreatePictureIndirect@16 5 | OleCreatePropertyFrame@44 6 | OleCreatePropertyFrameIndirect@4 7 | OleIconToCursor@8 8 | OleLoadPicture@20 9 | OleTranslateColor@12 10 | -------------------------------------------------------------------------------- /tests/pp/05.c: -------------------------------------------------------------------------------- 1 | #define t(x,y,z) x ## y ## z 2 | #define xxx(s) int s[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), \ 3 | t(10,,), t(,11,), t(,,12), t(,,) }; 4 | 5 | int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), 6 | t(10,,), t(,11,), t(,,12), t(,,) }; 7 | xxx(j) 8 | -------------------------------------------------------------------------------- /tests/tests2/64_macro_nesting.c: -------------------------------------------------------------------------------- 1 | #include // printf() 2 | 3 | #define CAT2(a,b) a##b 4 | #define CAT(a,b) CAT2(a,b) 5 | #define AB(x) CAT(x,y) 6 | 7 | int main(void) 8 | { 9 | int xy = 42; 10 | printf("%d\n", CAT(A,B)(x)); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /tests/tests2/29_array_address.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char a[10]; 7 | strcpy(a, "abcdef"); 8 | printf("%s\n", &a[1]); 9 | 10 | return 0; 11 | } 12 | 13 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 14 | -------------------------------------------------------------------------------- /tests/tests2/126_bound_global.c: -------------------------------------------------------------------------------- 1 | /* test bound checking code without -run */ 2 | 3 | int arr[10]; 4 | 5 | int 6 | main(int argc, char **argv) 7 | { 8 | int i; 9 | 10 | for (i = 0; i <= sizeof(arr)/sizeof(arr[0]); i++) 11 | arr[i] = 0; 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /win32/include_extn/utime.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include 7 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/bh.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include "netmon.h" 7 | -------------------------------------------------------------------------------- /tests/tests2/04_for.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int Count; 6 | 7 | for (Count = 1; Count <= 10; Count++) 8 | { 9 | printf("%d\n", Count); 10 | } 11 | 12 | return 0; 13 | } 14 | 15 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 16 | -------------------------------------------------------------------------------- /tests/tests2/24_math_library.expect: -------------------------------------------------------------------------------- 1 | 0.119712 2 | 0.992809 3 | 0.120579 4 | 0.120290 5 | 1.450506 6 | 0.119429 7 | 0.120288 8 | 1.007209 9 | 0.119427 10 | 1.127497 11 | 0.120000 12 | -2.120264 13 | -0.920819 14 | 0.775357 15 | 0.346410 16 | 12.000000 17 | 13.000000 18 | 12.000000 19 | -------------------------------------------------------------------------------- /win32/cake/src/pre_expressions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of cake compiler 3 | * https://github.com/thradams/cake 4 | */ 5 | 6 | #pragma once 7 | 8 | struct preprocessor_ctx; 9 | 10 | int pre_constant_expression(struct preprocessor_ctx* ctx, long long* pvalue); 11 | 12 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/msado15.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include "adoint.h" 7 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/mtsgrp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include "comsvcs.h" 7 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/txctx.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include "comsvcs.h" 7 | -------------------------------------------------------------------------------- /win32/lib_w32api/ws2_32.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* IPv6 constants for use in structure assignments (RFC 2553). */ 5 | const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }}; 6 | const struct in6_addr in6addr_loopback = {{ IN6ADDR_LOOPBACK_INIT }}; 7 | -------------------------------------------------------------------------------- /tests/tests2/128_run_atexit.expect: -------------------------------------------------------------------------------- 1 | [test_128_return] 2 | startup5 3 | cleanup5 4 | 1 cleanup4 5 | 1 cleanup3 6 | cleanup2 7 | cleanup1 8 | [returns 1] 9 | 10 | [test_128_exit] 11 | startup5 12 | cleanup5 13 | 2 cleanup4 14 | 2 cleanup3 15 | cleanup2 16 | cleanup1 17 | [returns 2] 18 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/mtsevents.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include "comsvcs.h" 7 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/objerror.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include 7 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/scarddat.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include "scardssp.h" 7 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/scardmgr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include "scardssp.h" 7 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/scardsrv.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include "scardssp.h" 7 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/sspsidl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include "scardssp.h" 7 | -------------------------------------------------------------------------------- /win32/lib_w32api/ddk/newdev.def: -------------------------------------------------------------------------------- 1 | LIBRARY newdev.dll 2 | EXPORTS 3 | UpdateDriverForPlugAndPlayDevicesA 4 | UpdateDriverForPlugAndPlayDevicesW 5 | UpdateDriverForPlugAndPlayDevicesA@20=UpdateDriverForPlugAndPlayDevicesA 6 | UpdateDriverForPlugAndPlayDevicesW@20=UpdateDriverForPlugAndPlayDevicesW 7 | -------------------------------------------------------------------------------- /tests/pp/02.expect: -------------------------------------------------------------------------------- 1 | f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); 2 | f(2 * (2 +(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1); 3 | char c[2][6] = { "hello", "" }; 4 | f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); 5 | f(2 * (2 +(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1); 6 | -------------------------------------------------------------------------------- /tests/tests2/105_local_extern.c: -------------------------------------------------------------------------------- 1 | extern int printf(const char *, ...); 2 | void f(void); 3 | void bar(void) { void f(void); f(); } 4 | void foo(void) { extern void f(void); f(); } 5 | void f(void) { printf("f\n"); } 6 | 7 | int main() 8 | { 9 | bar(); 10 | foo(); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /tests/tests2/113_btdll.expect: -------------------------------------------------------------------------------- 1 | 113_btdll.c:12: at f_1: hello from f_1() / 113_btdll.c:12 2 | 113_btdll.c:37: by main 3 | 113_btdll.c:20: at f_2: hello from f_2() / 113_btdll.c:20 4 | 113_btdll.c:38: by main 5 | 113_btdll.c:31: at f_main: hello from f_main() / 113_btdll.c:31 6 | 113_btdll.c:39: by main 7 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/test.c: -------------------------------------------------------------------------------- 1 | /* Perform simple test of headers to avoid typos and such */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | int main() 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /win32/lib_w32api/mfcuia32.def: -------------------------------------------------------------------------------- 1 | LIBRARY MFCUIA32.DLL 2 | EXPORTS 3 | OleUIAddVerbMenu@36 4 | OleUIBusy@4 5 | OleUICanConvertOrActivateAs@12 6 | OleUIChangeIcon@4 7 | OleUIConvert@4 8 | OleUIEditLinks@4 9 | OleUIInsertObject@4 10 | OleUIPasteSpecial@4 11 | OleUIPromptUser 12 | OleUIUpdateLinks@16 13 | -------------------------------------------------------------------------------- /tests/tests2/35_sizeof.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char a; 6 | short b; 7 | 8 | printf("%d %d\n", sizeof(char), sizeof(a)); 9 | printf("%d %d\n", sizeof(short), sizeof(b)); 10 | 11 | return 0; 12 | } 13 | 14 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 15 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/adsdb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #define DBPROPFLAGS_ADSISEARCH 0x0000C000 7 | -------------------------------------------------------------------------------- /tests/tests2/02_printf.expect: -------------------------------------------------------------------------------- 1 | Hello world 2 | Count = -5 3 | Count = -4 4 | Count = -3 5 | Count = -2 6 | Count = -1 7 | Count = 0 8 | Count = 1 9 | Count = 2 10 | Count = 3 11 | Count = 4 12 | Count = 5 13 | String 'hello', 'there' is 'hello', 'there' 14 | Character 'A' is 'A' 15 | Character 'a' is 'a' 16 | -------------------------------------------------------------------------------- /tests/tests2/44_scoped_declarations.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a; 6 | 7 | for (a = 0; a < 2; a++) 8 | { 9 | int b = a; 10 | } 11 | 12 | printf("it's all good\n"); 13 | 14 | return 0; 15 | } 16 | 17 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 18 | -------------------------------------------------------------------------------- /tests/tests2/87_dead_code.expect: -------------------------------------------------------------------------------- 1 | timeout=2 2 | timeout=1 3 | boo 4 | yeah 5 | twice 6 | once 7 | twice 8 | SEtwice 9 | SEonce 10 | SEtwice 11 | twice2 12 | once2 13 | twice2 14 | twice3 15 | once3 16 | twice3 17 | caseok 18 | caseok2 19 | g=1 20 | check 1 21 | g=2 22 | check 2 23 | g=3 24 | nondead works 25 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/initguid.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #define INITGUID 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/issperr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #warning The header issperr.h is an obsolete file. 7 | -------------------------------------------------------------------------------- /tests/tests2/12_hashdefine.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define FRED 12 4 | #define BLOGGS(x) (12*(x)) 5 | 6 | int main() 7 | { 8 | printf("%d\n", FRED); 9 | printf("%d, %d, %d\n", BLOGGS(1), BLOGGS(2), BLOGGS(3)); 10 | 11 | return 0; 12 | } 13 | 14 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 15 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/mtx.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #define __MTxSpm_LIBRARY_DEFINED__ 7 | #include "comsvcs.h" 8 | -------------------------------------------------------------------------------- /win32/lib_w32api/userenv.def: -------------------------------------------------------------------------------- 1 | LIBRARY USERENV.dll 2 | EXPORTS 3 | LoadUserProfileA@8 4 | LoadUserProfileW@8 5 | UnloadUserProfile@8 6 | GetProfilesDirectoryA@8 7 | GetProfilesDirectoryW@8 8 | GetUserProfileDirectoryA@12 9 | GetUserProfileDirectoryW@12 10 | CreateEnvironmentBlock@12 11 | DestroyEnvironmentBlock@4 12 | -------------------------------------------------------------------------------- /tests/tests2/85_asm-outside-function.c: -------------------------------------------------------------------------------- 1 | #ifdef __leading_underscore 2 | # define _ "_" 3 | #else 4 | # define _ 5 | #endif 6 | 7 | extern int printf (const char *, ...); 8 | extern void vide(void); 9 | __asm__(_"vide: ret"); 10 | 11 | int main() { 12 | vide(); 13 | printf ("okay\n"); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /win32/lib_w32api/mgmtapi.def: -------------------------------------------------------------------------------- 1 | LIBRARY MGMTAPI.DLL 2 | EXPORTS 3 | SnmpMgrClose@4 4 | SnmpMgrCtl@28 5 | SnmpMgrGetTrap@24 6 | SnmpMgrGetTrapEx@32 7 | ;SnmpMgrMIB2Disk@8 8 | SnmpMgrOidToStr@8 9 | SnmpMgrOpen@16 10 | SnmpMgrRequest@20 11 | SnmpMgrStrToOid@8 12 | SnmpMgrTrapListen@4 13 | serverTrapThread@4 14 | ;dbginit@8 15 | -------------------------------------------------------------------------------- /win32/include_w32api/xprtdefs.h: -------------------------------------------------------------------------------- 1 | #ifndef _XPTRDEFS_H 2 | #define _XPTRDEFS_H 3 | #if __GNUC__ >= 3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | /*--- DirectShow Reference - DirectShow Structures - TIMECODE_SAMPLE Structure */ 8 | #define ED_DEVCAP_ATN_READ 0x13B7 9 | #define ED_DEVCAP_RTC_READ 0x13BA 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /win32/lib_w32api/ddk/usbcamd.def: -------------------------------------------------------------------------------- 1 | LIBRARY usbcamd.sys 2 | EXPORTS 3 | DllUnload@0 4 | USBCAMD_AdapterReceivePacket@16 5 | USBCAMD_ControlVendorCommand@36 6 | ;USBCAMD_Debug_LogEntry 7 | USBCAMD_DriverEntry@20 8 | USBCAMD_GetRegistryKeyValue@20 9 | USBCAMD_InitializeNewInterface@16 10 | USBCAMD_SelectAlternateInterface@8 11 | -------------------------------------------------------------------------------- /win32/lib_w32api/ddk/usbcamd2.def: -------------------------------------------------------------------------------- 1 | LIBRARY usbcamd2.sys 2 | EXPORTS 3 | DllUnload@0 4 | USBCAMD_AdapterReceivePacket@16 5 | USBCAMD_ControlVendorCommand@36 6 | ;USBCAMD_Debug_LogEntry 7 | USBCAMD_DriverEntry@20 8 | USBCAMD_GetRegistryKeyValue@20 9 | USBCAMD_InitializeNewInterface@16 10 | USBCAMD_SelectAlternateInterface@8 11 | -------------------------------------------------------------------------------- /tests/tests2/45_empty_for.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int Count = 0; 6 | 7 | for (;;) 8 | { 9 | Count++; 10 | printf("%d\n", Count); 11 | if (Count >= 10) 12 | break; 13 | } 14 | 15 | return 0; 16 | } 17 | 18 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 19 | -------------------------------------------------------------------------------- /tests/tests2/84_hex-float.c: -------------------------------------------------------------------------------- 1 | extern int printf(const char *format, ...); 2 | 3 | #define ACPI_TYPE_INVALID 0x1E 4 | #define NUM_NS_TYPES ACPI_TYPE_INVALID+1 5 | int array[NUM_NS_TYPES]; 6 | 7 | #define n 0xe 8 | int main() 9 | { 10 | printf("n+1 = %d\n", n+1); 11 | // printf("n+1 = %d\n", 0xe+1); 12 | } 13 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/objerror.h: -------------------------------------------------------------------------------- 1 | 2 | /* $Id$ 3 | * 4 | * COPYRIGHT: This file is in the public domain. 5 | * PROJECT: ReactOS kernel 6 | * FILE: 7 | * PURPOSE: Directx headers 8 | * PROGRAMMER: Magnus Olsen (greatlrd) 9 | * 10 | */ 11 | 12 | #include 13 | 14 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/d3d9.def: -------------------------------------------------------------------------------- 1 | LIBRARY d3d9.dll 2 | EXPORTS 3 | DebugSetLevel 4 | DebugSetMute 5 | Direct3DCreate9@4 6 | _Z30Direct3DShaderValidatorCreate9v=Direct3DShaderValidatorCreate9 7 | _Z9PSGPErrorP21D3DFE_PROCESSVERTICES11PSGPERRORIDj@12=PSGPError 8 | _Z17PSGPSampleTextureP21D3DFE_PROCESSVERTICESjPA4_fjS2_@20=PSGPSampleTexture 9 | -------------------------------------------------------------------------------- /tests/pp/pp-counter.expect: -------------------------------------------------------------------------------- 1 | X1 0 2 | X2 1 3 | X3 3 4 | X4 x 4 y 5 | X5 x 5 y 6 6 | X6 b 7 7 | X7 8 9 8 | X8 x 10 y x 10 y 11 x2 x 10 y 12 y2 13 9 | X9 x 14 y 15 x 14 y 15 16 x2 x 14 y 15 17 y2 18 10 | X10 19 19 20 x2 19 21 y2 22 11 | X11 23 23 24 x2 23 25 y2 26 12 | X12 "__COUNTER__" 13 | X13 x27 14 | X14 x__COUNTER__ 15 | X15 x2828 16 | -------------------------------------------------------------------------------- /tests/tests2/67_macro_concat.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define P(A,B) A ## B ; bob 4 | #define Q(A,B) A ## B+ 5 | 6 | int main(void) 7 | { 8 | int bob, jim = 21; 9 | bob = P(jim,) *= 2; 10 | printf("jim: %d, bob: %d\n", jim, bob); 11 | jim = 60 Q(+,)3; 12 | printf("jim: %d\n", jim); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /win32/include/winapi/poppack.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(pop) 8 | #endif 9 | -------------------------------------------------------------------------------- /win32/include/winapi/pshpack1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,1) 8 | #endif 9 | -------------------------------------------------------------------------------- /win32/include/winapi/pshpack2.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,2) 8 | #endif 9 | -------------------------------------------------------------------------------- /win32/include/winapi/pshpack4.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,4) 8 | #endif 9 | -------------------------------------------------------------------------------- /win32/include/winapi/pshpack8.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,8) 8 | #endif 9 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/scode.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _WINERROR_ 7 | 8 | #include 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /win32/include_w32api/winresrc.h: -------------------------------------------------------------------------------- 1 | #ifndef _WINRESRC_H 2 | #define _WINRESRC_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #define WIN32_LEAN_AND_MEAN 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #endif 15 | -------------------------------------------------------------------------------- /win32/lib_w32api/olesvr32.def: -------------------------------------------------------------------------------- 1 | LIBRARY OLESVR32.DLL 2 | EXPORTS 3 | OleBlockServer@4 4 | OleQueryServerVersion@0 5 | OleRegisterServer@20 6 | OleRegisterServerDoc@16 7 | OleRenameServerDoc@8 8 | OleRevertServerDoc@4 9 | OleRevokeObject@4 10 | OleRevokeServer@4 11 | OleRevokeServerDoc@4 12 | OleSavedServerDoc@4 13 | OleUnblockServer@8 14 | -------------------------------------------------------------------------------- /win32/lib_w32api/win32spl.def: -------------------------------------------------------------------------------- 1 | LIBRARY WIN32SPL.DLL 2 | EXPORTS 3 | AddPortExW@16 4 | AddPortW@12 5 | ClosePort@4 6 | ConfigurePortW@12 7 | DeletePortW@12 8 | EndDocPort@4 9 | EnumPortsW@24 10 | InitializeMonitor@4 11 | InitializePrintProvidor@12 12 | LibMain@12 13 | OpenPort@8 14 | ReadPort@16 15 | StartDocPort@20 16 | WritePort@16 17 | -------------------------------------------------------------------------------- /stab.h: -------------------------------------------------------------------------------- 1 | #ifndef __GNU_STAB__ 2 | 3 | /* Indicate the GNU stab.h is in use. */ 4 | 5 | #define __GNU_STAB__ 6 | 7 | #define __define_stab(NAME, CODE, STRING) NAME=CODE, 8 | 9 | enum __stab_debug_code 10 | { 11 | #include "stab.def" 12 | LAST_UNUSED_STAB_CODE 13 | }; 14 | 15 | #undef __define_stab 16 | 17 | #endif /* __GNU_STAB_ */ 18 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/winapi/poppack.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(pop) 8 | #endif 9 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/winapi/pshpack1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,1) 8 | #endif 9 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/winapi/pshpack2.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,2) 8 | #endif 9 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/winapi/pshpack4.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,4) 8 | #endif 9 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/winapi/pshpack8.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,8) 8 | #endif 9 | -------------------------------------------------------------------------------- /tests/tests2/00_assignment.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a; 6 | a = 42; 7 | printf("%d\n", a); 8 | 9 | int b = 64; 10 | printf("%d\n", b); 11 | 12 | int c = 12, d = 34; 13 | printf("%d, %d\n", c, d); 14 | 15 | return 0; 16 | } 17 | 18 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 19 | -------------------------------------------------------------------------------- /win32/include_w32api/cplext.h: -------------------------------------------------------------------------------- 1 | #ifndef _CPLEXT_H 2 | #define _CPLEXT_H 3 | #if __GNUC__ >= 3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #define CPLPAGE_MOUSE_BUTTONS 1 8 | #define CPLPAGE_MOUSE_PTRMOTION 2 9 | #define CPLPAGE_MOUSE_WHEEL 3 10 | #define CPLPAGE_KEYBOARD_SPEED 1 11 | #define CPLPAGE_DISPLAY_BACKGROUND 1 12 | #endif 13 | -------------------------------------------------------------------------------- /tests/tests2/31_args.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) 4 | { 5 | int Count; 6 | 7 | printf("hello world %d\n", argc); 8 | for (Count = 1; Count < argc; Count++) 9 | printf("arg %d: %s\n", Count, argv[Count]); 10 | 11 | return 0; 12 | } 13 | 14 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 15 | -------------------------------------------------------------------------------- /win32/include_w32api/isguids.h: -------------------------------------------------------------------------------- 1 | #ifndef _ISGUID_H 2 | #define _ISGUID_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | extern const GUID CLSID_InternetShortcut; 11 | extern const GUID IID_IUniformResourceLocator; 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /tests/tests2/37_sprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char Buf[100]; 6 | int Count; 7 | 8 | for (Count = 1; Count <= 20; Count++) 9 | { 10 | sprintf(Buf, "->%02d<-\n", Count); 11 | printf("%s", Buf); 12 | } 13 | 14 | return 0; 15 | } 16 | 17 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 18 | -------------------------------------------------------------------------------- /win32/include_w32api/schnlsp.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCHNLSP_H 2 | #define _SCHNLSP_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | 8 | #define SECPKG_ATTR_SUPPORTED_ALGS 86 9 | #define SECPKG_ATTR_CIPHER_STRENGTHS 87 10 | #define SECPKG_ATTR_SUPPORTED_PROTOCOLS 88 11 | 12 | #include 13 | 14 | #endif /* _SCHNLSP_H */ 15 | -------------------------------------------------------------------------------- /tests/pp/23.S: -------------------------------------------------------------------------------- 1 | __LINE__ 2 | # 10 3 | __LINE__ 4 | # line 20 5 | __LINE__ 6 | # 64mb 7 | __LINE__ 8 | # line 30 9 | __LINE__ 10 | #define LINE1 40 11 | # line LINE1 12 | __LINE__ __FILE__ 13 | #define LINE2 50 14 | # line LINE2 "file1" 15 | __LINE__ __FILE__ 16 | #define LINE3 60 17 | #define FILE "file2" 18 | # line LINE3 FILE 19 | __LINE__ __FILE__ 20 | -------------------------------------------------------------------------------- /tests/tests2/01_comment.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | printf("Hello\n"); 6 | printf("Hello\n"); /* this is a comment */ printf("Hello\n"); 7 | printf("Hello\n"); 8 | // this is also a comment sayhello(); 9 | printf("Hello\n"); 10 | 11 | return 0; 12 | } 13 | 14 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 15 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/sipbase.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef SIPBASE_H 7 | #define SIPBASE_H 8 | 9 | #include 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /tests/pp/17.c: -------------------------------------------------------------------------------- 1 | #define STR1(u) # u 2 | #define pass(a) a 3 | #define __ASM_REG(reg) STR1(one##reg) 4 | #define _ASM_DX __ASM_REG(tok) 5 | X162 pass(__ASM_REG(tok)) 6 | X161 pass(_ASM_DX) 7 | X163 pass(STR1(one##tok)) 8 | 9 | X170 pass(x ## y) 10 | X171 pass(x pass(##) y) 11 | 12 | #define Y(x) Z(x) 13 | #define X Y 14 | X180 return X(X(1)); 15 | -------------------------------------------------------------------------------- /tests/tests2/107_stack_safe.c: -------------------------------------------------------------------------------- 1 | extern int printf(const char *, ...); 2 | 3 | static void func_ull_ull(unsigned long long l1,unsigned long long l2){ 4 | } 5 | 6 | int main() 7 | { 8 | int a,b,c,d; 9 | a=1;b=2;c=3;d=4; 10 | func_ull_ull((unsigned long long)a/1.0,(unsigned long long)b/1.0); 11 | printf("%d %d %d %d",a,b,c,d); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /tests/tests2/27_sizeof.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char a; 6 | int b; 7 | double c; 8 | 9 | printf("%d\n", sizeof(a)); 10 | printf("%d\n", sizeof(b)); 11 | printf("%d\n", sizeof(c)); 12 | 13 | printf("%d\n", sizeof(!a)); 14 | 15 | return 0; 16 | } 17 | 18 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 19 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/msterr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _MSTERR_H_ 7 | #define _MSTERR_H_ 8 | 9 | #include "winerror.h" 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /win32/lib_w32api/unknwn-uuid.c: -------------------------------------------------------------------------------- 1 | /* unknwn-uuid.c */ 2 | /* Generate GUIDs for Unknown interfaces */ 3 | 4 | /* All IIDs defined in this file were extracted from 5 | * HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\ */ 6 | 7 | #define INITGUID 8 | #include 9 | DEFINE_OLEGUID(IID_IUnknown,0,0,0); 10 | DEFINE_OLEGUID(IID_IClassFactory,0x1,0,0); 11 | -------------------------------------------------------------------------------- /tests/tests2/36_array_initialisers.expect: -------------------------------------------------------------------------------- 1 | 0: 12 2 | 1: 34 3 | 2: 56 4 | 3: 78 5 | 4: 90 6 | 5: 123 7 | 6: 456 8 | 7: 789 9 | 8: 8642 10 | 9: 9753 11 | 0: 12 12 | 1: 34 13 | 2: 56 14 | 3: 78 15 | 4: 90 16 | 5: 123 17 | 6: 456 18 | 7: 789 19 | 8: 8642 20 | 9: 9753 21 | 0: 12 22 | 1: 34 23 | 2: 0 24 | 3: 0 25 | 4: 0 26 | 5: 0 27 | 6: 0 28 | 7: 0 29 | 8: 0 30 | 9: 0 31 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/olectlid.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #warning Your code should include olectl.h instead of olectlid.h header file. 7 | #include 8 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dsound.def: -------------------------------------------------------------------------------- 1 | LIBRARY dsound.dll 2 | EXPORTS 3 | DirectSoundCaptureCreate@12 4 | DirectSoundCaptureCreate8@12 5 | DirectSoundCaptureEnumerateA@8 6 | DirectSoundCaptureEnumerateW@8 7 | DirectSoundCreate@12 8 | DirectSoundCreate8@12 9 | DirectSoundEnumerateA@8 10 | DirectSoundEnumerateW@8 11 | DirectSoundFullDuplexCreate@40 12 | GetDeviceID@8 13 | -------------------------------------------------------------------------------- /tests/tests2/91_ptr_longlong_arith32.c: -------------------------------------------------------------------------------- 1 | int printf(const char *, ...); 2 | char t[] = "012345678"; 3 | 4 | int main(void) 5 | { 6 | char *data = t; 7 | unsigned long long r = 4; 8 | unsigned a = 5; 9 | unsigned long long b = 12; 10 | 11 | *(unsigned*)(data + r) += a - b; 12 | 13 | printf("data = \"%s\"\n", data); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /win32/include/vadefs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_VADEFS 7 | #define _INC_VADEFS 8 | 9 | //!__TINYC__: GNUC specific stuff removed 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/schnlsp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __SCHNLSP_H__ 7 | #define __SCHNLSP_H__ 8 | 9 | #include 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/sspserr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __SSPSERR_H__ 7 | #define __SSPSERR_H__ 8 | 9 | #include 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /win32/include_w32api/initguid.h: -------------------------------------------------------------------------------- 1 | #ifndef _INITGUID_H 2 | #define _INITGUID_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #ifndef DEFINE_GUID 8 | #include 9 | #endif 10 | #undef DEFINE_GUID 11 | #define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} 12 | #endif 13 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/vadefs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_VADEFS 7 | #define _INC_VADEFS 8 | 9 | //!__TINYC__: GNUC specific stuff removed 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /tests/tests2/111_conversion.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | union u { 4 | unsigned long ul; 5 | long double ld; 6 | }; 7 | 8 | void 9 | conv (union u *p) 10 | { 11 | p->ul = (unsigned int) p->ld; 12 | } 13 | 14 | int main (void) 15 | { 16 | union u v; 17 | 18 | v.ld = 42; 19 | conv (&v); 20 | printf ("%lu\n", v.ul); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /win32/include_w32api/ntdll.h: -------------------------------------------------------------------------------- 1 | #ifndef _NTDLL_H 2 | #define _NTDLL_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | typedef enum _SHUTDOWN_ACTION { 8 | ShutdownNoReboot, 9 | ShutdownReboot, 10 | ShutdownPowerOff 11 | } SHUTDOWN_ACTION; 12 | 13 | DWORD WINAPI NtShutdownSystem (SHUTDOWN_ACTION Action); 14 | 15 | #endif /* _NTDLL_H */ 16 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/d3dim.def: -------------------------------------------------------------------------------- 1 | LIBRARY d3dim.dll 2 | EXPORTS 3 | ;D3DFree 4 | ;D3DMalloc 5 | ;D3DRealloc 6 | Direct3DCreate@12 7 | ;Direct3DCreateDevice 8 | ;Direct3DCreateTexture 9 | ;Direct3DGetSWRastZPixFmts 10 | Direct3D_HALCleanUp@8 11 | FlushD3DDevices@4 12 | FlushD3DDevices2@4 13 | PaletteAssociateNotify@16 14 | PaletteUpdateNotify@20 15 | SurfaceFlipNotify@4 16 | -------------------------------------------------------------------------------- /win32/lib_w32api/objsafe-uuid.c: -------------------------------------------------------------------------------- 1 | /* objsafe-uuid.c */ 2 | /* Generate GUIDs for Object Safe interfaces */ 3 | 4 | /* All IIDs defined in this file were extracted from 5 | * HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\ */ 6 | 7 | #define INITGUID 8 | #include 9 | DEFINE_GUID(IID_IObjectSafety,0xcb5bdc81,0x93c1,0x11cf,0x8f,0x20,0,0x80,0x5f,0x2c,0xd0,0x64); 10 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/ole2ver.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _OLE2VER_H_ 7 | #define _OLE2VER_H_ 8 | 9 | #define rmm 23 10 | #define rup 639 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /win32/include_w32api/control.h: -------------------------------------------------------------------------------- 1 | #ifndef _CONTROL_H 2 | #define _CONTROL_H 3 | #if __GNUC__ >= 3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | /*--- DirectShow Reference - DirectShow Data Types */ 12 | typedef LONG_PTR OAEVENT; 13 | typedef LONG_PTR OAHWND; 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /win32/lib_w32api/servprov-uuid.c: -------------------------------------------------------------------------------- 1 | /* servprov-uuid.c */ 2 | /* Generate GUIDs for ServiceProvider interfaces */ 3 | 4 | /* All IIDs defined in this file were extracted from 5 | * HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\ */ 6 | 7 | #define INITGUID 8 | #include 9 | DEFINE_GUID(IID_IServiceProvider,0x6d5140c1,0x7436,0x11ce,0x80,0x34,0,0xaa,0,0x60,0x9,0xfa); 10 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/adoid.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _ADOID_H_ 7 | #define _ADOID_H_ 8 | 9 | #include "adodef.h" 10 | #include "adoguids.h" 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/msdmo.def: -------------------------------------------------------------------------------- 1 | LIBRARY msdmo.dll 2 | EXPORTS 3 | DMOEnum@28 4 | DMOGetName@8 5 | DMOGetTypes@28 6 | DMOGuidToStrA@8 7 | DMOGuidToStrW@8 8 | DMORegister@32 9 | DMOStrToGuidA@8 10 | DMOStrToGuidW@8 11 | DMOUnregister@8 12 | MoCopyMediaType@8 13 | MoCreateMediaType@8 14 | MoDeleteMediaType@4 15 | MoDuplicateMediaType@8 16 | MoFreeMediaType@4 17 | MoInitMediaType@8 18 | -------------------------------------------------------------------------------- /tests/tests2/08_while.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a; 6 | int p; 7 | int t; 8 | 9 | a = 1; 10 | p = 0; 11 | t = 0; 12 | 13 | while (a < 100) 14 | { 15 | printf("%d\n", a); 16 | t = a; 17 | a = t + p; 18 | p = t; 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 25 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/dvobj.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef RC_INVOKED 7 | #warning Your code should include ole2.h instead of dvobj.h 8 | #endif 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /win32/include_w32api/exdispid.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXDISPID_H 2 | #define _EXDISPID_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #define DISPID_BEFORENAVIGATE2 250 8 | #define DISPID_NEWWINDOW2 251 9 | #define DISPID_PROGRESSCHANGE 108 10 | #define DISPID_DOCUMENTCOMPLETE 259 11 | #define DISPID_STATUSTEXTCHANGE 102 12 | #define DISPID_TITLECHANGE 113 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /tests/tests2/09_do_while.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a; 6 | int p; 7 | int t; 8 | 9 | a = 1; 10 | p = 0; 11 | t = 0; 12 | 13 | do 14 | { 15 | printf("%d\n", a); 16 | t = a; 17 | a = t + p; 18 | p = t; 19 | } while (a < 100); 20 | 21 | return 0; 22 | } 23 | 24 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 25 | -------------------------------------------------------------------------------- /tests/tests2/14_if.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a = 1; 6 | 7 | if (a) 8 | printf("a is true\n"); 9 | else 10 | printf("a is false\n"); 11 | 12 | int b = 0; 13 | if (b) 14 | printf("b is true\n"); 15 | else 16 | printf("b is false\n"); 17 | 18 | return 0; 19 | } 20 | 21 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 22 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/compobj.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef RC_INVOKED 7 | #warning Your code should include objbase.h instead of compobj.h 8 | #endif 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /tests/tests2/131_return_struct_in_reg.expect: -------------------------------------------------------------------------------- 1 | 05 0a 2 | 12 34 3 | 1245 5678 4 | 12345678 9abcdef0 5 | 123456789abcdef0 fedcba9876543210 6 | 1.0 2.0 3.0 4.0 7 | 8 | 05 0a 9 | 12 34 10 | 1245 5678 11 | 12345678 9abcdef0 12 | 123456789abcdef0 fedcba9876543210 13 | 1.0 2.0 3.0 4.0 14 | 15 | 05 0a 16 | 12 34 17 | 1245 5678 18 | 12345678 9abcdef0 19 | 123456789abcdef0 fedcba9876543210 20 | 1.0 2.0 3.0 4.0 21 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/dispatch.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef RC_INVOKED 7 | #warning Your code should include oleauto.h instead of dispatch.h 8 | #endif 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /win32/include_w32api/ks.h: -------------------------------------------------------------------------------- 1 | #ifndef _KS_H 2 | #define _KS_H 3 | #if __GNUC__ >= 3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | /*--- DirectShow Reference - DirectShow Structures */ 12 | typedef struct { 13 | ULONG Size; 14 | ULONG Count; 15 | } KSMULTIPLE_ITEM,*PKSMULTIPLE_ITEM; 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | #endif 21 | -------------------------------------------------------------------------------- /include/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDARG_H 2 | #define _STDARG_H 3 | 4 | typedef __builtin_va_list va_list; 5 | #define va_start __builtin_va_start 6 | #define va_arg __builtin_va_arg 7 | #define va_copy __builtin_va_copy 8 | #define va_end __builtin_va_end 9 | 10 | /* fix a buggy dependency on GCC in libio.h */ 11 | typedef va_list __gnuc_va_list; 12 | #define _VA_LIST_DEFINED 13 | 14 | #endif /* _STDARG_H */ 15 | -------------------------------------------------------------------------------- /tests/tests2/108_constructor.c: -------------------------------------------------------------------------------- 1 | extern int write (int fd, void *buf, int len); 2 | 3 | static void __attribute__ ((constructor)) 4 | testc (void) 5 | { 6 | write (1, "constructor\n", 12); 7 | } 8 | 9 | static void __attribute__ ((destructor)) 10 | testd (void) 11 | { 12 | write (1, "destructor\n", 11); 13 | } 14 | 15 | int 16 | main (void) 17 | { 18 | write (1, "main\n", 5); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/ddraw.def: -------------------------------------------------------------------------------- 1 | LIBRARY ddraw.dll 2 | EXPORTS 3 | DDGetAttachedSurfaceLcl@12 4 | DDInternalLock@8 5 | DDInternalUnlock@4 6 | DSoundHelp@12 7 | DirectDrawCreate@12 8 | DirectDrawCreateClipper@12 9 | DirectDrawCreateEx@16 10 | DirectDrawEnumerateA@8 11 | DirectDrawEnumerateExA@12 12 | DirectDrawEnumerateExW@12 13 | DirectDrawEnumerateW@8 14 | GetDDSurfaceLocal@12 15 | GetSurfaceFromDC@12 16 | -------------------------------------------------------------------------------- /tests/tests2/15_recursion.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int factorial(int i) 4 | { 5 | if (i < 2) 6 | return i; 7 | else 8 | return i * factorial(i - 1); 9 | } 10 | 11 | int main() 12 | { 13 | int Count; 14 | 15 | for (Count = 1; Count <= 10; Count++) 16 | printf("%d\n", factorial(Count)); 17 | 18 | return 0; 19 | } 20 | 21 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 22 | -------------------------------------------------------------------------------- /tests/tests2/16_nesting.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int x, y, z; 6 | 7 | for (x = 0; x < 2; x++) 8 | { 9 | for (y = 0; y < 3; y++) 10 | { 11 | for (z = 0; z < 3; z++) 12 | { 13 | printf("%d %d %d\n", x, y, z); 14 | } 15 | } 16 | } 17 | 18 | return 0; 19 | } 20 | 21 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 22 | -------------------------------------------------------------------------------- /win32/examples/dll.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // dll.c - Windows DLL example - dynamically linked part 4 | // 5 | 6 | #include 7 | 8 | __declspec(dllexport) const char *hello_data = "(not set)"; 9 | 10 | __declspec(dllexport) void hello_func (void) 11 | { 12 | MessageBox (0, hello_data, "From DLL", MB_ICONINFORMATION); 13 | } 14 | -------------------------------------------------------------------------------- /win32/include/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDARG_H 2 | #define _STDARG_H 3 | 4 | typedef __builtin_va_list va_list; 5 | #define va_start __builtin_va_start 6 | #define va_arg __builtin_va_arg 7 | #define va_copy __builtin_va_copy 8 | #define va_end __builtin_va_end 9 | 10 | /* fix a buggy dependency on GCC in libio.h */ 11 | typedef va_list __gnuc_va_list; 12 | #define _VA_LIST_DEFINED 13 | 14 | #endif /* _STDARG_H */ 15 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/moniker.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef RC_INVOKED 7 | #warning Your code should include objbase.h instead of moniker.h header file. 8 | #endif 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/storage.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef RC_INVOKED 7 | #warning Your code should include objbase.h instead of storage.h header file. 8 | #endif 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /include/varargs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _VARARGS_H 7 | #define _VARARGS_H 8 | 9 | #error "TinyCC no longer implements ." 10 | #error "Revise your code to use ." 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /tcc_0.9.27/examples/dll.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // dll.c - Windows DLL example - dynamically linked part 4 | // 5 | 6 | #include 7 | 8 | __declspec(dllexport) const char *hello_data = "(not set)"; 9 | 10 | __declspec(dllexport) void hello_func (void) 11 | { 12 | MessageBox (0, hello_data, "From DLL", MB_ICONINFORMATION); 13 | } 14 | -------------------------------------------------------------------------------- /tests/tests2/26_character_constants.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | printf("%d\n", '\1'); 6 | printf("%d\n", '\10'); 7 | printf("%d\n", '\100'); 8 | printf("%d\n", '\x01'); 9 | printf("%d\n", '\x0e'); 10 | printf("%d\n", '\x10'); 11 | printf("%d\n", '\x40'); 12 | printf("test \x40\n"); 13 | 14 | return 0; 15 | } 16 | 17 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 18 | -------------------------------------------------------------------------------- /win32/include/mem.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * mem.h maps to string.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/fltsafe.h: -------------------------------------------------------------------------------- 1 | 2 | struct FLOATSAFE 3 | { 4 | KFLOATING_SAVE FloatSave; 5 | NTSTATUS ntStatus; 6 | 7 | FLOATSAFE::FLOATSAFE(void) 8 | { 9 | ntStatus = KeSaveFloatingPointState(&FloatSave); 10 | } 11 | 12 | FLOATSAFE::~FLOATSAFE(void) 13 | { 14 | if (NT_SUCCESS(ntStatus)) 15 | { 16 | KeRestoreFloatingPointState(&FloatSave); 17 | } 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/lmuseflg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _LMUSEFLG_ 7 | #define _LMUSEFLG_ 8 | 9 | #define USE_NOFORCE 0 10 | #define USE_FORCE 1 11 | #define USE_LOTS_OF_FORCE 2 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/mem.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * mem.h maps to string.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | -------------------------------------------------------------------------------- /tests/tests2/05_array.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int Count; 6 | int Array[10]; 7 | 8 | for (Count = 1; Count <= 10; Count++) 9 | { 10 | Array[Count-1] = Count * Count; 11 | } 12 | 13 | for (Count = 0; Count < 10; Count++) 14 | { 15 | printf("%d\n", Array[Count]); 16 | } 17 | 18 | return 0; 19 | } 20 | 21 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 22 | -------------------------------------------------------------------------------- /win32/cake/src/include/stddef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of cake compiler 3 | * https://github.com/thradams/cake 4 | */ 5 | 6 | #define unreachable() do {} while(0) 7 | typedef long int ptrdiff_t; 8 | typedef unsigned long size_t; 9 | typedef int wchar_t; 10 | typedef struct { 11 | long long __max_align_ll; 12 | long double __max_align_ld; 13 | } max_align_t; 14 | 15 | typedef typeof(nullptr) nullptr_t; 16 | 17 | -------------------------------------------------------------------------------- /win32/include/varargs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _VARARGS_H 7 | #define _VARARGS_H 8 | 9 | #error "TinyCC no longer implements ." 10 | #error "Revise your code to use ." 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /win32/include_extn/stdexcpt.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include <_mingw.h> 7 | 8 | #ifndef _INC_STDEXCPT 9 | #define _INC_STDEXCPT 10 | 11 | #ifdef __cplusplus 12 | #include 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/varargs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _VARARGS_H 7 | #define _VARARGS_H 8 | 9 | #error "TinyCC no longer implements ." 10 | #error "Revise your code to use ." 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /win32/include/sys/unistd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * unistd.h maps (roughly) to io.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/activeds.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include "iads.h" 7 | #include "adshlp.h" 8 | #include "adserr.h" 9 | #include "adsiid.h" 10 | #include "adssts.h" 11 | #include "adsnms.h" 12 | #include "adsdb.h" 13 | -------------------------------------------------------------------------------- /include/stdalign.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDALIGN_H 2 | #define _STDALIGN_H 3 | 4 | #if __STDC_VERSION__ < 201112L && (defined(__GNUC__) || defined(__TINYC__)) 5 | # define _Alignas(t) __attribute__((__aligned__(t))) 6 | # define _Alignof(t) __alignof__(t) 7 | #endif 8 | 9 | #define alignas _Alignas 10 | #define alignof _Alignof 11 | 12 | #define __alignas_is_defined 1 13 | #define __alignof_is_defined 1 14 | 15 | #endif /* _STDALIGN_H */ 16 | 17 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/sys/unistd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * unistd.h maps (roughly) to io.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /tests/tests2/13_integer_literals.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a = 24680; 6 | int b = 01234567; 7 | int c = 0x2468ac; 8 | int d = 0x2468AC; 9 | int e = 0b010101010101; 10 | 11 | printf("%d\n", a); 12 | printf("%d\n", b); 13 | printf("%d\n", c); 14 | printf("%d\n", d); 15 | printf("%d\n", e); 16 | 17 | return 0; 18 | } 19 | 20 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 21 | -------------------------------------------------------------------------------- /tests/tests2/34_array_assignment.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a[4]; 6 | 7 | a[0] = 12; 8 | a[1] = 23; 9 | a[2] = 34; 10 | a[3] = 45; 11 | 12 | printf("%d %d %d %d\n", a[0], a[1], a[2], a[3]); 13 | 14 | int b[4]; 15 | 16 | b = a; 17 | 18 | printf("%d %d %d %d\n", b[0], b[1], b[2], b[3]); 19 | 20 | return 0; 21 | } 22 | 23 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 24 | -------------------------------------------------------------------------------- /win32/include/sys/fcntl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * This fcntl.h maps to the root fcntl.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/blberr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __SDPBLB_ERROR_CODES__ 7 | #define __SDPBLB_ERROR_CODES__ 8 | 9 | #include 10 | 11 | #define SDPBLB_CONF_BLOB_DESTROYED 0xe0000300 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/sys/fcntl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * This fcntl.h maps to the root fcntl.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | -------------------------------------------------------------------------------- /tests/tests2/136_atomic_gcc_style.expect: -------------------------------------------------------------------------------- 1 | assert "loaded == 42" : yes 2 | assert "success" : yes 3 | assert "atomic_var == 200" : yes 4 | assert "expected == 100" : yes 5 | assert "!success" : yes 6 | assert "atomic_var == 100" : yes 7 | assert "expected == 100" : yes 8 | assert "atomic_var == 60" : yes 9 | assert "loaded_ptr == NULL" : yes 10 | assert "__atomic_load_n(&atomic_var, __ATOMIC_RELAXED) == 10" : yes 11 | All atomic tests passed! 12 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/wbemidl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __WBEMIDL_H_ 7 | #define __WBEMIDL_H_ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /win32/lib_w32api/vdmdbg.def: -------------------------------------------------------------------------------- 1 | LIBRARY VDMDBG.dll 2 | EXPORTS 3 | VDMBreakThread@8 4 | VDMDetectWOW@0 5 | VDMEnumProcessWOW@8 6 | VDMEnumTaskWOW@12 7 | VDMGetModuleSelector@20 8 | VDMGetPointer@20 9 | VDMGetSelectorModule@32 10 | VDMGetThreadContext@8 11 | VDMGetThreadSelectorEntry@16 12 | VDMGlobalFirst@24 13 | VDMGlobalNext@24 14 | VDMKillWOW@0 15 | VDMModuleFirst@20 16 | VDMModuleNext@20 17 | VDMProcessException@4 18 | VDMSetThreadContext@8 19 | -------------------------------------------------------------------------------- /win32/include/stdalign.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDALIGN_H 2 | #define _STDALIGN_H 3 | 4 | #if __STDC_VERSION__ < 201112L && (defined(__GNUC__) || defined(__TINYC__)) 5 | # define _Alignas(t) __attribute__((__aligned__(t))) 6 | # define _Alignof(t) __alignof__(t) 7 | #endif 8 | 9 | #define alignas _Alignas 10 | #define alignof _Alignof 11 | 12 | #define __alignas_is_defined 1 13 | #define __alignof_is_defined 1 14 | 15 | #endif /* _STDALIGN_H */ 16 | 17 | -------------------------------------------------------------------------------- /win32/include/sys/file.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * This file.h maps to the root fcntl.h 10 | * TODO? 11 | */ 12 | #ifndef __STRICT_ANSI__ 13 | #include 14 | #endif 15 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/sys/file.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * This file.h maps to the root fcntl.h 10 | * TODO? 11 | */ 12 | #ifndef __STRICT_ANSI__ 13 | #include 14 | #endif 15 | -------------------------------------------------------------------------------- /tests/tests2/47_switch_return.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void fred(int x) 4 | { 5 | switch (x) 6 | { 7 | case 1: printf("1\n"); return; 8 | case 2: printf("2\n"); break; 9 | case 3: printf("3\n"); return; 10 | } 11 | 12 | printf("out\n"); 13 | } 14 | 15 | int main() 16 | { 17 | fred(1); 18 | fred(2); 19 | fred(3); 20 | 21 | return 0; 22 | } 23 | 24 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 25 | -------------------------------------------------------------------------------- /tests/tests2/40_stdio.expect: -------------------------------------------------------------------------------- 1 | hello 2 | ch: 104 'h' 3 | ch: 101 'e' 4 | ch: 108 'l' 5 | ch: 108 'l' 6 | ch: 111 'o' 7 | ch: 10 '.' 8 | ch: 104 'h' 9 | ch: 101 'e' 10 | ch: 108 'l' 11 | ch: 108 'l' 12 | ch: 111 'o' 13 | ch: 10 '.' 14 | ch: 104 'h' 15 | ch: 101 'e' 16 | ch: 108 'l' 17 | ch: 108 'l' 18 | ch: 111 'o' 19 | ch: 10 '.' 20 | ch: 104 'h' 21 | ch: 101 'e' 22 | ch: 108 'l' 23 | ch: 108 'l' 24 | ch: 111 'o' 25 | ch: 10 '.' 26 | x: hello 27 | x: hello 28 | -------------------------------------------------------------------------------- /tests/tests2/72_long_long_constant.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | long long int res = 0; 6 | 7 | if (res < -2147483648LL) { 8 | printf("Error: 0 < -2147483648\n"); 9 | return 1; 10 | } 11 | else 12 | if (2147483647LL < res) { 13 | printf("Error: 2147483647 < 0\n"); 14 | return 2; 15 | } 16 | else 17 | printf("long long constant test ok.\n"); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /win32/include/winapi/ws2ipdef.h: -------------------------------------------------------------------------------- 1 | #ifndef _WS2IPDEF_H 2 | #define _WS2IPDEF_H 3 | 4 | #if __GNUC__ >=3 5 | #pragma GCC system_header 6 | #endif 7 | 8 | #include 9 | 10 | struct ip_mreq { 11 | struct in_addr imr_multiaddr; 12 | struct in_addr imr_interface; 13 | }; 14 | 15 | struct ip_mreq_source { 16 | struct in_addr imr_multiaddr; 17 | struct in_addr imr_sourceaddr; 18 | struct in_addr imr_interface; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /win32/include_w32api/afxres.h: -------------------------------------------------------------------------------- 1 | #ifndef _AFXRES_H 2 | #define _AFXRES_H 3 | #if __GNUC__ >= 3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #ifndef _WINDOWS_H 12 | #include 13 | #endif 14 | 15 | /* IDC_STATIC is documented in winuser.h, but not defined. */ 16 | #ifndef IDC_STATIC 17 | #define IDC_STATIC (-1) 18 | #endif 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /tests/tests2/106_pthread.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main(void) 7 | { 8 | int ret; 9 | pthread_condattr_t attr; 10 | pthread_cond_t condition; 11 | 12 | pthread_condattr_init (&attr); 13 | pthread_condattr_setpshared (&attr, PTHREAD_PROCESS_SHARED); 14 | printf ("%s\n", pthread_cond_init (&condition, &attr) ? "fail":"ok"); 15 | pthread_condattr_destroy (&attr); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /tests/tests2/48_nested_break.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a; 6 | char b; 7 | 8 | a = 0; 9 | while (a < 2) 10 | { 11 | printf("%d", a++); 12 | break; 13 | 14 | b = 'A'; 15 | while (b < 'C') 16 | { 17 | printf("%c", b++); 18 | } 19 | printf("e"); 20 | } 21 | printf("\n"); 22 | 23 | return 0; 24 | } 25 | 26 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 27 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/mspab.h: -------------------------------------------------------------------------------- 1 | #define PAB_PROVIDER_ID { 0xB5,0x3b,0xc2,0xc0,0x2c,0x77,0x10,0x1a,0xa1,0xbc,0x08,0x00,0x2b,0x2a,0x56,0xc2 } 2 | 3 | #define PR_PAB_PATH PROP_TAG(PT_TSTRING,0x6600) 4 | #define PR_PAB_PATH_W PROP_TAG(PT_UNICODE,0x6600) 5 | #define PR_PAB_PATH_A PROP_TAG(PT_STRING8,0x6600) 6 | 7 | #define PR_PAB_DET_DIR_VIEW_BY PROP_TAG(PT_LONG,0x6601) 8 | 9 | #define PAB_DIR_VIEW_FIRST_THEN_LAST 0 10 | #define PAB_DIR_VIEW_LAST_THEN_FIRST 1 11 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/wab.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/wpftpmsg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #define FTPWPP_ERROR_FIRST 0x40042300L 7 | #define FTPWPP_ERROR_INETOPEN_FAILED 0xC0042301L 8 | #define FTPWPP_ERROR_AUTHENTICATION_FAILED 0xC0042302L 9 | #define FTPWPP_ERROR_LAST 0x400423FFL 10 | -------------------------------------------------------------------------------- /win32/lib_w32api/wow32.def: -------------------------------------------------------------------------------- 1 | LIBRARY WOW32.DLL 2 | EXPORTS 3 | WOWCallback16@8 4 | WOWCallback16Ex@20 5 | WOWDirectedYield16@4 6 | WOWGetDescriptor@8 7 | WOWGetVDMPointer@12 8 | WOWGetVDMPointerFix@12 9 | WOWGetVDMPointerUnfix@4 10 | WOWGlobalAlloc16@8 11 | WOWGlobalAllocLock16@12 12 | WOWGlobalFree16@4 13 | WOWGlobalLock16@4 14 | WOWGlobalLockSize16@8 15 | WOWGlobalUnlock16@4 16 | WOWGlobalUnlockFree16@4 17 | WOWHandle16@8 18 | WOWHandle32@8 19 | WOWYield16@0 20 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/usbkern.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __USBKERN_H__ 3 | #define __USBKERN_H__ 4 | 5 | #include "usbiodef.h" 6 | 7 | #define IOCTL_INTERNAL_USB_GET_HUB_COUNT USB_KERNEL_CTL(USB_GET_HUB_COUNT) 8 | #define IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO USB_KERNEL_CTL(USB_GET_ROOTHUB_PDO) 9 | 10 | #define IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE \ 11 | CTL_CODE(FILE_DEVICE_USB, USB_GET_DEVICE_HANDLE, METHOD_NEITHER, FILE_ANY_ACCESS) 12 | 13 | #endif 14 | 15 | 16 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/afxres.h: -------------------------------------------------------------------------------- 1 | #ifndef _AFXRES_H 2 | #define _AFXRES_H 3 | #if __GNUC__ >= 3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #ifndef _WINDOWS_H 12 | #include 13 | #endif 14 | 15 | /* IDC_STATIC is documented in winuser.h, but not defined. */ 16 | #ifndef IDC_STATIC 17 | #define IDC_STATIC (-1) 18 | #endif 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /lib/fetch_and_add_riscv64.S: -------------------------------------------------------------------------------- 1 | .text 2 | .align 2 3 | .global fetch_and_add_riscv64 4 | .type fetch_and_add_riscv64, %function 5 | fetch_and_add_riscv64: 6 | #ifdef __TINYC__ 7 | .int 0x0f50000f 8 | .int 0x004b5202f 9 | .short 0x8082 10 | #else 11 | fence iorw,ow 12 | amoadd.w.aq zero,a1,0(a0) 13 | ret 14 | #endif 15 | 16 | .size fetch_and_add_riscv64, .-fetch_and_add_riscv64 17 | -------------------------------------------------------------------------------- /tests/42test.h: -------------------------------------------------------------------------------- 1 | /* This file is to test compute #include directives. It's named so 2 | that it starts with a pre-processing number which isn't a valid 3 | number (42test.h). Including this must work. */ 4 | #ifndef INC42_FIRST 5 | int have_included_42test_h; 6 | #define INC42_FIRST 7 | #elif !defined INC42_SECOND 8 | #define INC42_SECOND 9 | int have_included_42test_h_second; 10 | #else 11 | #define INC42_THIRD 12 | int have_included_42test_h_third; 13 | #endif 14 | -------------------------------------------------------------------------------- /win32/examples/fib.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include // atoi() 3 | 4 | int fib(n) 5 | { 6 | if (n <= 2) 7 | return 1; 8 | else 9 | return fib(n-1) + fib(n-2); 10 | } 11 | 12 | int main(int argc, char **argv) 13 | { 14 | int n; 15 | if (argc < 2) { 16 | printf("usage: fib n\n" 17 | "Compute nth Fibonacci number\n"); 18 | return 1; 19 | } 20 | 21 | n = atoi(argv[1]); 22 | printf("fib(%d) = %d\n", n, fib(n)); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /win32/include_extn/sehmap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __cplusplus 7 | #undef try 8 | #undef except 9 | #undef finally 10 | #undef leave 11 | #define try __try 12 | #define except __except 13 | #define finally __finally 14 | #define leave __leave 15 | #endif 16 | -------------------------------------------------------------------------------- /tcc_0.9.27/examples/fib.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include // atoi() 3 | 4 | int fib(n) 5 | { 6 | if (n <= 2) 7 | return 1; 8 | else 9 | return fib(n-1) + fib(n-2); 10 | } 11 | 12 | int main(int argc, char **argv) 13 | { 14 | int n; 15 | if (argc < 2) { 16 | printf("usage: fib n\n" 17 | "Compute nth Fibonacci number\n"); 18 | return 1; 19 | } 20 | 21 | n = atoi(argv[1]); 22 | printf("fib(%d) = %d\n", n, fib(n)); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /tests/tests2/02_printf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | printf("Hello world\n"); 6 | 7 | int Count; 8 | for (Count = -5; Count <= 5; Count++) 9 | printf("Count = %d\n", Count); 10 | 11 | printf("String 'hello', 'there' is '%s', '%s'\n", "hello", "there"); 12 | printf("Character 'A' is '%c'\n", 65); 13 | printf("Character 'a' is '%c'\n", 'a'); 14 | 15 | return 0; 16 | } 17 | 18 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 19 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/smpab.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #define PR_SAB_FILE PROP_TAG(PT_STRING8,0x6604) 7 | #define PR_SAB_UID PROP_TAG(PT_BINARY,0x6601) 8 | 9 | #define SAB_PROVIDER_ID {0x34,0xda,0x7e,0x60,0x03,0x1b,0x11,0xce,0x95,0x74,0x00,0xaa,0x00,0x3c,0xd2,0x07} 10 | -------------------------------------------------------------------------------- /tests/tests2/134_double_to_signed.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() { 3 | printf("%d\n", (int)-1.0); 4 | double d = -1.0; 5 | printf("%d\n", (int)d); 6 | 7 | printf("%d\n", (int)-2147483648.0); 8 | d = -2147483648.0; 9 | printf("%d\n", (int)d); 10 | 11 | #ifndef _WIN32 12 | printf("%llu\n", (unsigned long long)1e19); 13 | #else 14 | /* some msvc compiler won't compile tcc correctly in this ragard */ 15 | printf("10000000000000000000\n"); 16 | #endif 17 | } 18 | -------------------------------------------------------------------------------- /tests/tests2/49_bracket_evaluation.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct point 4 | { 5 | double x; 6 | double y; 7 | }; 8 | 9 | struct point point_array[100]; 10 | 11 | int main() 12 | { 13 | int my_point = 10; 14 | 15 | point_array[my_point].x = 12.34; 16 | point_array[my_point].y = 56.78; 17 | 18 | printf("%f, %f\n", point_array[my_point].x, point_array[my_point].y); 19 | 20 | return 0; 21 | } 22 | 23 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 24 | -------------------------------------------------------------------------------- /win32/lib_w32api/oleacc.def: -------------------------------------------------------------------------------- 1 | LIBRARY Oleacc.dll 2 | EXPORTS 3 | AccessibleChildren@20 4 | AccessibleObjectFromEvent@20 5 | AccessibleObjectFromPoint@16 6 | AccessibleObjectFromWindow@16 7 | CreateStdAccessibleObject@16 8 | CreateStdAccessibleProxyA@20 9 | CreateStdAccessibleProxyW@20 10 | GetOleaccVersionInfo@8 11 | GetRoleTextA@12 12 | GetRoleTextW@12 13 | GetStateTextA@12 14 | GetStateTextW@12 15 | LresultFromObject@12 16 | ObjectFromLresult@16 17 | WindowFromAccessibleObject@8 18 | -------------------------------------------------------------------------------- /examples/ex3.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int fib(n) 4 | { 5 | if (n <= 2) 6 | return 1; 7 | else 8 | return fib(n-1) + fib(n-2); 9 | } 10 | 11 | int main(int argc, char **argv) 12 | { 13 | int n; 14 | if (argc < 2) { 15 | printf("usage: fib n\n" 16 | "Compute nth Fibonacci number\n"); 17 | return 1; 18 | } 19 | 20 | n = atoi(argv[1]); 21 | printf("fib(%d) = %d\n", n, fib(n, 2)); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /tests/pp/03.c: -------------------------------------------------------------------------------- 1 | #define str(s) # s 2 | #define xstr(s) str(s) 3 | #define debug(s, t) printf("x" # s "= %d, x" # t "= %s", \ 4 | x ## s, x ## t) 5 | #define INCFILE(n) vers ## n 6 | #define glue(a, b) a ## b 7 | #define xglue(a, b) glue(a, b) 8 | #define HIGHLOW "hello" 9 | #define LOW LOW ", world" 10 | debug(1, 2); 11 | fputs(str(strncmp("abc\0d", "abc", '\4') // this goes away 12 | == 0) str(: @\n), s); 13 | \#include xstr(INCFILE(2).h) 14 | glue(HIGH, LOW); 15 | xglue(HIGH, LOW) 16 | -------------------------------------------------------------------------------- /lib/fetch_and_add_arm.S: -------------------------------------------------------------------------------- 1 | .text 2 | .align 2 3 | .global fetch_and_add_arm 4 | .type fetch_and_add_arm, %function 5 | fetch_and_add_arm: 6 | mcr p15, #0, r0, c7, c10, #5 7 | .L0: 8 | ldrex r3, [r0] 9 | add r3, r3, r1 10 | strex r2, r3, [r0] 11 | cmp r2, #0 12 | bne .L0 13 | mcr p15, #0, r0, c7, c10, #5 14 | bx lr 15 | .size fetch_and_add_arm, .-fetch_and_add_arm 16 | -------------------------------------------------------------------------------- /tests/tests2/20_pointer_comparison.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a; 6 | int b; 7 | int *d; 8 | int *e; 9 | d = &a; 10 | e = &b; 11 | a = 12; 12 | b = 34; 13 | printf("%d\n", *d); 14 | printf("%d\n", *e); 15 | printf("%d\n", d == e); 16 | printf("%d\n", d != e); 17 | d = e; 18 | printf("%d\n", d == e); 19 | printf("%d\n", d != e); 20 | 21 | return 0; 22 | } 23 | 24 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 25 | -------------------------------------------------------------------------------- /win32/include_w32api/vidcap.h: -------------------------------------------------------------------------------- 1 | #ifndef _VIDCAP_H 2 | #define _VIDCAP_H 3 | #if __GNUC__ >= 3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | /*--- DirectShow Reference - DirectShow Structures */ 12 | typedef struct { 13 | ULONG FromNode; 14 | ULONG FromNodePin; 15 | ULONG ToNode; 16 | ULONG ToNodePin; 17 | } KSTOPOLOGY_CONNECTION; 18 | #define KSFILTER_NODE 0xFFFFFFFF 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /win32/lib_w32api/version.def: -------------------------------------------------------------------------------- 1 | LIBRARY "VERSION.dll" 2 | EXPORTS 3 | GetFileVersionInfoA@16 4 | GetFileVersionInfoExA@20 5 | GetFileVersionInfoExW@20 6 | GetFileVersionInfoSizeA@8 7 | GetFileVersionInfoSizeExA@12 8 | GetFileVersionInfoSizeExW@12 9 | GetFileVersionInfoSizeW@8 10 | GetFileVersionInfoW@16 11 | VerFindFileA@32 12 | VerFindFileW@32 13 | VerInstallFileA@32 14 | VerInstallFileW@32 15 | VerQueryValueA@16 16 | VerQueryValueIndexA@24 17 | VerQueryValueIndexW@24 18 | VerQueryValueW@16 19 | -------------------------------------------------------------------------------- /tests/pp/15.c: -------------------------------------------------------------------------------- 1 | // insert a space between two tokens if otherwise they 2 | // would form a single token when read back 3 | 4 | #define n(x) x 5 | 6 | return (n(long)n(double))d; 7 | return n(A)n(++)n(+)n(B); 8 | return n(A)n(+)n(++)n(B); 9 | return n(A)n(++)n(+)n(+)n(B); 10 | 11 | // not a hex float 12 | return n(0x1E)n(-1); 13 | 14 | // unlike gcc but correct 15 | // XXX: return n(x)+n(x)-n(1)+n(1)-2; 16 | 17 | // unlike gcc, but cannot appear in valid C 18 | // XXX: return n(x)n(x)n(1)n(2)n(x); 19 | -------------------------------------------------------------------------------- /tests/tests2/103_implicit_memmove.c: -------------------------------------------------------------------------------- 1 | /* Test that the memmove TCC is emitting for the struct copy 2 | and hence implicitely declares can be declared properly also 3 | later. */ 4 | struct S { int a,b,c,d, e[1024];}; 5 | int foo (struct S *a, struct S *b) 6 | { 7 | *a = *b; 8 | return 0; 9 | } 10 | 11 | void *memmove(void*,const void*,__SIZE_TYPE__); 12 | void foo2 (struct S *a, struct S *b) 13 | { 14 | memmove(a, b, sizeof *a); 15 | } 16 | 17 | int main() 18 | { 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /tests/tests2/133_old_func.c: -------------------------------------------------------------------------------- 1 | int printf(const char *s, ...); 2 | 3 | float fx(x) 4 | float x; 5 | { 6 | return 2.0 * x; 7 | } 8 | 9 | void func(float a); 10 | 11 | int 12 | main(void) 13 | { 14 | float fy(); 15 | 16 | printf("%g %g\n", fx(2.0), fy(10.0)); 17 | printf("%g %g\n", fx(2.0f), fy(10.0f)); 18 | func(1); 19 | } 20 | 21 | float fy(x) 22 | float x; 23 | { 24 | return 3.0 * x; 25 | } 26 | 27 | void func(a) 28 | float a; 29 | { 30 | printf("%g\n", a); 31 | } 32 | -------------------------------------------------------------------------------- /win32/tccboot/example/boot/tccargs: -------------------------------------------------------------------------------- 1 | # This file contains the TinyCC command line arguments needed to 2 | # compile the hello.c program. 3 | 4 | # the output binary (DO NOT CHANGE IT) 5 | -o kernel 6 | # no default libraries 7 | -nostdlib 8 | # no default includes paths 9 | -nostdinc 10 | # statically linked output 11 | -static 12 | # address of the start of the .text section 13 | -Wl,-Ttext,000100000 14 | # force binary output format 15 | -Wl,--oformat,binary 16 | # sources files 17 | hello.c 18 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/wppstmsg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #define WPP_ERROR_FIRST 0x40042380L 7 | #define WPP_POST_POSTING_URL_ERROR 0xC0042381L 8 | #define WPP_POST_POSTING_SERVER_ERROR 0xC0042382L 9 | #define WPP_POST_POSTING_NO_RESPONSE_ERROR 0xC0042383L 10 | #define WPP_ERROR_LAST 0x400423FFL 11 | -------------------------------------------------------------------------------- /win32/include_w32api/stm.h: -------------------------------------------------------------------------------- 1 | #ifndef _STM_H 2 | #define _STM_H 3 | #if __GNUC__ >= 3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #if (_WIN32_WINNT >= 0x0500) 12 | typedef struct _IPX_SERVER_ENTRY { 13 | USHORT Type; 14 | UCHAR Name[48]; 15 | UCHAR Network[4]; 16 | UCHAR Node[6]; 17 | UCHAR Socket[2]; 18 | USHORT HopCount; 19 | } IPX_SERVER_ENTRY,*PIPX_SERVER_ENTRY; 20 | #endif 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | #endif 26 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/xmldsodid.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __XMLDSODID_H__ 3 | #define __XMLDSODID_H__ 4 | #define DISPID_XOBJ_MIN 0x00010000 5 | #define DISPID_XOBJ_MAX 0x0001FFFF 6 | #define DISPID_XOBJ_BASE DISPID_XOBJ_MIN 7 | #define DISPID_XMLDSO DISPID_XOBJ_BASE 8 | #define DISPID_XMLDSO_DOCUMENT DISPID_XMLDSO + 1 9 | #define DISPID_XMLDSO_JAVADSOCOMPATIBLE DISPID_XMLDSO_DOCUMENT + 1 10 | #endif -------------------------------------------------------------------------------- /win32/lib_w32api/mlang-uuid.c: -------------------------------------------------------------------------------- 1 | /* mlang-uuid.c */ 2 | /* Generate GUIDs for Object Multi Language interfaces */ 3 | 4 | /* All IIDs defined in this file were extracted from 5 | * HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\ */ 6 | 7 | /* All CLSIDs defined in this file were extracted from 8 | * HKEY_CLASSES_ROOT\CLSID\ */ 9 | 10 | #define INITGUID 11 | #include 12 | // Multi Language Support CLSID 13 | DEFINE_GUID(CLSID_CMultiLanguage,0x275c23e2,0x3747,0x11d0,0x9f,0xea,0,0xaa,0,0x3f,0x86,0x46); 14 | -------------------------------------------------------------------------------- /win32/lib_w32api/svrapi.def: -------------------------------------------------------------------------------- 1 | LIBRARY SVRAPI.DLL 2 | EXPORTS 3 | NetAccessAdd@16 4 | NetAccessCheck@20 5 | NetAccessDel@8 6 | NetAccessEnum@32 7 | NetAccessGetInfo@24 8 | NetAccessGetUserPerms@16 9 | NetAccessSetInfo@24 10 | NetConnectionEnum@28 11 | NetFileClose2@8 12 | NetFileEnum@28 13 | NetSecurityGetInfo@20 14 | NetServerGetInfo@20 15 | NetSessionDel@12 16 | NetSessionEnum@24 17 | NetSessionGetInfo@24 18 | NetShareAdd@16 19 | NetShareDel@12 20 | NetShareEnum@24 21 | NetShareGetInfo@24 22 | NetShareSetInfo@24 23 | -------------------------------------------------------------------------------- /tests/tests2/106_versym.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main(void) 7 | { 8 | int ret; 9 | pthread_condattr_t attr; 10 | pthread_cond_t condition; 11 | 12 | /* This test fails if symbol versioning does not work */ 13 | pthread_condattr_init (&attr); 14 | pthread_condattr_setpshared (&attr, PTHREAD_PROCESS_SHARED); 15 | printf ("%s\n", pthread_cond_init (&condition, &attr) ? "fail":"ok"); 16 | pthread_condattr_destroy (&attr); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/tests2/120+_alias.c: -------------------------------------------------------------------------------- 1 | extern int printf (const char *, ...); 2 | extern void target(void); 3 | extern void alias_for_target(void); 4 | extern void asm_for_target(void); 5 | extern int g_int, alias_int; 6 | 7 | void inunit2(void); 8 | 9 | void inunit2(void) 10 | { 11 | printf("in unit2:\n"); 12 | target(); 13 | alias_for_target(); 14 | /* This symbol is not supposed to be available in this unit: 15 | asm_for_target(); 16 | */ 17 | printf("g_int = %d\nalias_int = %d\n", g_int, alias_int); 18 | } 19 | -------------------------------------------------------------------------------- /win32/lib_w32api/rtm.def: -------------------------------------------------------------------------------- 1 | LIBRARY RTM.DLL 2 | EXPORTS 3 | MgmAddGroupMembershipEntry@32 4 | MgmDeleteGroupMembershipEntry@32 5 | MgmDeRegisterMProtocol@4 6 | MgmGetFirstMfe@12 7 | MgmGetFirstMfeStats@16 8 | MgmGetMfe@12 9 | MgmGetMfeStats@16 10 | MgmGetNextMfe@16 11 | MgmGetNextMfeStats@20 12 | MgmGetProtocolOnInterface@16 13 | MgmGroupEnumerationEnd@4 14 | MgmGroupEnumerationGetNext@16 15 | MgmGroupEnumerationStart@12 16 | MgmRegisterMProtocol@16 17 | MgmReleaseInterfaceOwnership@12 18 | MgmTakeInterfaceOwnership@12 19 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/mdcommsg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _COMMSG_H_ 7 | #define _COMMSG_H_ 8 | 9 | #define RETURNCODETOHRESULT(rc) (((rc) < 0x10000) ? HRESULT_FROM_WIN32(rc) : (rc)) 10 | #define HRESULTTOWIN32(hres) ((HRESULT_FACILITY(hres)==FACILITY_WIN32) ? HRESULT_CODE(hres) : (hres)) 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /win32/lib_w32api/oleacc-uuid.c: -------------------------------------------------------------------------------- 1 | /* oleacc-uuid.c */ 2 | /* Generate GUIDs for OLE Accessibility interfaces */ 3 | 4 | /* All IIDs defined in this file were extracted from 5 | * HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\ */ 6 | 7 | #define INITGUID 8 | #include 9 | DEFINE_GUID(IID_IAccessible,0x618736e0,0x3c3d,0x11cf,0x81,0x0c,0x00,0xaa,0x00,0x38,0x9b,0x71); 10 | // IAccessibleHandler TypeLib 11 | DEFINE_GUID(LIBID_Accessibility, 0x1ea4dbf0, 0x3c3b,0x11cf, 0x81, 0x0c, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); 12 | -------------------------------------------------------------------------------- /tests/tests2/19_pointer_arithmetic.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a; 6 | int *b; 7 | int *c; 8 | 9 | a = 42; 10 | b = &a; 11 | c = NULL; 12 | 13 | printf("%d\n", *b); 14 | 15 | if (b == NULL) 16 | printf("b is NULL\n"); 17 | else 18 | printf("b is not NULL\n"); 19 | 20 | if (c == NULL) 21 | printf("c is NULL\n"); 22 | else 23 | printf("c is not NULL\n"); 24 | 25 | return 0; 26 | } 27 | 28 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 29 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/ieverp.h: -------------------------------------------------------------------------------- 1 | 2 | #define VER_MAJOR_PRODUCTVER 6 3 | #define VER_MINOR_PRODUCTVER 0 4 | 5 | #undef VER_PRODUCTBUILD 6 | #define VER_PRODUCTBUILD 2900 7 | #define VER_PRODUCTVERSION VER_MAJOR_PRODUCTVER,VER_MINOR_PRODUCTVER,VER_PRODUCTBUILD,VER_PRODUCTBUILD_QFE 8 | #define VER_PRODUCTVERSION_W (0x0600) 9 | #define VER_PRODUCTVERSION_DW (0x06000000 | VER_PRODUCTBUILD) 10 | #define VER_PRODUCTBETA_STR "" 11 | #define VER_PRODUCTVERSION_STRING "6.00" 12 | 13 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/sspguid.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _SSPGUID_H_ 7 | #define _SSPGUID_H_ 8 | 9 | #define IID_DEFINED 10 | 11 | #include "scardssp_i.c" 12 | 13 | #ifndef CLSCTX_LOCAL 14 | #define CLSCTX_LOCAL (CLSCTX_INPROC_SERVER| CLSCTX_INPROC_HANDLER| CLSCTX_LOCAL_SERVER) 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /tests/tests2/137_funcall_struct_args.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // arm64-gen.c: gfunc_call() Second pass when struct args may overwrite previous func call result 4 | struct vec { 5 | float x; 6 | float y; 7 | }; 8 | 9 | void bug(float x, float y) { 10 | printf("x=%f\ny=%f\n", x, y); 11 | } 12 | 13 | float dot(struct vec v) { 14 | return 999.5; 15 | } 16 | 17 | void main(void) { 18 | struct vec a; 19 | a.x = 33.0f; 20 | a.y = 77.0f; 21 | bug(dot(a), dot(a)); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/cplext.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_CPLEXT 7 | #define _INC_CPLEXT 8 | 9 | #define CPLPAGE_MOUSE_BUTTONS 1 10 | #define CPLPAGE_MOUSE_PTRMOTION 2 11 | #define CPLPAGE_MOUSE_WHEEL 3 12 | 13 | #define CPLPAGE_KEYBOARD_SPEED 1 14 | 15 | #define CPLPAGE_DISPLAY_BACKGROUND 1 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /tests/tests2/07_function.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int myfunc(int x) 4 | { 5 | return x * x; 6 | } 7 | 8 | void vfunc(int a) 9 | { 10 | printf("a=%d\n", a); 11 | } 12 | 13 | void qfunc() 14 | { 15 | printf("qfunc()\n"); 16 | } 17 | 18 | void zfunc() 19 | { 20 | ((void (*)(void))0) (); 21 | } 22 | 23 | int main() 24 | { 25 | printf("%d\n", myfunc(3)); 26 | printf("%d\n", myfunc(4)); 27 | 28 | vfunc(1234); 29 | 30 | qfunc(); 31 | 32 | return 0; 33 | } 34 | 35 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 36 | -------------------------------------------------------------------------------- /tests/tests2/110_average.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef struct 4 | { 5 | double average; 6 | int count; 7 | } 8 | stats_type; 9 | 10 | static void 11 | testc (stats_type *s, long long data) 12 | { 13 | s->average = (s->average * s->count + data) / (s->count + 1); 14 | s->count++; 15 | } 16 | 17 | int main (void) 18 | { 19 | stats_type s; 20 | 21 | s.average = 0; 22 | s.count = 0; 23 | testc (&s, 10); 24 | testc (&s, 20); 25 | printf ("%g %d\n", s.average, s.count); 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /tests/tests2/42_function_pointer.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int fred(int p) 4 | { 5 | printf("yo %d\n", p); 6 | return 42; 7 | } 8 | 9 | int (*f)(int) = &fred; 10 | 11 | /* To test what this is supposed to test the destination function 12 | (fprint here) must not be called directly anywhere in the test. */ 13 | int (*fprintfptr)(FILE *, const char *, ...) = &fprintf; 14 | 15 | int main() 16 | { 17 | fprintfptr(stdout, "%d\n", (*f)(24)); 18 | 19 | return 0; 20 | } 21 | 22 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 23 | -------------------------------------------------------------------------------- /tests/tests2/109_float_struct_calling.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* This test used to fail on x86_64 on linux with sse registers */ 4 | 5 | struct Point { 6 | float x; 7 | float y; 8 | }; 9 | 10 | struct Rect { 11 | struct Point top_left; 12 | struct Point size; 13 | }; 14 | 15 | float foo(struct Point p, struct Rect r) { 16 | return r.size.x; 17 | } 18 | 19 | int main(int argc, char **argv) { 20 | struct Point p = {1, 2}; 21 | struct Rect r = {{3, 4}, {5, 6}}; 22 | printf("%f\n", foo(p, r)); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /win32/examples/hello_dll.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // HELLO_DLL.C - Windows DLL example - main application part 4 | // 5 | 6 | #include 7 | 8 | void hello_func (void); 9 | __declspec(dllimport) extern const char *hello_data; 10 | 11 | int WINAPI WinMain( 12 | HINSTANCE hInstance, 13 | HINSTANCE hPrevInstance, 14 | LPSTR lpCmdLine, 15 | int nCmdShow) 16 | { 17 | hello_data = "Hello World!"; 18 | hello_func(); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /win32/include_extn/sys/cdefs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _SYS_CDEFS_H 7 | #define _SYS_CDEFS_H 8 | #ifdef __cplusplus 9 | #define __BEGIN_DECLS extern "C" { 10 | #define __END_DECLS } 11 | #else 12 | #define __BEGIN_DECLS 13 | #define __END_DECLS 14 | #endif 15 | #define __P(protos) protos /* full-blown ANSI C */ 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/rnderr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __RND_ERROR_CODES__ 7 | #define __RND_ERROR_CODES__ 8 | 9 | #include 10 | 11 | #define RND_INVALID_TIME 0xe0000200 12 | #define RND_NULL_SERVER_NAME 0xe0000201 13 | #define RND_ALREADY_CONNECTED 0xe0000202 14 | #define RND_NOT_CONNECTED 0xe0000203 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /tcc_0.9.27/examples/hello_dll.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // HELLO_DLL.C - Windows DLL example - main application part 4 | // 5 | 6 | #include 7 | 8 | void hello_func (void); 9 | __declspec(dllimport) extern const char *hello_data; 10 | 11 | int WINAPI WinMain( 12 | HINSTANCE hInstance, 13 | HINSTANCE hPrevInstance, 14 | LPSTR lpCmdLine, 15 | int nCmdShow) 16 | { 17 | hello_data = "Hello World!"; 18 | hello_func(); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/mtxdm.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __MTXDM_H__ 7 | #define __MTXDM_H__ 8 | 9 | #include "comsvcs.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | __declspec(dllimport) HRESULT __cdecl GetDispenserManager(IDispenserManager **); 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | #endif 21 | -------------------------------------------------------------------------------- /win32/include_w32api/lmapibuf.h: -------------------------------------------------------------------------------- 1 | #ifndef _LMAPIBUF_H 2 | #define _LMAPIBUF_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | NET_API_STATUS WINAPI NetApiBufferAllocate(DWORD,PVOID*); 11 | NET_API_STATUS WINAPI NetApiBufferFree(PVOID); 12 | NET_API_STATUS WINAPI NetApiBufferReallocate(PVOID,DWORD,PVOID*); 13 | NET_API_STATUS WINAPI NetApiBufferSize(PVOID,PDWORD); 14 | NET_API_STATUS WINAPI NetapipBufferAllocate(DWORD,PVOID*); 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /tests/tests2/51_static.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static int fred = 1234; 4 | static int joe; 5 | 6 | void henry() 7 | { 8 | static int fred = 4567; 9 | 10 | printf("%d\n", fred); 11 | fred++; 12 | } 13 | 14 | int main() 15 | { 16 | printf("%d\n", fred); 17 | henry(); 18 | henry(); 19 | henry(); 20 | henry(); 21 | printf("%d\n", fred); 22 | fred = 8901; 23 | joe = 2345; 24 | printf("%d\n", fred); 25 | printf("%d\n", joe); 26 | 27 | return 0; 28 | } 29 | 30 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 31 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/minmax.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_MINMAX 7 | #define _INC_MINMAX 8 | 9 | #ifndef __cplusplus 10 | #ifndef NOMINMAX 11 | #ifndef max 12 | #define max(a,b) (((a) > (b)) ? (a) : (b)) 13 | #endif 14 | 15 | #ifndef min 16 | #define min(a,b) (((a) < (b)) ? (a) : (b)) 17 | #endif 18 | #endif 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /tests/tests2/135_func_arg_struct_compare.c: -------------------------------------------------------------------------------- 1 | // https://lists.nongnu.org/archive/html/tinycc-devel/2024-12/msg00019.html 2 | // x86_64/i386 void gfunc_call(int nb_args), when push struct args, need fetch cpu flag before generating any code 3 | 4 | #include 5 | 6 | struct string { 7 | char *str; 8 | int len; 9 | }; 10 | 11 | void dummy(struct string fpath, int dump_arg) { 12 | } 13 | 14 | int main() { 15 | int a = 1; 16 | struct string x; 17 | x.str = "gg.v"; 18 | x.len = 4; 19 | dummy(x, a == 0); 20 | printf("done\n"); 21 | return 0; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /tests/tests2/52_unnamed_enum.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | enum fred { a, b, c }; 4 | 5 | int main() 6 | { 7 | printf("a=%d\n", a); 8 | printf("b=%d\n", b); 9 | printf("c=%d\n", c); 10 | 11 | enum fred d; 12 | 13 | typedef enum { e, f, g } h; 14 | typedef enum { i, j, k } m; 15 | 16 | printf("e=%d\n", e); 17 | printf("f=%d\n", f); 18 | printf("g=%d\n", g); 19 | 20 | printf("i=%d\n", i); 21 | printf("j=%d\n", j); 22 | printf("k=%d\n", k); 23 | 24 | return 0; 25 | } 26 | 27 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 28 | -------------------------------------------------------------------------------- /win32/lib_w32api/comdlg32.def: -------------------------------------------------------------------------------- 1 | LIBRARY COMDLG32.DLL 2 | EXPORTS 3 | ChooseColorA@4 4 | ChooseColorW@4 5 | ChooseFontA@4 6 | ChooseFontW@4 7 | CommDlgExtendedError@0 8 | FindTextA@4 9 | FindTextW@4 10 | GetFileTitleA@12 11 | GetFileTitleW@12 12 | GetOpenFileNameA@4 13 | GetOpenFileNameW@4 14 | GetSaveFileNameA@4 15 | GetSaveFileNameW@4 16 | LoadAlterBitmap@12 17 | PageSetupDlgA@4 18 | PageSetupDlgW@4 19 | PrintDlgA@4 20 | PrintDlgExA@4 21 | PrintDlgExW@4 22 | PrintDlgW@4 23 | ReplaceTextA@4 24 | ReplaceTextW@4 25 | WantArrows@16 26 | dwLBSubclass@16 27 | dwOKSubclass@16 28 | -------------------------------------------------------------------------------- /tests/pp/20.c: -------------------------------------------------------------------------------- 1 | /* Various things I encountered while hacking the pre processor */ 2 | #define wrap(x) x 3 | #define pr_warning(fmt, ...) printk(KERN_WARNING fmt, ##__VA_ARGS__) 4 | #define pr_warn(x,y) pr_warning(x,y) 5 | #define net_ratelimited_function(function, ...) function(__VA_ARGS__) 6 | X1 net_ratelimited_function(pr_warn, "pipapo", bla); 7 | X2 net_ratelimited_function(wrap(pr_warn), "bla", foo); 8 | #define two m n 9 | #define chain4(a,b,c,d) a ## b ## c ## d 10 | X2 chain4(two,o,p,q) 11 | X3 chain4(o,two,p,q) 12 | X4 chain4(o,p,two,q) 13 | X5 chain4(o,p,q,two) 14 | -------------------------------------------------------------------------------- /win32/include/sec_api/crtdbg_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _INC_CRTDBG_S 8 | #define _INC_CRTDBG_S 9 | 10 | #include 11 | 12 | #if defined(MINGW_HAS_SECURE_API) 13 | 14 | #define _dupenv_s_dbg(ps1,size,s2,t,f,l) _dupenv_s(ps1,size,s2) 15 | #define _wdupenv_s_dbg(ps1,size,s2,t,f,l) _wdupenv_s(ps1,size,s2) 16 | 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /tcc_0.9.27/include/sec_api/crtdbg_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _INC_CRTDBG_S 8 | #define _INC_CRTDBG_S 9 | 10 | #include 11 | 12 | #if defined(MINGW_HAS_SECURE_API) 13 | 14 | #define _dupenv_s_dbg(ps1,size,s2,t,f,l) _dupenv_s(ps1,size,s2) 15 | #define _wdupenv_s_dbg(ps1,size,s2,t,f,l) _wdupenv_s(ps1,size,s2) 16 | 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /tests/tests2/06_case.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int Count; 6 | 7 | for (Count = 0; Count < 4; Count++) 8 | { 9 | printf("%d\n", Count); 10 | switch (Count) 11 | { 12 | case 1: 13 | printf("%d\n", 1); 14 | break; 15 | 16 | case 2: 17 | printf("%d\n", 2); 18 | break; 19 | 20 | default: 21 | printf("%d\n", 0); 22 | break; 23 | } 24 | } 25 | 26 | return 0; 27 | } 28 | 29 | // vim: set expandtab ts=4 sw=3 sts=3 tw=80 : 30 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/polarity.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef POLARITY_HEADERFILE_IS_INCLUDED 7 | #define POLARITY_HEADERFILE_IS_INCLUDED 8 | 9 | #ifdef USE_POLARITY 10 | #ifdef BUILDING_DLL 11 | #define POLARITY __declspec(dllexport) 12 | #else 13 | #define POLARITY __declspec(dllimport) 14 | #endif 15 | #else 16 | #define POLARITY 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /win32/include_extn/libgen.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _LIBGEN_H_ 8 | #define _LIBGEN_H_ 9 | 10 | #include <_mingw.h> 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | char * __cdecl __MINGW_NOTHROW basename (char *); 17 | char * __cdecl __MINGW_NOTHROW dirname (char *); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /win32/lib_w32api/shobjidl-uuid.c: -------------------------------------------------------------------------------- 1 | /* shobjidl-uuid.c */ 2 | /* Generate GUIDs for Object IDL interfaces */ 3 | 4 | /* All CLSIDs defined in this file were extracted from 5 | * HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\ */ 6 | 7 | /* All IIDs defined in this file were extracted from 8 | * HKEY_CLASSES_ROOT\Interface\ */ 9 | 10 | #define INITGUID 11 | #include 12 | DEFINE_GUID(IID_ITaskbarList3,0xea1afb91,0x9e28,0x4b86,0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf); 13 | DEFINE_GUID(CLSID_ITaskbarList,0x56FDF342L,0xFD6D,0x11d0,0x95,0x8A,0x00,0x60,0x97,0xC9,0xA0,0x90); 14 | -------------------------------------------------------------------------------- /win32/include_extn/readme.txt: -------------------------------------------------------------------------------- 1 | This is the full set of winapi headers from the mingw-64 project 2 | from 2009/12/20 (gcc version 4.5.0 experimental). 3 | 4 | A part of these files is already included (with minor modifications) 5 | with the tcc-0.9.27 release. Original versions of these files can 6 | be found in the 'orig' folder. 7 | 8 | The other files (from the 'include' folder) may be copied to the tcc 9 | installation or used with -I or -isystem. 10 | 11 | Compatibility with tcc has not been checked. Do not expect everything 12 | to work out of the box under all circumstances. 13 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dsetup.def: -------------------------------------------------------------------------------- 1 | LIBRARY dsetup.dll 2 | EXPORTS 3 | DirectXDeviceDriverSetupA@16 4 | DirectXDeviceDriverSetupW@16 5 | DirectXLoadString@12 6 | DirectXRegisterApplicationA@8 7 | DirectXRegisterApplicationW@8 8 | DirectXSetupA@12 9 | DirectXSetupCallback@20 10 | DirectXSetupGetEULAA@12 11 | DirectXSetupGetEULAW@12 12 | DirectXSetupGetFileVersion@12 13 | DirectXSetupGetVersion@8 14 | DirectXSetupIsEng@0 15 | DirectXSetupIsJapan@0 16 | DirectXSetupIsJapanNec@0 17 | DirectXSetupSetCallback@4 18 | DirectXSetupShowEULA@4 19 | DirectXSetupW@12 20 | DirectXUnRegisterApplication@8 21 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/d3dhalex.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef _D3DHALEX_H 4 | #define _D3DHALEX_H 5 | #define D3DGDI_IS_GDI2(pData) ((((DD_GETDRIVERINFO2DATA*)(pData->lpvData))->dwMagic) == D3DGDI2_MAGIC) 6 | #define D3DGDI_IS_STEREOMODE(pData) ((((DD_STEREOMODE*) (pData->lpvData))->dwHeight) != D3DGDI2_MAGIC) 7 | #define D3DGDI_GET_GDI2_DATA(pData) (D3DGDI_IS_GDI2(pData) ? (((DD_GETDRIVERINFO2DATA*)(pData->lpvData))) : NULL) 8 | #define D3DGDI_GET_STEREOMODE_DATA(pData) (D3DGDI_IS_STEREOMODE(pData) ? (((DD_STEREOMODE*)(pData->lpvData))) : NULL) 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dxerr8.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | dxerr8.c - DirectX 8 Error Functions 4 | 5 | Written by Filip Navara 6 | 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | 11 | */ 12 | 13 | #define DXGetErrorString DXGetErrorString8A 14 | #define DXGetErrorDescription DXGetErrorDescription8A 15 | #define DXTrace DXTraceA 16 | #define DXERROR8(v,n,d) {v, n, d}, 17 | #define DXERROR8LAST(v,n,d) {v, n, d} 18 | #include "dxerr.c" 19 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dxerr9.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | dxerr9.c - DirectX 9 Error Functions 4 | 5 | Written by Filip Navara 6 | 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | 11 | */ 12 | 13 | #define DXGetErrorString DXGetErrorString9A 14 | #define DXGetErrorDescription DXGetErrorDescription9A 15 | #define DXTrace DXTraceA 16 | #define DXERROR9(v,n,d) {v, n, d}, 17 | #define DXERROR9LAST(v,n,d) {v, n, d} 18 | #include "dxerr.c" 19 | -------------------------------------------------------------------------------- /win32/lib_w32api/mswsock.def: -------------------------------------------------------------------------------- 1 | LIBRARY MSWSOCK.DLL 2 | EXPORTS 3 | AcceptEx@32 4 | EnumProtocolsA@12 5 | EnumProtocolsW@12 6 | GetAcceptExSockaddrs@32 7 | GetAddressByNameA@40 8 | GetAddressByNameW@40 9 | GetNameByTypeA@12 10 | GetNameByTypeW@12 11 | GetServiceA@28 12 | GetServiceW@28 13 | GetTypeByNameA@8 14 | GetTypeByNameW@8 15 | MigrateWinsockConfiguration@12 16 | NPLoadNameSpaces@12 17 | SetServiceA@24 18 | SetServiceW@24 19 | TransmitFile@28 20 | WSARecvEx@16 21 | dn_expand@20 22 | getnetbyname@4 23 | inet_network@4 24 | rcmd@24 25 | rexec@24 26 | rresvport@4 27 | s_perror@8 28 | sethostname@8 29 | -------------------------------------------------------------------------------- /win32/include_extn/crtdefs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include <_mingw.h> 7 | 8 | #ifndef __ERRCODE_DEFINED_MS 9 | #define __ERRCODE_DEFINED_MS 10 | typedef int errcode; 11 | #endif 12 | 13 | #ifndef _CRTNOALIAS 14 | #define _CRTNOALIAS 15 | #endif 16 | 17 | #ifndef _CRTRESTRICT 18 | #define _CRTRESTRICT 19 | #endif 20 | 21 | #ifndef __crt_typefix 22 | #define __crt_typefix(ctype) 23 | #endif 24 | -------------------------------------------------------------------------------- /win32/include_w32api/wsipx.h: -------------------------------------------------------------------------------- 1 | /* WSIPX.H - contributed by the WINE project 2 | */ 3 | 4 | #ifndef _WSIPX_H 5 | #define _WSIPX_H 6 | #if __GNUC__ >=3 7 | #pragma GCC system_header 8 | #endif 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #define NSPROTO_IPX 1000 15 | #define NSPROTO_SPX 1256 16 | #define NSPROTO_SPXII 1257 17 | 18 | typedef struct sockaddr_ipx { 19 | short sa_family; 20 | char sa_netnum[4]; 21 | char sa_nodenum[6]; 22 | unsigned short sa_socket; 23 | } SOCKADDR_IPX, *PSOCKADDR_IPX, *LPSOCKADDR_IPX; 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif 29 | -------------------------------------------------------------------------------- /win32/include_extn/strings.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | File: strings.h 8 | Copyright: Public Domain 9 | 10 | This file is provided because non ANSI fuctions are described in string.h 11 | that belong in strings.h. These functions are provided for in the OLDNAME 12 | libraries. 13 | */ 14 | #ifndef _STRINGS_H_ 15 | #define _STRINGS_H_ 1 16 | #include 17 | #endif 18 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/wsipx.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _WSIPX_ 7 | #define _WSIPX_ 8 | 9 | typedef struct sockaddr_ipx { 10 | short sa_family; 11 | char sa_netnum[4]; 12 | char sa_nodenum[6]; 13 | unsigned short sa_socket; 14 | } SOCKADDR_IPX,*PSOCKADDR_IPX,*LPSOCKADDR_IPX; 15 | 16 | #define NSPROTO_IPX 1000 17 | #define NSPROTO_SPX 1256 18 | #define NSPROTO_SPXII 1257 19 | #endif 20 | -------------------------------------------------------------------------------- /tests/tests2/38_multiple_array_index.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int a[4][4]; 6 | int b = 0; 7 | int x; 8 | int y; 9 | 10 | for (x = 0; x < 4; x++) 11 | { 12 | for (y = 0; y < 4; y++) 13 | { 14 | b++; 15 | a[x][y] = b; 16 | } 17 | } 18 | 19 | for (x = 0; x < 4; x++) 20 | { 21 | printf("x=%d: ", x); 22 | for (y = 0; y < 4; y++) 23 | { 24 | printf("%d ", a[x][y]); 25 | } 26 | printf("\n"); 27 | } 28 | 29 | return 0; 30 | } 31 | 32 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 33 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/scrptids.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #define DISPID_LOAD 1 7 | #define DISPID_UNLOAD 2 8 | #define DISPID_SUBMIT 3 9 | #define DISPID_FOCUS 4 10 | #define DISPID_CHANGE 5 11 | #define DISPID_BLUR 6 12 | #define DISPID_SELECT 7 13 | #define DISPID_MOUSEOVER 8 14 | #define DISPID_PARSECOMPLETE 9 15 | #define DISPID_ABORT 10 16 | #define DISPID_ERROR 11 17 | #define DISPID_MOUSEOUT 12 18 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/dderror.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _DDERROR_ 3 | #define _DDERROR_ 4 | #define _WINERROR_ 5 | #define NO_ERROR 0 6 | #define ERROR_INVALID_FUNCTION 1 7 | #define ERROR_NOT_ENOUGH_MEMORY 8 8 | #define ERROR_DEV_NOT_EXIST 55 9 | #define ERROR_INVALID_PARAMETER 87 10 | #define ERROR_INSUFFICIENT_BUFFER 122 11 | #define ERROR_INVALID_NAME 123 12 | #define ERROR_BUSY 170 13 | #define ERROR_MORE_DATA 234 14 | #define WAIT_TIMEOUT 258 15 | #define ERROR_IO_PENDING 997 16 | #define ERROR_DEVICE_REINITIALIZATION_NEEDED 1164 17 | #define ERROR_CONTINUE 1246 18 | #define ERROR_NO_MORE_DEVICES 1248 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /win32/lib_w32api/oledlg.def: -------------------------------------------------------------------------------- 1 | LIBRARY OLEDLG.DLL 2 | EXPORTS 3 | OleUIAddVerbMenuA@36 4 | OleUIAddVerbMenuW@36 5 | OleUIBusyA@4 6 | OleUIBusyW@4 7 | OleUICanConvertOrActivateAs@12 8 | OleUIChangeIconA@4 9 | OleUIChangeIconW@4 10 | OleUIChangeSourceA@4 11 | OleUIChangeSourceW@4 12 | OleUIConvertA@4 13 | OleUIConvertW@4 14 | OleUIEditLinksA@4 15 | OleUIEditLinksW@4 16 | OleUIInsertObjectA@4 17 | OleUIInsertObjectW@4 18 | OleUIObjectPropertiesA@4 19 | OleUIObjectPropertiesW@4 20 | OleUIPasteSpecialA@4 21 | OleUIPasteSpecialW@4 22 | OleUIPromptUserA 23 | OleUIPromptUserW 24 | OleUIUpdateLinksA@16 25 | OleUIUpdateLinksW@16 26 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/atsmedia.h: -------------------------------------------------------------------------------- 1 | 2 | /* $Id: $ 3 | * 4 | * COPYRIGHT: This file is in the public domain. 5 | * PROJECT: ReactOS kernel 6 | * FILE: 7 | * PURPOSE: headers 8 | * PROGRAMMER: Magnus Olsen (greatlrd) 9 | * 10 | */ 11 | 12 | #if !defined(_ATSCMEDIA_) 13 | #define _ATSCMEDIA_ 14 | #define BDANETWORKTYPE_ATSC DEFINE_GUIDNAMED(BDANETWORKTYPE_ATSC) 15 | #define STATIC_BDANETWORKTYPE_ATSC 0x71985F51, 0x1CA1, 0x11D3, 0x9C, 0xC8, 0x0, 0xC0, 0x4F, 0x79, 0x71, 0xE0 16 | DEFINE_GUIDSTRUCT("71985F51-1CA1-11D3-9CC8-00C04F7971E0", BDANETWORKTYPE_ATSC); 17 | #endif 18 | -------------------------------------------------------------------------------- /win32/include_extn/syslimits.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* syslimits.h stands for the system's own limits.h file. 7 | If we can use it ok unmodified, then we install this text. 8 | If fixincludes fixes it, then the fixed version is installed 9 | instead of this text. */ 10 | 11 | #define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */ 12 | #include_next 13 | #undef _GCC_NEXT_LIMITS_H 14 | -------------------------------------------------------------------------------- /win32/include_w32api/lm.h: -------------------------------------------------------------------------------- 1 | #ifndef _LM_H 2 | #define _LM_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/ntddft.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _NTDDFT_ 3 | #define _NTDDFT_ 4 | 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define FTTYPE ((ULONG)'f') 11 | 12 | #define FT_SECONDARY_READ CTL_CODE(FTTYPE, 4, METHOD_OUT_DIRECT, FILE_READ_ACCESS) 13 | #define FT_PRIMARY_READ CTL_CODE(FTTYPE, 5, METHOD_OUT_DIRECT, FILE_READ_ACCESS) 14 | #define FT_BALANCED_READ_MODE CTL_CODE(FTTYPE, 6, METHOD_NEITHER, FILE_ANY_ACCESS) 15 | #define FT_SYNC_REDUNDANT_COPY CTL_CODE(FTTYPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS) 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /tests/tests2/21_char_array.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int x = 'a'; 6 | char y = x; 7 | 8 | char *a = "hello"; 9 | 10 | printf("%s\n", a); 11 | 12 | int c; 13 | c = *a; 14 | 15 | char *b; 16 | for (b = a; *b != 0; b++) 17 | printf("%c: %d\n", *b, *b); 18 | 19 | char destarray[10]; 20 | char *dest = &destarray[0]; 21 | char *src = a; 22 | 23 | while (*src != 0) 24 | *dest++ = *src++; 25 | 26 | *dest = 0; 27 | 28 | printf("copied string is %s\n", destarray); 29 | 30 | return 0; 31 | } 32 | 33 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 34 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/idispids.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #define DISPID_READYSTATE (-525) 7 | #define DISPID_READYSTATECHANGE (-609) 8 | #define DISPID_AMBIENT_TRANSFERPRIORITY (-728) 9 | #define DISPID_AMBIENT_OFFLINEIFNOTCONNECTED (-5501) 10 | #define DISPID_AMBIENT_SILENT (-5502) 11 | 12 | #ifndef DISPID_AMBIENT_CODEPAGE 13 | #define DISPID_AMBIENT_CODEPAGE (-725) 14 | #define DISPID_AMBIENT_CHARSET (-727) 15 | #endif 16 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/d3drm.def: -------------------------------------------------------------------------------- 1 | LIBRARY d3drm.dll 2 | EXPORTS 3 | D3DRMColorGetAlpha@4 4 | D3DRMColorGetBlue@4 5 | D3DRMColorGetGreen@4 6 | D3DRMColorGetRed@4 7 | D3DRMCreateColorRGB@12 8 | D3DRMCreateColorRGBA@16 9 | D3DRMMatrixFromQuaternion@8 10 | D3DRMQuaternionFromRotation@12 11 | D3DRMQuaternionMultiply@12 12 | D3DRMQuaternionSlerp@16 13 | D3DRMVectorAdd@12 14 | D3DRMVectorCrossProduct@12 15 | D3DRMVectorDotProduct@8 16 | D3DRMVectorModulus@4 17 | D3DRMVectorNormalize@4 18 | D3DRMVectorRandom@4 19 | D3DRMVectorReflect@12 20 | D3DRMVectorRotate@16 21 | D3DRMVectorScale@12 22 | D3DRMVectorSubtract@12 23 | Direct3DRMCreate@4 24 | -------------------------------------------------------------------------------- /win32/lib_w32api/hlguids-uuid.c: -------------------------------------------------------------------------------- 1 | /* hlguids-uuid.c */ 2 | /* Generate GUIDs for HyperLink GUID interfaces */ 3 | 4 | /* All IIDs defined in this file were extracted from 5 | * HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\ */ 6 | 7 | /* All CLSIDs defined in this file were extracted from 8 | * HKEY_CLASSES_ROOT\CLSID\ */ 9 | 10 | #define INITGUID 11 | #include 12 | // StdHlink CLSID 13 | DEFINE_GUID(CLSID_StdHlink,0x79eac9d0,0xbaf9,0x11ce,0x8c,0x82,0,0xaa,0,0x4b,0xa9,0xb); 14 | // StdHlinkBrowseContext CLSID 15 | DEFINE_GUID(CLSID_StdHlinkBrowseContext,0x79eac9d1,0xbaf9,0x11ce,0x8c,0x82,0,0xaa,0,0x4b,0xa9,0xb); 16 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/xmldsodid.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __XMLDSODID_H__ 7 | #define __XMLDSODID_H__ 8 | 9 | #define DISPID_XOBJ_MIN 0x00010000 10 | #define DISPID_XOBJ_MAX 0x0001FFFF 11 | #define DISPID_XOBJ_BASE DISPID_XOBJ_MIN 12 | 13 | #define DISPID_XMLDSO DISPID_XOBJ_BASE 14 | #define DISPID_XMLDSO_DOCUMENT DISPID_XMLDSO + 1 15 | #define DISPID_XMLDSO_JAVADSOCOMPATIBLE DISPID_XMLDSO_DOCUMENT + 1 16 | #endif 17 | -------------------------------------------------------------------------------- /win32/lib_w32api/ctl3d32.def: -------------------------------------------------------------------------------- 1 | LIBRARY CTL3D32.DLL 2 | EXPORTS 3 | BtnWndProc3d@16 4 | ComboWndProc3d@16 5 | Ctl3dAutoSubclass@4 6 | Ctl3dAutoSubclassEx@8 7 | Ctl3dColorChange@0 8 | Ctl3dCtlColor@8 9 | Ctl3dCtlColorEx@12 10 | Ctl3dDlgFramePaint@16 11 | Ctl3dDlgProc@16 12 | Ctl3dEnabled@0 13 | Ctl3dGetVer@0 14 | Ctl3dIsAutoSubclass@0 15 | Ctl3dRegister@4 16 | Ctl3dSetStyle@12 17 | Ctl3dSubclassCtl@4 18 | Ctl3dSubclassCtlEx@8 19 | Ctl3dSubclassDlg@8 20 | Ctl3dSubclassDlgEx@8 21 | Ctl3dUnAutoSubclass@0 22 | Ctl3dUnregister@4 23 | Ctl3dUnsubclassCtl@4 24 | Ctl3dWinIniChange@0 25 | EditWndProc3d@16 26 | ListWndProc3d@16 27 | StaticWndProc3d@16 28 | -------------------------------------------------------------------------------- /lib/fetch_and_add_arm64.S: -------------------------------------------------------------------------------- 1 | .text 2 | .align 2 3 | .global fetch_and_add_arm64 4 | .type fetch_and_add_arm64, %function 5 | fetch_and_add_arm64: 6 | #ifdef __TINYC__ 7 | .int 0x885f7c02 8 | .int 0x0b010042 9 | .int 0x8803fc02 10 | .int 0x35ffffa3 11 | .int 0xd5033bbf 12 | .int 0xd65f03c0 13 | #else 14 | ldxr w2, [x0] 15 | add w2, w2, w1 16 | stlxr w3, w2, [x0] 17 | cbnz w3, fetch_and_add_arm64 18 | dmb ish 19 | ret 20 | #endif 21 | 22 | .size fetch_and_add_arm64, .-fetch_and_add_arm64 23 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/polarity.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * COPYRIGHT: This file is in the public domain. 4 | * PROJECT: ReactOS kernel 5 | * FILE: 6 | * PURPOSE: 7 | * PROGRAMMER: Magnus Olsen (greatlrd) 8 | * 9 | */ 10 | 11 | #ifndef POLARITY_HEADERFILE_IS_INCLUDED 12 | #define POLARITY_HEADERFILE_IS_INCLUDED 13 | 14 | #ifdef USE_POLARITY 15 | #ifdef BUILDING_DLL 16 | #define POLARITY __declspec( dllexport ) 17 | #else 18 | #define POLARITY __declspec( dllimport ) 19 | #endif 20 | #else 21 | #define POLARITY 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/ieverp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #define VER_MAJOR_PRODUCTVER 6 7 | #define VER_MINOR_PRODUCTVER 0 8 | 9 | #define VER_PRODUCTVERSION VER_MAJOR_PRODUCTVER,VER_MINOR_PRODUCTVER,VER_PRODUCTBUILD,VER_PRODUCTBUILD_QFE 10 | #define VER_PRODUCTVERSION_W (0x0600) 11 | #define VER_PRODUCTVERSION_DW (0x06000000 | VER_PRODUCTBUILD) 12 | 13 | #define VER_PRODUCTBETA_STR "" 14 | #define VER_PRODUCTVERSION_STRING "6.00" 15 | -------------------------------------------------------------------------------- /win32/include_extn/setjmpex.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SETJMPEX 7 | #define _INC_SETJMPEX 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #if (defined(_X86_) && !defined(__x86_64)) 14 | #define setjmp _setjmp 15 | #define longjmp _longjmpex 16 | #else 17 | #ifdef setjmp 18 | #undef setjmp 19 | #endif 20 | #define setjmp _setjmpex 21 | #endif 22 | 23 | #include 24 | #endif 25 | -------------------------------------------------------------------------------- /win32/include_w32api/lmconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef _LMCONFIG_H 2 | #define _LMCONFIG_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | #define REVISED_CONFIG_APIS 11 | typedef struct _CONFIG_INFO_0 { 12 | LPWSTR cfgi0_key; 13 | LPWSTR cfgi0_data; 14 | } CONFIG_INFO_0,*PCONFIG_INFO_0,*LPCONFIG_INFO_0; 15 | NET_API_STATUS WINAPI NetConfigGet(LPCWSTR,LPCWSTR,LPCWSTR,PBYTE*); 16 | NET_API_STATUS WINAPI NetConfigGetAll(LPCWSTR,LPCWSTR,PBYTE*); 17 | NET_API_STATUS WINAPI NetConfigSet(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,DWORD,PBYTE,DWORD); 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/ntddbeep.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _NTDDBEEP_ 3 | #define _NTDDBEEP_ 4 | 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define DD_BEEP_DEVICE_NAME "\\Device\\Beep" 11 | #define DD_BEEP_DEVICE_NAME_U L"\\Device\\Beep" 12 | #define BEEP_FREQUENCY_MINIMUM 0x25 13 | #define BEEP_FREQUENCY_MAXIMUM 0x7FFF 14 | #define IOCTL_BEEP_SET CTL_CODE(FILE_DEVICE_BEEP, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) 15 | 16 | typedef struct _BEEP_SET_PARAMETERS 17 | { 18 | ULONG Frequency; 19 | ULONG Duration; 20 | } BEEP_SET_PARAMETERS, *PBEEP_SET_PARAMETERS; 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/wsvns.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _WSVNS_ 7 | #define _WSVNS_ 8 | 9 | typedef struct sockaddr_vns { 10 | u_short sin_family; 11 | u_char net_address[4]; 12 | u_char subnet_addr[2]; 13 | u_char port[2]; 14 | u_char hops; 15 | u_char filler[5]; 16 | } SOCKADDR_VNS,*PSOCKADDR_VNS,*LPSOCKADDR_VNS; 17 | 18 | #define VNSPROTO_IPC 1 19 | #define VNSPROTO_RELIABLE_IPC 2 20 | #define VNSPROTO_SPP 3 21 | #endif 22 | -------------------------------------------------------------------------------- /win32/tccboot/example/hello.c: -------------------------------------------------------------------------------- 1 | /* simple Hello World program on the QEMU serial port */ 2 | 3 | void puts(const char *s); 4 | 5 | void _start(void) 6 | { 7 | puts("Hello World\n"); 8 | while (1); 9 | } 10 | 11 | void outb(int port, int val) 12 | { 13 | asm("outb %b1, %w0" : : "d" (port), "a" (val)); 14 | } 15 | 16 | unsigned char inb(int port) 17 | { 18 | int val; 19 | asm("inb %w1, %b0" : "=a"(val) : "d" (port)); 20 | return val; 21 | } 22 | 23 | void puts(const char *s) 24 | { 25 | while (*s) { 26 | outb(0x3f8, *s++); 27 | while ((inb(0x3f8 + 5) & 0x60) != 0x60); 28 | } 29 | } 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /win32/lib/dllcrt1.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | 3 | #include 4 | #include 5 | #include "crtinit.c" 6 | 7 | BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved); 8 | 9 | BOOL WINAPI _dllstart(HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) 10 | { 11 | BOOL bRet; 12 | if (dwReason == DLL_PROCESS_ATTACH) /* ignore DLL_THREAD_ATTACH */ 13 | run_ctors(0, 0, 0); 14 | bRet = DllMain (hDll, dwReason, lpReserved); 15 | if (dwReason == DLL_PROCESS_DETACH) /* ignore DLL_THREAD_DETACH */ 16 | run_dtors(); 17 | return bRet; 18 | } 19 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/msstkppg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _MS_STOCK_PROP_PAGES_H_ 7 | #define _MS_STOCK_PROP_PAGES_H_ 8 | 9 | DEFINE_GUID(CLSID_StockFontPage,0x7ebdaae0,0x8120,0x11cf,0x89,0x9f,0x0,0xaa,0x0,0x68,0x8b,0x10); 10 | DEFINE_GUID(CLSID_StockColorPage,0x7ebdaae1,0x8120,0x11cf,0x89,0x9f,0x0,0xaa,0x0,0x68,0x8b,0x10); 11 | DEFINE_GUID(CLSID_StockPicturePage,0x7ebdaae2,0x8120,0x11cf,0x89,0x9f,0x0,0xaa,0x0,0x68,0x8b,0x10); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/winable.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _WINABLE_ 7 | #define _WINABLE_ 8 | 9 | #ifndef _WINABLE_ 10 | #define WINABLEAPI DECLSPEC_IMPORT 11 | #else 12 | #define WINABLEAPI 13 | #endif 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #include 20 | 21 | WINBOOL WINAPI BlockInput(WINBOOL fBlockIt); 22 | 23 | #define CCHILDREN_FRAME 7 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif 29 | -------------------------------------------------------------------------------- /win32/include_w32api/mpegtype.h: -------------------------------------------------------------------------------- 1 | #ifndef _MPEGTYPE_H 2 | #define _MPEGTYPE_H 3 | #if __GNUC__ >= 3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #include 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /*--- DirectShow Reference - DirectShow Structures */ 14 | typedef struct tagAM_MPEGSTREAMTYPE { 15 | DWORD dwStreamID; 16 | DWORD dwReserved; 17 | AM_MEDIA_TYPE mt; 18 | BYTE bFormat[1]; 19 | } AM_MPEGSTREAMTYPE; 20 | typedef struct tagAM_MPEGSYSTEMTYPE { 21 | DWORD dwBitRate; 22 | DWORD cStreams; 23 | AM_MPEGSTREAMTYPE Streams[1]; 24 | } AM_MPEGSYSTEMTYPE; 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /tests/tests2/122_vla_reuse.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int 4 | main (void) 5 | { 6 | int n = 0; 7 | int first=1; 8 | int *p[101]; 9 | if (0) { 10 | lab:; 11 | } 12 | int x[n % 100 + 1]; 13 | if (first == 0) { 14 | if (&x[0] != p[n % 100 + 1]) { 15 | printf ("ERROR: %p %p\n", &x[0], p[n % 100 + 1]); 16 | return(1); 17 | } 18 | } 19 | else { 20 | p[n % 100 + 1] = &x[0]; 21 | first = n < 100; 22 | } 23 | x[0] = 1; 24 | x[n % 100] = 2; 25 | n++; 26 | if (n < 100000) 27 | goto lab; 28 | printf ("OK\n"); 29 | return 0; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /tests/tests2/50_logical_second_arg.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int fred() 4 | { 5 | printf("fred\n"); 6 | return 0; 7 | } 8 | 9 | int joe() 10 | { 11 | printf("joe\n"); 12 | return 1; 13 | } 14 | 15 | int main() 16 | { 17 | printf("%d\n", fred() && joe()); 18 | printf("%d\n", fred() || joe()); 19 | printf("%d\n", joe() && fred()); 20 | printf("%d\n", joe() || fred()); 21 | printf("%d\n", fred() && (1 + joe())); 22 | printf("%d\n", fred() || (0 + joe())); 23 | printf("%d\n", joe() && (0 + fred())); 24 | printf("%d\n", joe() || (1 + fred())); 25 | 26 | return 0; 27 | } 28 | 29 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 30 | -------------------------------------------------------------------------------- /tests/tests2/80_flexarray.c: -------------------------------------------------------------------------------- 1 | #include 2 | struct wchar { 3 | char *data; char mem[]; 4 | }; 5 | struct wint { 6 | char *data; int mem[]; 7 | }; 8 | int f1char (void) { 9 | char s[9]="nonono"; 10 | struct wchar q = {"bugs"}; 11 | return !s[0]; 12 | } 13 | int f1int (void) { 14 | char s[9]="nonono"; 15 | struct wint q = {"bugs"}; 16 | return !s[0]; 17 | } 18 | int empty[] = {}; // GNU extension 19 | int main (void) { 20 | char s[9]="nonono"; 21 | static struct wchar q = {"bugs", {'c'}}; 22 | //printf ("tcc has %s %s\n", s, q.data); 23 | if (f1char() || f1int()) 24 | printf ("bla\n"); 25 | return !s[0]; 26 | } 27 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dxerr8w.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | dxerr8w.c - DirectX 8 Wide Character Error Functions 4 | 5 | Written by Filip Navara 6 | 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | 11 | */ 12 | 13 | #define UNICODE 14 | #define _UNICODE 15 | #define DXGetErrorString DXGetErrorString8W 16 | #define DXGetErrorDescription DXGetErrorDescription8W 17 | #define DXTrace DXTraceW 18 | #define DXERROR8(v,n,d) {v, L##n, L##d}, 19 | #define DXERROR8LAST(v,n,d) {v, L##n, L##d} 20 | #include "dxerr.c" 21 | 22 | -------------------------------------------------------------------------------- /win32/lib_w32api/directx/dxerr9w.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | dxerr9w.c - DirectX 9 Wide Character Error Functions 4 | 5 | Written by Filip Navara 6 | 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | 11 | */ 12 | 13 | #define UNICODE 14 | #define _UNICODE 15 | #define DXGetErrorString DXGetErrorString9W 16 | #define DXGetErrorDescription DXGetErrorDescription9W 17 | #define DXTrace DXTraceW 18 | #define DXERROR9(v,n,d) {v, L##n, L##d}, 19 | #define DXERROR9LAST(v,n,d) {v, L##n, L##d} 20 | #include "dxerr.c" 21 | 22 | -------------------------------------------------------------------------------- /win32/lib_w32api/psapi.def: -------------------------------------------------------------------------------- 1 | LIBRARY PSAPI.DLL 2 | EXPORTS 3 | EmptyWorkingSet@4 4 | EnumDeviceDrivers@12 5 | EnumProcesses@12 6 | EnumProcessModules@16 7 | GetDeviceDriverBaseNameA@12 8 | GetDeviceDriverBaseNameW@12 9 | GetDeviceDriverFileNameA@12 10 | GetDeviceDriverFileNameW@12 11 | GetMappedFileNameA@16 12 | GetMappedFileNameW@16 13 | GetModuleBaseNameA@16 14 | GetModuleBaseNameW@16 15 | GetModuleFileNameExA@16 16 | GetModuleFileNameExW@16 17 | GetModuleInformation@16 18 | GetPerformanceInfo@8 19 | GetProcessMemoryInfo@12 20 | GetProcessImageFileNameA@12 21 | GetProcessImageFileNameW@12 22 | GetWsChanges@12 23 | InitializeProcessForWsWatch@4 24 | QueryWorkingSet@12 25 | -------------------------------------------------------------------------------- /tests/bug.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int compile_errors(void) 5 | { 6 | #if TEST == 1 7 | { 8 | /* Not constant */ 9 | static int i = (&"Foobar"[1] - &"Foobar"[0]); 10 | } 11 | #endif 12 | #if TEST == 2 13 | { 14 | /* Not constant */ 15 | struct{int c;}v; 16 | static long i=((char*)&(v.c)-(char*)&v); 17 | } 18 | #endif 19 | #if TEST == 3 20 | { 21 | /* Not constant */ 22 | static const short ar[] = { &&l1 - &&l1, &&l2 - &&l1 }; 23 | void *p = &&l1 + ar[0]; 24 | goto *p; 25 | l1: return 1; 26 | l2: return 2; 27 | } 28 | #endif 29 | return 0; 30 | } 31 | 32 | int 33 | main(void) 34 | { 35 | } 36 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/isguids.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef _ISGUIDS_H_ 4 | #define _ISGUIDS_H_ 5 | 6 | DEFINE_GUID(CLSID_InternetShortcut, 0xFBF23B40L, 0xE3F0, 0x101B, 0x84, 0x88, 0x00, 0xAA, 0x00, 0x3E, 0x56, 0xF8); 7 | DEFINE_GUID(IID_IUniformResourceLocatorA, 0xFBF23B80L, 0xE3F0, 0x101B, 0x84, 0x88, 0x00, 0xAA, 0x00, 0x3E, 0x56, 0xF8); 8 | DEFINE_GUID(IID_IUniformResourceLocatorW, 0xCABB0DA0L, 0xDA57, 0x11CF, 0x99, 0x74, 0x00, 0x20, 0xAF, 0xD7, 0x97, 0x62); 9 | 10 | #ifdef UNICODE 11 | #define IID_IUniformResourceLocator IID_IUniformResourceLocatorW 12 | #else 13 | #define IID_IUniformResourceLocator IID_IUniformResourceLocatorA 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/stllock.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _STLLOCK_H_ 7 | #define _STLLOCK_H_ 8 | 9 | #ifdef __cplusplus 10 | 11 | class CCritSec : public CRITICAL_SECTION { 12 | public: 13 | CCritSec() { InitializeCriticalSection(this); } 14 | ~CCritSec() { DeleteCriticalSection(this); } 15 | void Enter() { EnterCriticalSection(this); } 16 | void Leave() { LeaveCriticalSection(this); } 17 | }; 18 | 19 | #endif /* __cplusplus */ 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /tests/tests2/97_utf8_string_literal.c: -------------------------------------------------------------------------------- 1 | // this file contains BMP chars encoded in UTF-8 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main() 8 | { 9 | char hello_world_in_czech[] = "čau, světe"; 10 | char hello_world_in_czech_ucn[] = "\u010dau, sv\u011bte"; 11 | if (sizeof(hello_world_in_czech) != sizeof(hello_world_in_czech_ucn) 12 | || strcmp(hello_world_in_czech, hello_world_in_czech_ucn)) 13 | abort(); 14 | 15 | wchar_t s[] = L"hello$$你好¢¢世界€€world"; 16 | wchar_t *p; 17 | for (p = s; *p; p++) printf("%04X ", (unsigned) *p); 18 | printf("\n"); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /win32/lib_w32api/powrprof.def: -------------------------------------------------------------------------------- 1 | LIBRARY POWRPROF.dll 2 | EXPORTS 3 | CallNtPowerInformation@20 4 | CanUserWritePwrScheme@0 5 | DeletePwrScheme@4 6 | EnumPwrSchemes@8 7 | GetActivePwrScheme@4 8 | GetCurrentPowerPolicies@8 9 | GetPwrCapabilities@4 10 | GetPwrDiskSpindownRange@8 11 | IsAdminOverrideActive@4 12 | IsPwrHibernateAllowed@0 13 | IsPwrShutdownAllowed@0 14 | IsPwrSuspendAllowed@0 15 | LoadCurrentPwrScheme@16 16 | MergeLegacyPwrScheme@16 17 | ReadGlobalPwrPolicy@4 18 | ReadProcessorPwrScheme@8 19 | ReadPwrScheme@8 20 | SetActivePwrScheme@12 21 | SetSuspendState@12 22 | ValidatePowerPolicies@8 23 | WriteGlobalPwrPolicy@4 24 | WriteProcessorPwrScheme@8 25 | WritePwrScheme@16 26 | -------------------------------------------------------------------------------- /tests/tests2/132_bound_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | union ieee_double_extract 5 | { 6 | struct { 7 | unsigned int manl:32; 8 | unsigned int manh:20; 9 | unsigned int exp:11; 10 | unsigned int sig:1; 11 | } s; 12 | double d; 13 | }; 14 | 15 | double scale(double d) 16 | { 17 | union ieee_double_extract x; 18 | 19 | x.d = d; 20 | x.d *= 1000; 21 | return x.d; 22 | } 23 | 24 | void mul(double *p) 25 | { 26 | *p *= 2.0; 27 | } 28 | 29 | int 30 | main(void) 31 | { 32 | double d = 4.0; 33 | printf("%g\n", scale(42)); 34 | mul(&d); 35 | printf("%g\n", d); 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /win32/cake/src/osstream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of cake compiler 3 | * https://github.com/thradams/cake 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | #include "ownership.h" 10 | 11 | struct osstream 12 | { 13 | char* _Owner _Opt c_str; 14 | int size; 15 | int capacity; 16 | }; 17 | 18 | 19 | void ss_close( _Dtor struct osstream * stream); 20 | 21 | int ss_vafprintf(struct osstream* stream, const char* fmt, va_list args); 22 | int ss_fprintf(struct osstream* stream, const char* fmt, ...); 23 | int ss_putc(char ch, struct osstream* stream); 24 | void ss_clear(struct osstream* stream); 25 | void ss_swap(struct osstream* a, struct osstream* b); 26 | -------------------------------------------------------------------------------- /win32/include_extn/winapi/recguids.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | DEFINE_GUID(IID_IReconcileInitiator,0x99180161L,0xDA16,0x101A,0x93,0x5C,0x44,0x45,0x53,0x54,0x00,0x00); 7 | DEFINE_GUID(IID_IReconcilableObject,0x99180162L,0xDA16,0x101A,0x93,0x5C,0x44,0x45,0x53,0x54,0x00,0x00); 8 | DEFINE_GUID(IID_INotifyReplica,0x99180163L,0xDA16,0x101A,0x93,0x5C,0x44,0x45,0x53,0x54,0x00,0x00); 9 | DEFINE_GUID(IID_IBriefcaseInitiator,0x99180164L,0xDA16,0x101A,0x93,0x5C,0x44,0x45,0x53,0x54,0x00,0x00); 10 | -------------------------------------------------------------------------------- /win32/lib_w32api/rpcdce4.def: -------------------------------------------------------------------------------- 1 | LIBRARY RPCDCE4.dll 2 | EXPORTS 3 | DceErrorInqTextA@8 4 | DceErrorInqTextW@8 5 | MIDL_user_allocate@4 6 | MIDL_user_free@4 7 | RpcBindingToStringBindingA@8 8 | RpcBindingToStringBindingW@8 9 | RpcMgmtEpEltInqBegin@24 10 | RpcMgmtEpEltInqDone@4 11 | RpcMgmtEpEltInqNextA@20 12 | RpcMgmtEpEltInqNextW@20 13 | RpcMgmtEpUnregister@16 14 | RpcMgmtInqIfIds@8 15 | RpcMgmtInqServerPrincNameA@12 16 | RpcMgmtInqServerPrincNameW@12 17 | RpcMgmtInqStats@8 18 | RpcMgmtIsServerListening@4 19 | RpcMgmtSetAuthorizationFn@4 20 | RpcMgmtStopServerListening@4 21 | RpcServerListen@12 22 | UuidCompare@12 23 | UuidCreateNil@4 24 | UuidEqual@12 25 | UuidHash@8 26 | UuidIsNil@8 27 | -------------------------------------------------------------------------------- /win32/cake/src/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of cake compiler 3 | * https://github.com/thradams/cake 4 | */ 5 | 6 | #pragma once 7 | 8 | typedef int errno_t; 9 | 10 | #if __STDC_VERSION__ >= 202311L 11 | #define NODISCARD [[nodiscard]] 12 | #else 13 | #define NODISCARD 14 | #endif 15 | 16 | 17 | #ifndef __CAKE__ 18 | 19 | //emulate _Countof 20 | #define _Countof(A) (sizeof(A)/sizeof((A)[0])) 21 | 22 | #define try 23 | #define catch if (0) catch_label: 24 | #define throw do { throw_break_point(); goto catch_label;}while (0) 25 | 26 | #endif 27 | 28 | const char* get_posix_error_message(int error); 29 | int windows_error_to_posix(int i); 30 | 31 | void throw_break_point(); -------------------------------------------------------------------------------- /win32/include_w32api/objsafe.h: -------------------------------------------------------------------------------- 1 | #ifndef _OBJSAFE_H 2 | #define _OBJSAFE_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define INTERFACESAFE_FOR_UNTRUSTED_CALLER 0x00000001 12 | #define INTERFACESAFE_FOR_UNTRUSTED_DATA 0x00000002 13 | 14 | EXTERN_C const IID IID_IObjectSafety; 15 | #define INTERFACE IObjectSafety 16 | DECLARE_INTERFACE_(IObjectSafety,IUnknown) 17 | { 18 | STDMETHOD(GetInterfaceSafetyOptions)(THIS_ REFIID,DWORD*,DWORD*) PURE; 19 | STDMETHOD(SetInterfaceSafetyOptions)(THIS_ REFIID,DWORD,DWORD) PURE; 20 | }; 21 | #undef INTERFACE 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /win32/include_extn/ddk/lmon.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifdef UNICODE 4 | #define PORT_INFO_FF PORT_INFO_FFW 5 | #define PPORT_INFO_FF PPORT_INFO_FFW 6 | #define LPPORT_INFO_FF LPPORT_INFO_FFW 7 | #else 8 | #define PORT_INFO_FF PORT_INFO_FFA 9 | #define PPORT_INFO_FF PPORT_INFO_FFA 10 | #define LPPORT_INFO_FF LPPORT_INFO_FFA 11 | #endif 12 | 13 | typedef struct _PORT_INFO_FFW 14 | { 15 | LPWSTR pName; 16 | DWORD cbMonitorData; 17 | LPBYTE pMonitorData; 18 | } PORT_INFO_FFW, *PPORT_INFO_FFW, *LPPORT_INFO_FFW; 19 | 20 | typedef struct _PORT_INFO_FFA 21 | { 22 | LPSTR pName; 23 | DWORD cbMonitorData; 24 | LPBYTE pMonitorData; 25 | } PORT_INFO_FFA, *PPORT_INFO_FFA, *LPPORT_INFO_FFA; 26 | 27 | 28 | -------------------------------------------------------------------------------- /tests/tests2/113_btdll.c: -------------------------------------------------------------------------------- 1 | int tcc_backtrace(const char*, ...); 2 | #define hello() \ 3 | tcc_backtrace("hello from %s() / %s:%d",__FUNCTION__,__FILE__,__LINE__) 4 | 5 | #ifndef _WIN32 6 | # define __declspec(n) 7 | #endif 8 | 9 | #if DLL==1 10 | __declspec(dllexport) int f_1() 11 | { 12 | hello(); 13 | return 0; 14 | } 15 | 16 | 17 | #elif DLL==2 18 | __declspec(dllexport) int f_2() 19 | { 20 | hello(); 21 | return 0; 22 | } 23 | 24 | 25 | #else 26 | 27 | int f_1(); 28 | int f_2(); 29 | int f_main() 30 | { 31 | hello(); 32 | return 0; 33 | } 34 | 35 | int main () 36 | { 37 | f_1(); 38 | f_2(); 39 | f_main(); 40 | return 0; 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /tests/pp/pp-counter.c: -------------------------------------------------------------------------------- 1 | X1 __COUNTER__ 2 | X2 __COUNTER__ 3 | #if __COUNTER__ 4 | X3 __COUNTER__ 5 | #endif 6 | #define pass(x) x 7 | #define a x __COUNTER__ y 8 | #define a2 pass(__COUNTER__) 9 | #define f(c) c __COUNTER__ 10 | #define apply(d) d d __COUNTER__ x2 f(d) y2 __COUNTER__ 11 | #define _paste(a,b) a ## b 12 | #define paste(a,b) _paste(a,b) 13 | #define _paste3(a,b,c) a ## b ## c 14 | #define doublepaste(a,b) _paste3(a,b,b) 15 | #define str(x) #x 16 | X4 a 17 | X5 f(a) 18 | X6 f(b) 19 | X7 f(__COUNTER__) 20 | X8 apply(a) 21 | X9 apply(f(a)) 22 | X10 apply(__COUNTER__) 23 | X11 apply(a2) 24 | X12 str(__COUNTER__) 25 | X13 paste(x,__COUNTER__) 26 | X14 _paste(x,__COUNTER__) 27 | X15 doublepaste(x,__COUNTER__) 28 | -------------------------------------------------------------------------------- /tests/tests2/36_array_initialisers.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern int Array3[10]; 4 | int Array3[] = { 12, 34, }; 5 | int main() 6 | { 7 | int Count; 8 | 9 | int Array[10] = { 12, 34, 56, 78, 90, 123, 456, 789, 8642, 9753 }; 10 | 11 | for (Count = 0; Count < 10; Count++) 12 | printf("%d: %d\n", Count, Array[Count]); 13 | 14 | int Array2[10] = { 12, 34, 56, 78, 90, 123, 456, 789, 8642, 9753, }; 15 | 16 | for (Count = 0; Count < 10; Count++) 17 | printf("%d: %d\n", Count, Array2[Count]); 18 | 19 | for (Count = 0; Count < 10; Count++) 20 | printf("%d: %d\n", Count, Array3[Count]); 21 | 22 | return 0; 23 | } 24 | 25 | /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ 26 | -------------------------------------------------------------------------------- /win32/cake/src/include/assert.h.include: -------------------------------------------------------------------------------- 1 | 2 | 47,42,13,10,32,42,32,32,84,104,105,115,32,102,105,108,101,32,105,115,32,112,97,114,116 3 | ,32,111,102,32,99,97,107,101,32,99,111,109,112,105,108,101,114,13,10,32,42,32,32,104,116 4 | ,116,112,115,58,47,47,103,105,116,104,117,98,46,99,111,109,47,116,104,114,97,100,97,109,115 5 | ,47,99,97,107,101,13,10,42,47,32,13,10,13,10,35,105,102,100,101,102,32,78,68,69,66 6 | ,85,71,13,10,35,100,101,102,105,110,101,32,97,115,115,101,114,116,40,46,46,46,41,32,40 7 | ,40,118,111,105,100,41,48,41,13,10,35,101,108,115,101,13,10,35,100,101,102,105,110,101,32 8 | ,97,115,115,101,114,116,40,46,46,46,41,32,97,115,115,101,114,116,40,95,95,86,65,95,65 9 | ,82,71,83,95,95,41,13,10,35,101,110,100,105,102,13,10 -------------------------------------------------------------------------------- /win32/include_extn/winapi/dde.rh: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #define WM_DDE_FIRST 0x03E0 7 | #define WM_DDE_INITIATE (WM_DDE_FIRST) 8 | #define WM_DDE_TERMINATE (WM_DDE_FIRST+1) 9 | #define WM_DDE_ADVISE (WM_DDE_FIRST+2) 10 | #define WM_DDE_UNADVISE (WM_DDE_FIRST+3) 11 | #define WM_DDE_ACK (WM_DDE_FIRST+4) 12 | #define WM_DDE_DATA (WM_DDE_FIRST+5) 13 | #define WM_DDE_REQUEST (WM_DDE_FIRST+6) 14 | #define WM_DDE_POKE (WM_DDE_FIRST+7) 15 | #define WM_DDE_EXECUTE (WM_DDE_FIRST+8) 16 | #define WM_DDE_LAST (WM_DDE_FIRST+8) 17 | -------------------------------------------------------------------------------- /win32/include_extn/ivec.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _IVEC_H_INCLUDED 7 | #define _IVEC_H_INCLUDED 8 | #ifndef RC_INVOKED 9 | 10 | #if !defined __cplusplus 11 | #error This file is only supported in C++ compilations! 12 | #endif 13 | 14 | #include 15 | #include 16 | #include 17 | #include <_mingw.h> 18 | 19 | #pragma pack(push,_CRT_PACKING) 20 | 21 | #if defined(_ENABLE_VEC_DEBUG) 22 | #include 23 | #endif 24 | 25 | #pragma pack(pop) 26 | 27 | #endif 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /tests/pp/02.c: -------------------------------------------------------------------------------- 1 | #define x 3 2 | #define f(a) f(x * (a)) 3 | #undef x 4 | #define x 2 5 | #define g f 6 | #define z z[0] 7 | #define h g(~ 8 | #define m(a) a(w) 9 | #define w 0,1 10 | #define t(a) a 11 | #define p() int 12 | #define q(x) x 13 | #define r(x,y) x ## y 14 | #define str(x) # x 15 | f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); 16 | g(x+(3,4)-w) | h 5) & m 17 | (f)^m(m); 18 | char c[2][6] = { str(hello), str() }; 19 | /* 20 | * f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); 21 | * f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1); 22 | * char c[2][6] = { "hello", "" }; 23 | */ 24 | #define L21 f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); 25 | #define L22 g(x+(3,4)-w) | h 5) & m\ 26 | (f)^m(m); 27 | L21 28 | L22 29 | -------------------------------------------------------------------------------- /win32/include/iso646.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the TinyCC package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | /* 8 | * ISO C Standard: 7.9 Alternative spellings 9 | */ 10 | 11 | #ifndef _ISO646_H_ 12 | #define _ISO646_H_ 13 | 14 | #define and && 15 | #define and_eq &= 16 | #define bitand & 17 | #define bitor | 18 | #define compl ~ 19 | #define not ! 20 | #define not_eq != 21 | #define or || 22 | #define or_eq |= 23 | #define xor ^ 24 | #define xor_eq ^= 25 | 26 | #endif /* _ISO646_H_ */ 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | --------------------------------------------------------------------------------