aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorgrischka <grischka>2017-02-20 18:58:08 +0100
committergrischka <grischka>2017-02-20 18:58:08 +0100
commit5f33d313c8a2455ff9036cd7f7028339bdbde622 (patch)
treee620f3c5a67e0f785046ee188ffbd00e593c2212 /win32
parent399237850d87be8ef1179d2592ade660152aaabc (diff)
downloadtinycc-5f33d313c8a2455ff9036cd7f7028339bdbde622.tar.gz
tinycc-5f33d313c8a2455ff9036cd7f7028339bdbde622.tar.bz2
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
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile4
-rw-r--r--win32/include/_mingw.h12
-rw-r--r--win32/lib/crt1.c5
-rw-r--r--win32/lib/user32.def4
-rw-r--r--win32/lib/wincrt1.c2
5 files changed, 23 insertions, 4 deletions
diff --git a/win32/Makefile b/win32/Makefile
index 19c9ee4..1a5582f 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -24,11 +24,9 @@ TARGET = $(CPU)
ifeq ($(TARGET), 64)
TFLAGS = -m$(TARGET) -DTCC_TARGET_X86_64
TARCH = x86_64
-CARCH = x86-64
else
TFLAGS = -m$(TARGET) -DTCC_TARGET_I386
TARCH = i386
-CARCH = i386
endif
all: pre bootstrap libs rebuild
@@ -36,7 +34,7 @@ all: pre bootstrap libs rebuild
@ls -ls *.exe
pre:
- @echo ARCH=$(CARCH) 1> ../config.mak
+ @echo ARCH=$(TARCH) 1> ../config.mak
@echo TARGETOS=Windows 1>> ../config.mak
@echo CONFIG_WIN32=yes 1>> ../config.mak
@echo TOPSRC=$$\(TOP\) 1>> ../config.mak
diff --git a/win32/include/_mingw.h b/win32/include/_mingw.h
index 2e565a6..9a8696d 100644
--- a/win32/include/_mingw.h
+++ b/win32/include/_mingw.h
@@ -139,6 +139,18 @@ typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
#define NOSERVICE 1
#define NOMCX 1
#define NOIME 1
+#define __INTRIN_H_
+#ifndef DUMMYUNIONNAME
+# define DUMMYUNIONNAME
+# define DUMMYUNIONNAME1
+# define DUMMYUNIONNAME2
+# define DUMMYUNIONNAME3
+# define DUMMYUNIONNAME4
+# define DUMMYUNIONNAME5
+#endif
+#ifndef DUMMYSTRUCTNAME
+# define DUMMYSTRUCTNAME
+#endif
#ifndef WINVER
# define WINVER 0x0502
#endif
diff --git a/win32/lib/crt1.c b/win32/lib/crt1.c
index a9b1a30..2cb25c0 100644
--- a/win32/lib/crt1.c
+++ b/win32/lib/crt1.c
@@ -73,15 +73,18 @@ int _runtmain(int argc, /* as tcc passed in */ char **argv)
_startupinfo start_info = {0};
__tgetmainargs(&wargc, &wargv, &wenv, _dowildcard, &start_info);
+ /* may be wrong when tcc has received wildcards (*.c) */
if (argc < wargc)
wargv += wargc - argc;
+ else
+ argc = wargc;
#define argv wargv
#endif
#ifdef __i386
_controlfp(_PC_53, _MCW_PC);
#endif
- return _tmain(argc, argv, NULL);
+ return _tmain(argc, argv, _tenviron);
}
// =============================================
diff --git a/win32/lib/user32.def b/win32/lib/user32.def
index 4d2f704..a034dac 100644
--- a/win32/lib/user32.def
+++ b/win32/lib/user32.def
@@ -336,6 +336,10 @@ GetWindow
GetWindowContextHelpId
GetWindowDC
GetWindowInfo
+GetWindowLongPtrA
+GetWindowLongPtrW
+SetWindowLongPtrA
+SetWindowLongPtrW
GetWindowLongA
GetWindowLongW
GetWindowModuleFileNameA
diff --git a/win32/lib/wincrt1.c b/win32/lib/wincrt1.c
index a4197bb..0a5036e 100644
--- a/win32/lib/wincrt1.c
+++ b/win32/lib/wincrt1.c
@@ -80,6 +80,8 @@ int _runtwinmain(int argc, /* as tcc passed in */ char **argv)
__tgetmainargs(&wargc, &wargv, &wenv, 0, &start_info);
if (argc < wargc)
wargv += wargc - argc;
+ else
+ argc = wargc;
#define argv wargv
#endif