Commit Graph

17 Commits (5f33d313c8a2455ff9036cd7f7028339bdbde622)

Author SHA1 Message Date
grischka 5f33d313c8 tcc: re-enable correct option -r support
Forgot about it.  It allows to compile several
sources (and other .o's) to one single .o file;

    tcc -r -o all.o f1.c f2.c f3.S o4.o ...

Also:
- option -fold-struct-init-code removed, no effect anymore
- (tcc_)set_environment() moved to tcc.c
- win32/lib/(win)crt1 minor fix & add dependency
- debug line output for asm (tcc -c -g xxx.S) enabled
- configure/Makefiles: x86-64 -> x86_64 changes
- README: cleanup
2017-02-20 18:58:08 +01:00
grischka 096125d963 win32: adjust new unicode support
- lib/Makefile: add (win)crt1_w.o

- crt1.c/_runtmain: return to tcc & only use for UNICODE
  (because it might be not 100% reliable with for example
  wildcards (tcc *.c -run ...)

- tccrun.c/tccpe.c: load -run startup_code only if called
  from tcc_run(). Otherwise main may not be defined.  See
  libtcc_test.c

- tests2/Makefile: pass extra options in FLAGS to allow
  overriding TCC

Also:
- tccpe.c: support weak attribute.  (I first tried to solve
  the problem above by using it but then didn't)
2017-02-18 09:51:23 +01:00
YX Hao 86e3cd0c5a Add support for Unicode entries 'wmain' and 'wWinMain' on Windows
'-run' suported. argvs are converted.
But don't use compliled Unicode CLI exe-file to get inputs interactively in other codepage!
Please add other compliling supports than 'build-tcc.bat' (Who is good at them).
2017-02-17 21:09:26 +08:00
grischka 8637c1d0ad Remove misc. files
- from win32/include/winapi: various .h

  The winapi header set cannot be complete no matter what.  So
  lets have just the minimal set necessary to compile the examples.

- remove CMake support (hard to keep up to date)
- some other files

Also, drop useless changes in win32/lib/(win)crt1.c
2016-10-01 20:27:41 +02:00
seyko dfbb00c106 wincrt1.c: add definition of the __TRY__ if not defined
Some i686-pc-mingw32-gcc don't know about __TRY__
2015-03-03 22:35:33 +03:00
Carlos Montiers 77ef3b2929 crt1.c revision 2014-12-30 00:25:52 -03:00
Carlos Montiers 9b14e8715a little optimization to crt1 2014-11-23 01:51:38 -03:00
Carlos Montiers f40b82295e __getmainargs compatibility checking success 2014-11-22 19:00:49 -03:00
James Buren 1e07ea71d3 win32: fix implicit function warning
This includes windows.h to fix a warning about
an implicit function usage of ExitProcess().
2014-11-03 16:17:15 -06:00
Carlos Montiers 73a7dd79af Removed the error message and minor changes. 2014-07-17 01:08:47 -04:00
Carlos Montiers 7c474b4da3 __getmainargs return int, not void, and on error, it return -1 and let argv untouched, also argc. Added a if checking the result of it. 2014-07-16 22:22:05 -04:00
grischka 13b997668e win32: fix libtcc support
For "tcc -run file.c", I was trying to initialize the FP control
in a function in libtcc1.a (_runmain) before calling main.

Unfortunately that turned out to cause problems with for example
libtcc_test since such usage doesn't necessarily define a 'main'
function.

So for tcc -run we're back to relying on the FP control word
that is set in the startup code of tcc.exe rsp. libtcc.dll.

This fixes part of commit 73faaea227
2013-09-10 15:36:56 +02:00
grischka 73faaea227 i386-gen: preserve fp control word in gen_cvt_ftoi
- Use runtime function for conversion
- Also initialize fp with tcc -run on windows

This fixes a bug where
  double x = 1.0;
  double y = 1.0000000000000001;
  double z = x < y ? 0 : sqrt (x*x - y*y);
caused a bad sqrt because rounding precision for the x < y comparison
was different to the one used within the sqrt function.

This also fixes a bug where
  printf("%d, %d", (int)pow(10, 2), (int)pow(10, 2));
would print
  100, 99

Unrelated:
  win32: document relative include & lib lookup
  win32: normalize_slashes: do not mirror silly gcc behavior
  This reverts part of commit 8a81f9e103
  winapi: add missing WINAPI decl. for some functions
2013-08-28 22:55:05 +02:00
grischka 9228842fa7 win32: register SEH in startup code (i386 only)
Needed to handle signal() etc. with msvcrt
2010-10-19 13:15:06 +02:00
grischka 97738d1ae9 win32: reformat examples, crt etc 2009-07-18 22:07:10 +02:00
bellard 58f6207abe _controlfp fix (grischka) 2005-04-17 13:11:15 +00:00
bellard 4821702fb4 win32 merge 2005-04-14 23:49:21 +00:00