From 541341709b6821af8ffdbab87ed363795de6517a Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 23 Dec 2009 11:31:15 +0000 Subject: [PATCH] 2009-12-23 12:31 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbmath.h ! enable HB_MATH_ERRNO in all *unix builds not only in GCC ones * harbour/src/vm/itemapi.c ! use finite() to check for valid double values - looks that SunCC does not report iDODO warnings so we were not informed about the problem * harbour/include/hbdefs.h * harbour/src/common/hbprintf.c % use also _STDC_C99 macro not only _ISOC99_SOURCE to detect C99 mode and do not reduce such detection to GCC [TOMERGE 2.0] --- harbour/ChangeLog | 16 ++++++++++++++++ harbour/include/hbdefs.h | 2 +- harbour/include/hbmath.h | 3 ++- harbour/src/common/hbprintf.c | 4 ++-- harbour/src/vm/itemapi.c | 3 ++- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3b2829993e..f028afa11c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,22 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-23 12:31 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbmath.h + ! enable HB_MATH_ERRNO in all *unix builds not only in GCC ones + + * harbour/src/vm/itemapi.c + ! use finite() to check for valid double values - looks that SunCC + does not report iDODO warnings so we were not informed about the + problem + + * harbour/include/hbdefs.h + * harbour/src/common/hbprintf.c + % use also _STDC_C99 macro not only _ISOC99_SOURCE to detect C99 mode + and do not reduce such detection to GCC + + [TOMERGE 2.0] + 2009-12-23 05:39 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/ChangeLog * updated last entry diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 06924b5046..b77795e239 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -74,7 +74,7 @@ ( defined( __BORLANDC__ ) && __BORLANDC__ >= 1410 ) || \ ( defined( __WATCOMC__ ) && __WATCOMC__ >= 1270 ) || \ ( ( defined( __GNUC__ ) || defined( __SUNPRO_C ) || defined( __SUNPRO_CC ) ) && \ - ( defined( _ISOC99_SOURCE ) || \ + ( defined( _ISOC99_SOURCE ) || defined( _STDC_C99 ) || \ ( defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L ) || \ ( defined( __DJGPP__ ) && \ ( __DJGPP__ > 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ >= 4 ) ) ) || \ diff --git a/harbour/include/hbmath.h b/harbour/include/hbmath.h index 1342fadebe..bafb02fd4b 100644 --- a/harbour/include/hbmath.h +++ b/harbour/include/hbmath.h @@ -103,7 +103,8 @@ HB_EXTERN_BEGIN #define HUGE_VAL ( 1.0 / ( 1.0, 0.0 ) ) #endif -#if !defined( HB_MATH_HANDLER ) && defined( __GNUC__ ) /* && defined( HB_OS_UNIX ) */ +#if !defined( HB_MATH_HANDLER ) && \ + ( defined( __GNUC__ ) || defined( HB_OS_UNIX ) ) #define HB_MATH_ERRNO #endif diff --git a/harbour/src/common/hbprintf.c b/harbour/src/common/hbprintf.c index cbbbc129a0..50e108ef64 100644 --- a/harbour/src/common/hbprintf.c +++ b/harbour/src/common/hbprintf.c @@ -174,7 +174,7 @@ optimized. * platform then it can be replaced by 'value < 0' but in such case * -0.0 will be shown as 0.0 */ -#if defined( __GNUC__ ) && defined( _ISOC99_SOURCE ) +#if defined( _ISOC99_SOURCE ) || defined( _STDC_C99 ) /* use C99 macros */ # define hb_signbit( d ) signbit( d ) @@ -190,7 +190,7 @@ optimized. #endif -#if defined( __GNUC__ ) && ( defined( _ISOC99_SOURCE ) || defined( __MINGW32__ ) ) +#if defined( _ISOC99_SOURCE ) || defined( _STDC_C99 ) || defined( __MINGW32__ ) /* use C99 macros */ # define HB_NUMTYPE( v, d ) do { \ diff --git a/harbour/src/vm/itemapi.c b/harbour/src/vm/itemapi.c index 2c6bcdf774..1089a74484 100644 --- a/harbour/src/vm/itemapi.c +++ b/harbour/src/vm/itemapi.c @@ -2253,7 +2253,8 @@ BOOL hb_itemStrBuf( char *szResult, PHB_ITEM pNumber, int iSize, int iDec ) # define HB_FINITE_DBL(d) ( isfinite(d)!=0 ) #elif defined( __WATCOMC__ ) || defined( __BORLANDC__ ) || defined( _MSC_VER ) # define HB_FINITE_DBL(d) ( _finite(d)!=0 ) -#elif defined( __GNUC__ ) || defined( __DJGPP__ ) || defined( __LCC__ ) +#elif defined( __GNUC__ ) || defined( __DJGPP__ ) || defined( __LCC__ ) || \ + defined( HB_OS_SUNOS ) # define HB_FINITE_DBL(d) ( finite(d)!=0 ) #else int iTODO;