From e9981120acf7d7d89d33f92cac71247f74d1867c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 23 Nov 1999 00:21:45 +0000 Subject: [PATCH] 19991123-01:09 GMT+1 Victor Szel --- harbour/ChangeLog | 5 +++++ harbour/source/rtl/math.c | 19 +++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index aa30ce5537..76e5ac43b3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,8 @@ +19991123-01:09 GMT+1 Victor Szel + * source/rtl/math.c + + math error handler added for __BORLANDC__ and __MINGW32__ + I could not find a way to test these error though. + 19991123-00:29 GMT+1 Victor Szel * tests/regress/* + Split rt_str into rt_str + rt_trans. diff --git a/harbour/source/rtl/math.c b/harbour/source/rtl/math.c index 00b8913e5d..086afaa659 100644 --- a/harbour/source/rtl/math.c +++ b/harbour/source/rtl/math.c @@ -49,7 +49,18 @@ #include "itemapi.h" #include "errorapi.h" -#if defined( __WATCOMC__ ) +#if defined(__WATCOMC__) + #define HB_MATH_HANDLER +#elif defined(__BORLANDC__) + #define HB_MATH_HANDLER + #define matherr _matherr +#elif defined(__MINGW32__) + #define HB_MATH_HANDLER + #define matherr _matherr + #define exception _exception +#endif + +#if defined(HB_MATH_HANDLER) static int s_internal_math_error = 0; @@ -148,7 +159,7 @@ HARBOUR HB_EXP( void ) { if( ISNUM( 1 ) ) { -#if defined( __WATCOMC__ ) +#if defined(HB_MATH_HANDLER) double dResult = exp( hb_parnd( 1 ) ); if( s_internal_math_error ) @@ -210,7 +221,7 @@ HARBOUR HB_LOG( void ) { if( ISNUM( 1 ) ) { -#if defined( __WATCOMC__ ) +#if defined(HB_MATH_HANDLER) double dResult = log( hb_parnd( 1 ) ); if( s_internal_math_error ) @@ -478,7 +489,7 @@ HARBOUR HB_SQRT( void ) { if( ISNUM( 1 ) ) { -#if defined( __WATCOMC__ ) +#if defined(HB_MATH_HANDLER) double dResult = sqrt( hb_parnd( 1 ) ); if( s_internal_math_error )