aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorjiang <30155751@qq.com>2014-04-29 16:05:16 +0800
committerjiang <30155751@qq.com>2014-04-29 16:05:16 +0800
commit2a8905c93b4f67a21e3dbf297c3e93c598831528 (patch)
tree6f7491150cfe01700c9863946906203adad0de13 /win32
parent02e2fe3c260415f4cb1cbcaca9b2403a17f7ff2e (diff)
parente20c1eb99e1003c1e59522c136dbb15c52d7cc7c (diff)
downloadtinycc-2a8905c93b4f67a21e3dbf297c3e93c598831528.tar.gz
tinycc-2a8905c93b4f67a21e3dbf297c3e93c598831528.tar.bz2
So that the generated code, and more short
Diffstat (limited to 'win32')
-rw-r--r--win32/build-tcc.bat11
-rw-r--r--win32/include/math.h2
-rw-r--r--win32/include/process.h24
-rw-r--r--win32/include/winapi/winbase.h12
-rw-r--r--win32/lib/wincrt1.c2
-rw-r--r--win32/tcc-win32.txt6
-rw-r--r--win32/tools/tiny_impdef.c2
7 files changed, 37 insertions, 22 deletions
diff --git a/win32/build-tcc.bat b/win32/build-tcc.bat
index 5bc5585..f5c414a 100644
--- a/win32/build-tcc.bat
+++ b/win32/build-tcc.bat
@@ -5,7 +5,7 @@
@set /p VERSION= < ..\VERSION
echo>..\config.h #define TCC_VERSION "%VERSION%"
-@if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
+@rem @if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
@if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
@set target=-DTCC_TARGET_PE -DTCC_TARGET_I386
@@ -25,7 +25,7 @@ echo>..\config.h #define TCC_VERSION "%VERSION%"
%CC% %target% tools/tiny_libmaker.c -o tiny_libmaker.exe
:libtcc
-if not exist libtcc\nul mkdir libtcc
+if not exist libtcc mkdir libtcc
copy ..\libtcc.h libtcc\libtcc.h
%CC% %target% -shared -DLIBTCC_AS_DLL -DONE_SOURCE ../libtcc.c -o libtcc.dll -Wl,-out-implib,libtcc/libtcc.a
tiny_impdef libtcc.dll -o libtcc/libtcc.def
@@ -58,3 +58,10 @@ tiny_libmaker lib/libtcc1.a libtcc1.o alloca86_64.o crt1.o wincrt1.o dllcrt1.o d
:the_end
del *.o
+
+:makedoc
+echo>..\config.texi @set VERSION %VERSION%
+if not exist doc md doc
+makeinfo --html --no-split -o doc\tcc-doc.html ../tcc-doc.texi
+copy tcc-win32.txt doc
+copy ..\tests\libtcc_test.c examples
diff --git a/win32/include/math.h b/win32/include/math.h
index 984a717..4fe64e7 100644
--- a/win32/include/math.h
+++ b/win32/include/math.h
@@ -666,6 +666,7 @@ extern "C" {
extern long double __cdecl fmal (long double, long double, long double);
+#if 0 // gr: duplicate, see below
/* 7.12.14 */
/*
* With these functions, comparisons involving quiet NaNs set the FP
@@ -708,6 +709,7 @@ extern "C" {
& 0x4500) == 0x4500)
#endif
+#endif //0
#endif /* __STDC_VERSION__ >= 199901L */
diff --git a/win32/include/process.h b/win32/include/process.h
index f679442..dadaf2b 100644
--- a/win32/include/process.h
+++ b/win32/include/process.h
@@ -153,20 +153,20 @@ extern "C" {
stupid warnings, define them in POSIX way. This is save, because those
methods do not return in success case, so that the return value is not
really dependent to its scalar width. */
- int __cdecl execv(const char *_Filename,char *const _ArgList[]);
- int __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]);
- int __cdecl execvp(const char *_Filename,char *const _ArgList[]);
- int __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]);
+ int __cdecl execv(const char *_Filename,const char *const _ArgList[]);
+ int __cdecl execve(const char *_Filename,const char *const _ArgList[],const char *const _Env[]);
+ int __cdecl execvp(const char *_Filename,const char *const _ArgList[]);
+ int __cdecl execvpe(const char *_Filename,const char *const _ArgList[],const char *const _Env[]);
#else
- intptr_t __cdecl execv(const char *_Filename,char *const _ArgList[]);
- intptr_t __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]);
- intptr_t __cdecl execvp(const char *_Filename,char *const _ArgList[]);
- intptr_t __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]);
+ intptr_t __cdecl execv(const char *_Filename,const char *const _ArgList[]);
+ intptr_t __cdecl execve(const char *_Filename,const char *const _ArgList[],const char *const _Env[]);
+ intptr_t __cdecl execvp(const char *_Filename,const char *const _ArgList[]);
+ intptr_t __cdecl execvpe(const char *_Filename,const char *const _ArgList[],const char *const _Env[]);
#endif
- intptr_t __cdecl spawnv(int,const char *_Filename,char *const _ArgList[]);
- intptr_t __cdecl spawnve(int,const char *_Filename,char *const _ArgList[],char *const _Env[]);
- intptr_t __cdecl spawnvp(int,const char *_Filename,char *const _ArgList[]);
- intptr_t __cdecl spawnvpe(int,const char *_Filename,char *const _ArgList[],char *const _Env[]);
+ intptr_t __cdecl spawnv(int,const char *_Filename,const char *const _ArgList[]);
+ intptr_t __cdecl spawnve(int,const char *_Filename,const char *const _ArgList[],const char *const _Env[]);
+ intptr_t __cdecl spawnvp(int,const char *_Filename,const char *const _ArgList[]);
+ intptr_t __cdecl spawnvpe(int,const char *_Filename,const char *const _ArgList[],char *const _Env[]);
#endif
#ifdef __cplusplus
diff --git a/win32/include/winapi/winbase.h b/win32/include/winapi/winbase.h
index a5d9b17..4a38006 100644
--- a/win32/include/winapi/winbase.h
+++ b/win32/include/winapi/winbase.h
@@ -968,15 +968,15 @@ extern "C" {
LONG64 InterlockedExchangeAdd64(LONG64 volatile *Addend,LONG64 Value);
LONG64 InterlockedCompareExchange64(LONG64 volatile *Destination,LONG64 ExChange,LONG64 Comperand);
#else
- LONG InterlockedIncrement(LONG volatile *lpAddend);
- LONG InterlockedDecrement(LONG volatile *lpAddend);
- LONG InterlockedExchange(LONG volatile *Target,LONG Value);
+ LONG WINAPI InterlockedIncrement(LONG volatile *lpAddend);
+ LONG WINAPI InterlockedDecrement(LONG volatile *lpAddend);
+ LONG WINAPI InterlockedExchange(LONG volatile *Target,LONG Value);
#define InterlockedExchangePointer(Target,Value) (PVOID)InterlockedExchange((PLONG)(Target),(LONG)(Value))
- LONG InterlockedExchangeAdd(LONG volatile *Addend,LONG Value);
- LONG InterlockedCompareExchange(LONG volatile *Destination,LONG Exchange,LONG Comperand);
- LONGLONG InterlockedCompareExchange64(LONGLONG volatile *Destination,LONGLONG Exchange,LONGLONG Comperand);
+ LONG WINAPI InterlockedExchangeAdd(LONG volatile *Addend,LONG Value);
+ LONG WINAPI InterlockedCompareExchange(LONG volatile *Destination,LONG Exchange,LONG Comperand);
+ LONGLONG WINAPI InterlockedCompareExchange64(LONGLONG volatile *Destination,LONGLONG Exchange,LONGLONG Comperand);
__CRT_INLINE LONGLONG InterlockedAnd64 (LONGLONG volatile *Destination,LONGLONG Value) {
LONGLONG Old;
diff --git a/win32/lib/wincrt1.c b/win32/lib/wincrt1.c
index 77e74b8..663fd33 100644
--- a/win32/lib/wincrt1.c
+++ b/win32/lib/wincrt1.c
@@ -59,6 +59,6 @@ int _runwinmain(int argc, char **argv)
szCmd = "";
else if (szCmd > p && szCmd[-1] == '\"')
--szCmd;
+ _controlfp(0x10000, 0x30000);
return WinMain(GetModuleHandle(NULL), NULL, szCmd, SW_SHOWDEFAULT);
}
-
diff --git a/win32/tcc-win32.txt b/win32/tcc-win32.txt
index dc06b8f..1cb35c5 100644
--- a/win32/tcc-win32.txt
+++ b/win32/tcc-win32.txt
@@ -18,6 +18,12 @@
system PATH.
+ Include and library search paths
+ --------------------------------
+ On windows, the standard "include" and "lib" directories are searched
+ relatively from the location of the executables (tcc.exe, libtcc.dll).
+
+
Examples:
---------
Open a console window (DOS box) and 'cd' to the examples directory.
diff --git a/win32/tools/tiny_impdef.c b/win32/tools/tiny_impdef.c
index 1739549..d12c502 100644
--- a/win32/tools/tiny_impdef.c
+++ b/win32/tools/tiny_impdef.c
@@ -226,7 +226,7 @@ found:
for (l = 0;;) {
if (n+1 >= n0)
p = tcc_realloc(p, n0 = n0 ? n0 * 2 : 256);
- if (!read_mem(fd, ptr - ref + l, p + n, 1) || ++l >= 80) {
+ if (!read_mem(fd, ptr - ref + l++, p + n, 1)) {
tcc_free(p), p = NULL;
goto the_end;
}