From b258738f10bb742ccafd68770fc2737e947e3ee4 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 16 Dec 2009 08:59:41 +0000 Subject: [PATCH] 2009-12-16 09:59 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/common/hbdate.c * casting for some more pedantic C/C++ compilers * harbour/include/hbinit.h * allow to force static C++ initialization as startup code in GCC and SunPRO builds by HB_STATIC_STARTUP macro --- harbour/ChangeLog | 8 ++++++++ harbour/include/hbinit.h | 3 ++- harbour/src/common/hbdate.c | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ff5e545a8b..8b19c348a8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,14 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-16 09:59 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/common/hbdate.c + * casting for some more pedantic C/C++ compilers + + * harbour/include/hbinit.h + * allow to force static C++ initialization as startup code in + GCC and SunPRO builds by HB_STATIC_STARTUP macro + 2009-12-16 04:53 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg ! Fixed watcom targets to switch to single input file mode diff --git a/harbour/include/hbinit.h b/harbour/include/hbinit.h index 4476cfaeeb..7fc7bc35bd 100644 --- a/harbour/include/hbinit.h +++ b/harbour/include/hbinit.h @@ -147,7 +147,8 @@ extern HB_EXPORT PHB_SYMB hb_vmProcessSymbols( PHB_SYMB pSymbols, USHORT uiSymbo return ( void * ) func; \ } -#elif defined( __GNUC__ ) || defined( __SUNPRO_C ) || defined( __SUNPRO_CC ) +#elif ( defined( __GNUC__ ) || defined( __SUNPRO_C ) || defined( __SUNPRO_CC ) ) && \ + !defined( HB_STATIC_STARTUP ) #if defined( HB_PRAGMA_STARTUP ) || defined( HB_DATASEG_STARTUP ) #error Wrong macros set for startup code - clean your make/env settings. diff --git a/harbour/src/common/hbdate.c b/harbour/src/common/hbdate.c index 8d3d8b8e41..27be6ecc61 100644 --- a/harbour/src/common/hbdate.c +++ b/harbour/src/common/hbdate.c @@ -925,7 +925,7 @@ long hb_timeUTCOffset( void ) /* in seconds */ timeinfo = *localtime( ¤t ); local = mktime( &timeinfo ); #endif - return difftime( local, utc ) + ( timeinfo.tm_isdst > 0 ? 3600 : 0 ); + return ( long ) difftime( local, utc ) + ( timeinfo.tm_isdst > 0 ? 3600 : 0 ); } #endif }