From 85559adb23110c7fe8b78ccb23a1c649e03cfc7b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 16 Mar 2009 22:18:54 +0000 Subject: [PATCH] 2009-03-16 23:18 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * harbour-win-spec * harbour-wce-spec % Removed forced -O2 options, -O3/-O2 are the defaults already. * mpkg_win.bat + Adds -DHB_FM_STATISTICS_OFF to HB_USER_CFLAGS. * utils/hbmk2/hbmk2.prg ! Setting gtwvt for msvcce targets as default GT. * source/debug/debugger.prg % Minor optimization. (platform branching done at PP time rather than runtime). * contrib/xhb/hbcompat.ch + Added DestroyMutex() compatibility #translate. --- harbour/ChangeLog | 18 ++++++++++++++++++ harbour/contrib/xhb/hbcompat.ch | 9 +++++---- harbour/harbour-wce-spec | 6 +++--- harbour/harbour-win-spec | 6 +++--- harbour/mpkg_win.bat | 1 + harbour/source/debug/debugger.prg | 24 +++++++++--------------- harbour/utils/hbmk2/hbmk2.prg | 3 +-- 7 files changed, 40 insertions(+), 27 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 241223d521..a092da593a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,24 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-03-16 23:18 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * harbour-win-spec + * harbour-wce-spec + % Removed forced -O2 options, -O3/-O2 are the defaults already. + + * mpkg_win.bat + + Adds -DHB_FM_STATISTICS_OFF to HB_USER_CFLAGS. + + * utils/hbmk2/hbmk2.prg + ! Setting gtwvt for msvcce targets as default GT. + + * source/debug/debugger.prg + % Minor optimization. (platform branching done at PP + time rather than runtime). + + * contrib/xhb/hbcompat.ch + + Added DestroyMutex() compatibility #translate. + 2009-03-16 18:31 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * utils/hbmk2/hbmk2.prg + Added __PLATFORM__* macro support for cross-compilation situations. diff --git a/harbour/contrib/xhb/hbcompat.ch b/harbour/contrib/xhb/hbcompat.ch index 084c023990..1836c87e22 100644 --- a/harbour/contrib/xhb/hbcompat.ch +++ b/harbour/contrib/xhb/hbcompat.ch @@ -205,6 +205,7 @@ #xtranslate hb_multiThread() => hb_mtvm() #xtranslate WaitForThreads() => hb_threadWaitForAll() #xtranslate Notify() => hb_mutexNotify() + #xtranslate DestroyMutex([]) => #xtranslate Str(,[],[],) => iif(, hb_NToS(), Str()) #xtranslate hb_CMDARGARGV([]) => hb_ARGV() @@ -307,10 +308,10 @@ #translate ( LIKE ) => ( HB_REGEXLIKE( (), () ) ) #translate ( \<\< ) => ( HB_BITSHIFT( (), () ) ) #translate ( >> ) => ( HB_BITSHIFT( (), -() ) ) - /* NOTE: These macros can break some valid Harbour/Clipper constructs, - so they are disabled by default. Enable them with care, or - even better to switch to use HB_BIT*() functions directly. - They are optimized by Harbour compiler the same way (and even + /* NOTE: These macros can break some valid Harbour/Clipper constructs, + so they are disabled by default. Enable them with care, or + even better to switch to use HB_BIT*() functions directly. + They are optimized by Harbour compiler the same way (and even more) as these C-like operators, without any bad side-effects. */ #if defined( XHB_BITOP ) #translate ( | ) => ( HB_BITOR( (), () ) ) diff --git a/harbour/harbour-wce-spec b/harbour/harbour-wce-spec index 3ccc407e70..7e0840424a 100644 --- a/harbour/harbour-wce-spec +++ b/harbour/harbour-wce-spec @@ -89,7 +89,7 @@ rm -fR $RPM_BUILD_ROOT export HB_HOST_BUILD=yes export HB_ARCHITECTURE=linux export HB_COMPILER=gcc -export HB_USER_CFLAGS="-O2 -DHB_FM_STATISTICS_OFF" +export HB_USER_CFLAGS="-DHB_FM_STATISTICS_OFF" make export HB_HOST_BUILD=lib @@ -102,7 +102,7 @@ mkdir -p source/main/${HB_ARCHITECTURE}/${HB_COMPILER} ln -s ../../linux/gcc/harbour source/main/${HB_ARCHITECTURE}/${HB_COMPILER}/harbour.exe export CC_HB_USER_CFLAGS="" -export HB_USER_CFLAGS="$CC_HB_USER_CFLAGS -O2 -DHB_FM_STATISTICS_OFF" +export HB_USER_CFLAGS="$CC_HB_USER_CFLAGS -DHB_FM_STATISTICS_OFF" export CC_HB_USER_PRGFLAGS="-D__PLATFORM__WINDOWS -D__PLATFORM__WINCE -undef:__PLATFORM__UNIX -undef:__PLATFORM__LINUX" export HB_USER_PRGFLAGS="$CC_HB_USER_PRGFLAGS" export HB_USER_LDFLAGS="${CC_HB_USER_LDFLAGS}" @@ -128,7 +128,7 @@ make # Install harbour itself. export CC_HB_USER_CFLAGS="" -export HB_USER_CFLAGS="$CC_HB_USER_CFLAGS -O2 -DHB_FM_STATISTICS_OFF" +export HB_USER_CFLAGS="$CC_HB_USER_CFLAGS -DHB_FM_STATISTICS_OFF" export CC_HB_USER_PRGFLAGS="-D__PLATFORM__WINDOWS -D__PLATFORM__WINCE -undef:__PLATFORM__UNIX -undef:__PLATFORM__LINUX" export HB_USER_PRGFLAGS="$CC_HB_USER_PRGFLAGS" export HB_USER_LDFLAGS="${CC_HB_USER_LDFLAGS}" diff --git a/harbour/harbour-win-spec b/harbour/harbour-win-spec index 2586faa4e7..13ae9d0e46 100644 --- a/harbour/harbour-win-spec +++ b/harbour/harbour-win-spec @@ -89,7 +89,7 @@ rm -fR $RPM_BUILD_ROOT export HB_HOST_BUILD=yes export HB_ARCHITECTURE=linux export HB_COMPILER=gcc -export HB_USER_CFLAGS="-O2 -DHB_FM_STATISTICS_OFF" +export HB_USER_CFLAGS="-DHB_FM_STATISTICS_OFF" make export HB_HOST_BUILD=lib @@ -102,7 +102,7 @@ mkdir -p source/main/${HB_ARCHITECTURE}/${HB_COMPILER} ln -s ../../linux/gcc/harbour source/main/${HB_ARCHITECTURE}/${HB_COMPILER}/harbour.exe export CC_HB_USER_CFLAGS="" -export HB_USER_CFLAGS="$CC_HB_USER_CFLAGS -O2 -DHB_FM_STATISTICS_OFF" +export HB_USER_CFLAGS="$CC_HB_USER_CFLAGS -DHB_FM_STATISTICS_OFF" export CC_HB_USER_PRGFLAGS="-D__PLATFORM__WINDOWS -undef:__PLATFORM__UNIX -undef:__PLATFORM__LINUX" export HB_USER_PRGFLAGS="$CC_HB_USER_PRGFLAGS" export HB_USER_LDFLAGS="${CC_HB_USER_LDFLAGS}" @@ -128,7 +128,7 @@ make # Install harbour itself. export CC_HB_USER_CFLAGS="" -export HB_USER_CFLAGS="$CC_HB_USER_CFLAGS -O2 -DHB_FM_STATISTICS_OFF" +export HB_USER_CFLAGS="$CC_HB_USER_CFLAGS -DHB_FM_STATISTICS_OFF" export CC_HB_USER_PRGFLAGS="-D__PLATFORM__WINDOWS -undef:__PLATFORM__UNIX -undef:__PLATFORM__LINUX" export HB_USER_PRGFLAGS="$CC_HB_USER_PRGFLAGS" export HB_USER_LDFLAGS="${CC_HB_USER_LDFLAGS}" diff --git a/harbour/mpkg_win.bat b/harbour/mpkg_win.bat index 26d695e740..e3cd6d7e72 100644 --- a/harbour/mpkg_win.bat +++ b/harbour/mpkg_win.bat @@ -47,6 +47,7 @@ set HB_BUILD_DLL=yes set HB_BUILD_OPTIM=yes set HB_BUILD_DEBUG=no set HB_BUILD_IMPLIB=no +set HB_USER_CFLAGS=%HB_USER_CFLAGS% -DHB_FM_STATISTICS_OFF rem ; Build Harbour if "%HB_COMPILER%" == "mingw" ( sh make_gnu.sh clean install && goto MK_PKG ) diff --git a/harbour/source/debug/debugger.prg b/harbour/source/debug/debugger.prg index 89669ba683..ea5234ca77 100644 --- a/harbour/source/debug/debugger.prg +++ b/harbour/source/debug/debugger.prg @@ -1961,8 +1961,6 @@ METHOD OSShell() CLASS HBDebugger LOCAL cImage := SaveScreen() LOCAL cColors := SetColor() - LOCAL cOs := Upper( OS() ) - LOCAL cShell LOCAL oE SetColor( "W/N" ) @@ -1972,19 +1970,15 @@ METHOD OSShell() CLASS HBDebugger BEGIN SEQUENCE WITH { | objErr | Break( objErr ) } - IF At( "WINDOWS", cOs ) != 0 .OR. ; - At( "DOS", cOs ) != 0 .OR. ; - At( "OS/2", cOs ) != 0 - cShell := GetEnv( "COMSPEC" ) - hb_Run( cShell ) - ELSEIF At( "LINUX", cOs ) != 0 .OR. ; - At( "BSD", cOs ) != 0 .OR. ; - At( "DARWIN", cOs ) != 0 - cShell := GetEnv( "SHELL" ) - hb_Run( cShell ) - ELSE - __dbgAlert( "Not implemented yet!" ) - ENDIF +#if defined( __PLATFORM__WINDOWS ) .OR. ; + defined( __PLATFORM__DOS ) .OR. ; + defined( __PLATFORM__OS2 ) + hb_Run( GetEnv( "COMSPEC" ) ) +#elif defined( __PLATFORM__UNIX ) + hb_Run( GetEnv( "SHELL" ) ) +#else + __dbgAlert( "Not implemented yet!" ) +#endif RECOVER USING oE diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index c9e64ab684..de8199112b 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -1032,8 +1032,7 @@ FUNCTION Main( ... ) make it the first source file specified. */ DEFAULT s_cPROGNAME TO FN_NameGet( s_cFIRST ) - IF t_cCOMP == "mingwce" .OR. ; - t_cCOMP == "poccce" + IF t_cCOMP == "mingwce|msvcce|poccce" t_cGTDEFAULT := "gtwvt" ENDIF