From a891db8053e8123fcbdf7b4747e2df94d92b8184 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 18 Feb 2010 15:47:27 +0000 Subject: [PATCH] 2010-02-18 16:46 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * include/hbsetup.h * Cleaned the way WinCE is detected. Now looking for UNDER_CE or _WIN32_WCE constants. (was: _WINCE) * utils/hbmk2/hbmk2.prg * Cleaned the way constants are initialized for WinCE platform. It's also means they are now synced with GNU Make build system. This means: UNICODE, _WIN32_WCE (to 0x501), UNDER_CE are always defined. Secondary CPU macros are defined as needed. Removed all the other WinCE related constants. + Defining UNDER_CE and _WIN32_WCE for resource compiler for WinCE targets. * config/wce/global.mk * config/wce/mingwarm.mk * config/wce/poccarm.mk * config/wce/msvcarm.mk * Cleaned the way constants are initialized for WinCE platform. - '-D_WIN32_WCE=0x501 -DUNDER_CE' moved to global, so now these will be equally defined for all WinCE compilers. - Deleted these from msvcarm targets ('-D_WINCE' was apparently used by our own hbsetup.h detection code only): '-D_WINCE -DCE_ARCH -DWINCE -D_WINDOWS -D_UNICODE -D_UWIN' - Deleted this from from poccarm targets: '-D_WINCE' - Deleted several secondary CPU constants for msvc* targets: '-D_ARM_ -DARMV4 -D_ARMV4I_ -Darmv4i -D__arm__' '-D_SHX_' '-D_MIPS_ -DMIPS_HAS_FPU' These are not necessarily true, and not even necessary. I you know otherwise, speak up. - Kept primary CPU constants: '-D_M_*' - Kept secondary CPU constants (needed by some inconsistent Windows header files): '-DARM', '-DSHx', '-DMIPS', '-D_X86_' * config/win/global.mk * Cleaned to use 'HB_BUILD_UNICODE' setting to enable UNICODE for non-x86 targets. * config/win/msvc.mk ! Fixed to respect 'HB_BUILD_UNICODE' user-setting when enabling UNICODE for newer MSVC targets. IOW it's now possible to turn off UNICODE for newer MSVC targets. ; Above should ensure more consistency for different WinCE compilers. Closer behavior and more consistent build logs, with less unnecessary options. --- harbour/ChangeLog | 51 ++++++++++++++++++++++++++++++++-- harbour/config/wce/global.mk | 5 ++-- harbour/config/wce/mingwarm.mk | 2 +- harbour/config/wce/msvcarm.mk | 10 +++---- harbour/config/wce/poccarm.mk | 2 +- harbour/config/win/global.mk | 2 +- harbour/config/win/msvc.mk | 12 ++++---- harbour/include/hbsetup.h | 2 +- harbour/utils/hbmk2/hbmk2.prg | 24 +++++++++++----- 9 files changed, 85 insertions(+), 25 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 24e3c2d350..c0e358d258 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,53 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-18 16:46 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * include/hbsetup.h + * Cleaned the way WinCE is detected. + Now looking for UNDER_CE or _WIN32_WCE constants. (was: _WINCE) + + * utils/hbmk2/hbmk2.prg + * Cleaned the way constants are initialized for WinCE platform. It's also + means they are now synced with GNU Make build system. This means: + UNICODE, _WIN32_WCE (to 0x501), UNDER_CE are always defined. + Secondary CPU macros are defined as needed. + Removed all the other WinCE related constants. + + Defining UNDER_CE and _WIN32_WCE for resource compiler for WinCE targets. + + * config/wce/global.mk + * config/wce/mingwarm.mk + * config/wce/poccarm.mk + * config/wce/msvcarm.mk + * Cleaned the way constants are initialized for WinCE platform. + - '-D_WIN32_WCE=0x501 -DUNDER_CE' moved to global, so now these will + be equally defined for all WinCE compilers. + - Deleted these from msvcarm targets ('-D_WINCE' was apparently used + by our own hbsetup.h detection code only): + '-D_WINCE -DCE_ARCH -DWINCE -D_WINDOWS -D_UNICODE -D_UWIN' + - Deleted this from from poccarm targets: + '-D_WINCE' + - Deleted several secondary CPU constants for msvc* targets: + '-D_ARM_ -DARMV4 -D_ARMV4I_ -Darmv4i -D__arm__' + '-D_SHX_' + '-D_MIPS_ -DMIPS_HAS_FPU' + These are not necessarily true, and not even necessary. I you know + otherwise, speak up. + - Kept primary CPU constants: + '-D_M_*' + - Kept secondary CPU constants (needed by some inconsistent Windows header files): + '-DARM', '-DSHx', '-DMIPS', '-D_X86_' + + * config/win/global.mk + * Cleaned to use 'HB_BUILD_UNICODE' setting to enable UNICODE for non-x86 targets. + + * config/win/msvc.mk + ! Fixed to respect 'HB_BUILD_UNICODE' user-setting when enabling UNICODE for + newer MSVC targets. IOW it's now possible to turn off UNICODE for newer + MSVC targets. + + ; Above should ensure more consistency for different WinCE compilers. + Closer behavior and more consistent build logs, with less unnecessary options. + 2010-02-18 05:58 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + contrib/hbide/resources/searchreplacepanel.ui + contrib/hbide/resources/searchreplacepanel.uic @@ -33,8 +80,8 @@ % Fixed to not crash when "Find in Files" was not called before exit. ; Press CTRL+F and see a panel appearing inbetween editor and statusbar. - This widget has to be matured a little and will facilitate that - search and replace action will never hide any part of the + This widget has to be matured a little and will facilitate that + search and replace action will never hide any part of the editing area. A final ( uptil now ) reform in user-interface. 2010-02-18 10:50 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) diff --git a/harbour/config/wce/global.mk b/harbour/config/wce/global.mk index fcf356799c..bc8d3b6515 100644 --- a/harbour/config/wce/global.mk +++ b/harbour/config/wce/global.mk @@ -9,6 +9,7 @@ DYN_EXT := .dll HB_GT_LIBS += gtwvt gtgui -SYSLIBS += coredll ws2 - +HB_CFLAGS += -D_WIN32_WCE=0x501 -DUNDER_CE HB_BUILD_UNICODE := yes + +SYSLIBS += coredll ws2 diff --git a/harbour/config/wce/mingwarm.mk b/harbour/config/wce/mingwarm.mk index e73d50b786..92c32c70df 100644 --- a/harbour/config/wce/mingwarm.mk +++ b/harbour/config/wce/mingwarm.mk @@ -16,7 +16,7 @@ CC := $(HB_CCPATH)$(HB_CCPREFIX)$(HB_CMP)$(HB_CCPOSTFIX) CC_IN := -c CC_OUT := -o -CFLAGS += -I. -I$(HB_INC_COMPILE) +CFLAGS += -I. -I$(HB_INC_COMPILE) -DARM ifneq ($(HB_BUILD_WARN),no) CFLAGS += -Wall -W diff --git a/harbour/config/wce/msvcarm.mk b/harbour/config/wce/msvcarm.mk index 7fe8729c78..974c1a2f10 100644 --- a/harbour/config/wce/msvcarm.mk +++ b/harbour/config/wce/msvcarm.mk @@ -19,16 +19,16 @@ CC_OUT := -Fo CFLAGS += -I. -I$(HB_INC_COMPILE) -CFLAGS += -nologo -D_WIN32_WCE=0x501 -DCE_ARCH -DWINCE -D_WINCE -D_WINDOWS -D_UNICODE -D_UWIN -DUNDER_CE +CFLAGS += -nologo ifeq ($(HB_COMPILER),msvcarm) - CFLAGS += -DARM -D_ARM_ -DARMV4 -D_M_ARM -D_ARMV4I_ -Darmv4i -D__arm__ + CFLAGS += -D_M_ARM -DARM else ifeq ($(HB_COMPILER),msvcsh) - CFLAGS += -D_M_SH -DSHx -D_SHX_ + CFLAGS += -D_M_SH -DSHx else ifeq ($(HB_COMPILER),msvcmips) - CFLAGS += -D_M_MRX000=4000 -DMIPS -D_MIPS_ -DMIPS_HAS_FPU + CFLAGS += -D_M_MRX000=4000 -DMIPS else ifeq ($(HB_COMPILER),msvc) - CFLAGS += -D_X86_ -D_M_IX86 + CFLAGS += -D_M_IX86 -D_X86_ endif # MSVS 2005 SP1 also supports it, but we only enable it for 2008 and upper. diff --git a/harbour/config/wce/poccarm.mk b/harbour/config/wce/poccarm.mk index 7742b70f18..c61ab90433 100644 --- a/harbour/config/wce/poccarm.mk +++ b/harbour/config/wce/poccarm.mk @@ -30,7 +30,7 @@ ifneq ($(HB_BUILD_OPTIM),no) endif # For Pocket PC and ARM processors (including XScale) -CFLAGS += -Tarm-coff -D_M_ARM -D_WINCE +CFLAGS += -Tarm-coff -D_M_ARM -DARM ifeq ($(HB_BUILD_DEBUG),yes) CFLAGS += -Zi diff --git a/harbour/config/win/global.mk b/harbour/config/win/global.mk index 5fd05f973e..07c5a5cda0 100644 --- a/harbour/config/win/global.mk +++ b/harbour/config/win/global.mk @@ -11,7 +11,7 @@ HB_GT_LIBS += gtwvt gtgui gtwin # enable UNICODE by default when building for any non-x86 targets (x86_64 or ia64) ifneq ($(HB_CPU),x86) - HB_CFLAGS += -DUNICODE + HB_BUILD_UNICODE := yes endif # kernel32: needed by some compilers (pocc/watcom) diff --git a/harbour/config/win/msvc.mk b/harbour/config/win/msvc.mk index 4b93ad8f5c..3e9fcb75ee 100644 --- a/harbour/config/win/msvc.mk +++ b/harbour/config/win/msvc.mk @@ -6,11 +6,13 @@ OBJ_EXT := .obj LIB_PREF := LIB_EXT := .lib -ifeq ($(HB_CPU),x86) - # Always compile in -UNICODE mode for MSVC 9.0 and upper - # These versions don't support Win9x anymore, so it's safe. [vszakats] - ifeq ($(filter $(HB_COMPILER_VER),600 700 710 800),) - HB_CFLAGS += -DUNICODE +ifeq ($(HB_BUILD_UNICODE),) + ifeq ($(HB_CPU),x86) + # Always compile in UNICODE mode for MSVC 9.0 and upper + # These versions don't support Win9x anymore, so it's safe. [vszakats] + ifeq ($(filter $(HB_COMPILER_VER),600 700 710 800),) + HB_BUILD_UNICODE := yes + endif endif endif diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index cb3de5e1eb..6cce59ec1c 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -228,7 +228,7 @@ /* Sub-option inside HB_OS_WIN */ #ifndef HB_OS_WIN_CE - #if defined( _WINCE ) || defined( __CEGCC__ ) || defined( __MINGW32CE__ ) + #if defined( UNDER_CE ) || defined( _WIN32_WCE ) || defined( __CEGCC__ ) || defined( __MINGW32CE__ ) #define HB_OS_WIN_CE #endif #endif diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 2d2d9a4a83..8051e8a106 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -2618,6 +2618,11 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) AAdd( hbmk[ _HBMK_aOPTL ], "-o{OE}" ) ENDIF l_aLIBSYS := ArrayAJoin( { l_aLIBSYS, l_aLIBSYSCORE, l_aLIBSYSMISC } ) + IF hbmk[ _HBMK_cPLAT ] == "wce" + AAdd( hbmk[ _HBMK_aOPTC ], "-DUNICODE" ) + AAdd( hbmk[ _HBMK_aOPTC ], "-D_WIN32_WCE=0x501 -DUNDER_CE" ) + AAdd( hbmk[ _HBMK_aOPTRES ], "-D_WIN32_WCE=0x501 -DUNDER_CE" ) + ENDIF DO CASE CASE hbmk[ _HBMK_nHBMODE ] == _HBMODE_XHB /* NOTE: Newer xhb version use "-x.y.z" version numbers. */ @@ -2627,11 +2632,11 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) l_aLIBSHARED := { iif( hbmk[ _HBMK_lMT ], "harbourmt" + cDL_Version_Alter + "-x64",; "harbour" + cDL_Version_Alter + "-x64" ) } CASE hbmk[ _HBMK_cCOMP ] == "mingwarm" - AAdd( hbmk[ _HBMK_aOPTC ], "-DUNICODE" ) + AAdd( hbmk[ _HBMK_aOPTC ], "-DARM" ) l_aLIBSHARED := { iif( hbmk[ _HBMK_lMT ], "harbourmt" + cDL_Version_Alter + "-wce-arm",; "harbour" + cDL_Version_Alter + "-wce-arm" ) } CASE hbmk[ _HBMK_cCOMP ] == "mingw" .AND. hbmk[ _HBMK_cPLAT ] = "wce" - AAdd( hbmk[ _HBMK_aOPTC ], "-DUNICODE" ) + AAdd( hbmk[ _HBMK_aOPTC ], "-D_X86_" ) l_aLIBSHARED := { iif( hbmk[ _HBMK_lMT ], "harbourmt" + cDL_Version_Alter + "-wce-x86",; "harbour" + cDL_Version_Alter + "-wce-x86" ) } OTHERWISE @@ -3198,10 +3203,12 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) AAdd( hbmk[ _HBMK_aOPTD ], "-implib:{OI}" ) ENDIF IF hbmk[ _HBMK_cPLAT ] == "wce" - AAdd( hbmk[ _HBMK_aOPTC ], "-D_WIN32_WCE=0x501 -DCE_ARCH -DWINCE -D_WINCE -D_WINDOWS -D_UNICODE -D_UWIN -DUNDER_CE" ) + AAdd( hbmk[ _HBMK_aOPTC ], "-DUNICODE" ) + AAdd( hbmk[ _HBMK_aOPTC ], "-D_WIN32_WCE=0x501 -DUNDER_CE" ) + AAdd( hbmk[ _HBMK_aOPTRES ], "-D_WIN32_WCE=0x501 -DUNDER_CE" ) DO CASE CASE hbmk[ _HBMK_cCOMP ] == "msvcarm" - AAdd( hbmk[ _HBMK_aOPTC ], "-DARM -D_ARM_ -DARMV4 -D_M_ARM -D_ARMV4I_ -Darmv4i -D__arm__" ) + AAdd( hbmk[ _HBMK_aOPTC ], "-D_M_ARM -DARM" ) CASE hbmk[ _HBMK_cCOMP ] == "msvc" /* TODO */ ENDCASE @@ -3298,6 +3305,11 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) ENDIF cOptIncMask := "-I{DI}" cOpt_Dyn := "{FD} -dll -out:{OD} {DL} {LO} {LL} {LB} {LS}" + IF hbmk[ _HBMK_cPLAT ] == "wce" + AAdd( hbmk[ _HBMK_aOPTC ], "-DUNICODE" ) + AAdd( hbmk[ _HBMK_aOPTC ], "-D_WIN32_WCE=0x501 -DUNDER_CE" ) + AAdd( hbmk[ _HBMK_aOPTRES ], "-D_WIN32_WCE=0x501 -DUNDER_CE" ) + ENDIF DO CASE CASE hbmk[ _HBMK_cCOMP ] == "pocc" IF hbmk[ _HBMK_lOPTIM ] @@ -3308,9 +3320,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) AAdd( hbmk[ _HBMK_aOPTC ], "-Tamd64-coff" ) CASE hbmk[ _HBMK_cCOMP ] == "poccarm" AAdd( hbmk[ _HBMK_aOPTC ], "-Tarm-coff" ) - AAdd( hbmk[ _HBMK_aOPTC ], "-D_M_ARM" ) - AAdd( hbmk[ _HBMK_aOPTC ], "-D_WINCE" ) - AAdd( hbmk[ _HBMK_aOPTC ], "-DUNICODE" ) + AAdd( hbmk[ _HBMK_aOPTC ], "-D_M_ARM -DARM" ) ENDCASE DO CASE CASE hbmk[ _HBMK_nWARN ] == _WARN_YES