From 0511a246a37e89186cc537d62d6e01f29eb89456 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 8 Jan 2010 00:33:47 +0000 Subject: [PATCH] 2010-01-08 01:32 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * config/wce/msvcarm.mk + Added -nxcompat and -dynamicbase to .dll link command. (I'm unsure what -dynamicbase is good for in a .dll, but it's accepted and set) ! Fixed to add -nxcompat/-dynamicbase for MSVC 2008 and upper. (it's also possible to use it with MSVS 2005 SP1 though, but build won't detect this case) * include/hbwince.h * Formatting. --- harbour/ChangeLog | 14 +++++++++++++- harbour/config/wce/msvcarm.mk | 8 +++++++- harbour/include/hbwince.h | 8 ++++---- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5d12dd7728..f269e7302b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,18 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-08 01:32 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * config/wce/msvcarm.mk + + Added -nxcompat and -dynamicbase to .dll link command. + (I'm unsure what -dynamicbase is good for in a .dll, but it's + accepted and set) + ! Fixed to add -nxcompat/-dynamicbase for MSVC 2008 and upper. + (it's also possible to use it with MSVS 2005 SP1 though, but + build won't detect this case) + + * include/hbwince.h + * Formatting. + 2010-01-08 01:02 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/vm/dlmalloc.c ! Fixed two potentially uninitialized variables, signaled by MSVC. @@ -167,7 +179,7 @@ Especially important for server apps like netiosrv and hbrun. ; TODO: Enable the same for MinGW. ; TOCHECK: Please test this with old MSVC versions and MSVCARM, - maybe we will need to disable them in some cases. + maybe we will need to disable them in some cases. [DONE] * config/wce/msvcarm.mk + Changed to use link.exe for linking instead of cl[arm].exe. diff --git a/harbour/config/wce/msvcarm.mk b/harbour/config/wce/msvcarm.mk index 0ac64ab935..5bc7b8e386 100644 --- a/harbour/config/wce/msvcarm.mk +++ b/harbour/config/wce/msvcarm.mk @@ -31,6 +31,12 @@ else ifeq ($(HB_COMPILER),msvc) CFLAGS += -D_X86_ -D_M_IX86 endif +# MSVS 2005 SP1 also supports it, but we only enable it for 2008 and upper. +ifeq ($(filter $(HB_COMPILER_VER),600 700 710 800),) + LDFLAGS += -nxcompat -dynamicbase -fixed:no + DFLAGS += -nxcompat -dynamicbase +endif + ifeq ($(HB_BUILD_MODE),c) CFLAGS += -TC endif @@ -68,7 +74,7 @@ SYSLIBS += corelibc LIBPATHS := -libpath:$(LIB_DIR) LDLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),$(lib)$(LIB_EXT)) -LDFLAGS += -nologo -nxcompat -dynamicbase -fixed:no -subsystem:windowsce -nodefaultlib:oldnames.lib -nodefaultlib:kernel32.lib +LDFLAGS += -nologo -fixed:no -subsystem:windowsce -nodefaultlib:oldnames.lib -nodefaultlib:kernel32.lib ifeq ($(filter $(HB_COMPILER_VER),600 700 710),) LDFLAGS += -manifest:no endif diff --git a/harbour/include/hbwince.h b/harbour/include/hbwince.h index 4927bb2989..b7aa6716f4 100644 --- a/harbour/include/hbwince.h +++ b/harbour/include/hbwince.h @@ -159,20 +159,20 @@ extern char * strerror( int errnum ); #define SetEnvironmentVariable SetEnvironmentVariableW #endif #if !defined( SetCurrentDirectory ) - #define SetCurrentDirectory SetCurrentDirectoryW BOOL WINAPI SetCurrentDirectoryW( LPCWSTR dirname ); + #define SetCurrentDirectory SetCurrentDirectoryW #endif #if !defined( GetCurrentDirectory ) - #define GetCurrentDirectory GetCurrentDirectoryW DWORD WINAPI GetCurrentDirectoryW( DWORD len, LPWSTR buffer ); + #define GetCurrentDirectory GetCurrentDirectoryW #endif #if !defined( GetComputerName ) - #define GetComputerName GetComputerNameW BOOL WINAPI GetComputerNameW( LPWSTR buffer, LPDWORD len ); + #define GetComputerName GetComputerNameW #endif #if !defined( GetUserName ) - #define GetUserName GetUserNameW BOOL WINAPI GetUserNameW( LPWSTR buffer, LPDWORD len ); + #define GetUserName GetUserNameW #endif #endif /* HB_OS_WIN_USED */