diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 47c0b1cbbc..a3de424d80 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,18 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-06-01 23:56 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * include/hbvm.h + * source/vm/hvm.c + * source/vm/extrap.c + ! Fixed OS/2 problem reported by David. + (BTW, do we need really need to remove the exception + handler before exiting? If yes, shouldn't we do the + same under Win32?) + + * source/common/hbstr.c + ! Silenced one 'loss of significant digit' BCC warning. + 2008-06-01 17:35 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * contrib/hbsqlit3/hbsqlit3.c - Not needed to #include "sqlite3/sqlite3.h" diff --git a/harbour/include/hbvm.h b/harbour/include/hbvm.h index 6f4fa0ee97..440a37976b 100644 --- a/harbour/include/hbvm.h +++ b/harbour/include/hbvm.h @@ -100,6 +100,7 @@ extern HB_EXPORT PHB_SYMB hb_vmProcessSymbolsEx( PHB_SYMB pSymbols, USHORT uiSym #endif extern void hb_vmSetExceptionHandler( void ); +extern void hb_vmUnsetExceptionHandler( void ); extern HB_EXPORT void hb_vmSymbolInit_RT( void ); /* initialization of runtime support symbols */ diff --git a/harbour/source/common/hbstr.c b/harbour/source/common/hbstr.c index b2233627bd..33063382ae 100644 --- a/harbour/source/common/hbstr.c +++ b/harbour/source/common/hbstr.c @@ -554,7 +554,7 @@ static BOOL hb_str2number( BOOL fPCode, const char* szNum, ULONG ulLen, HB_LONG int iLimC; lLimV = HB_LONG_MAX / 10; - iLimC = HB_LONG_MAX % 10; + iLimC = ( int ) ( HB_LONG_MAX % 10 ); iWidth = ulPos; diff --git a/harbour/source/vm/extrap.c b/harbour/source/vm/extrap.c index 9ae93bf6a8..97acb595b1 100644 --- a/harbour/source/vm/extrap.c +++ b/harbour/source/vm/extrap.c @@ -164,9 +164,21 @@ void hb_vmSetExceptionHandler( void ) RegRec.ExceptionHandler = ( ERR ) hb_os2ExceptionHandler; rc = DosSetExceptionHandler( &RegRec ); if( rc != NO_ERROR ) - { hb_errInternal( HB_EI_ERRUNRECOV, "Unable to setup exception handler (DosSetExceptionHandler())", NULL, NULL ); - } + } +#endif +} + +void hb_vmUnsetExceptionHandler( void ) +{ +#if defined(HB_OS_OS2) /* Add OS2TermHandler to this thread's chain of exception handlers */ + { + EXCEPTIONREGISTRATIONRECORD RegRec; /* Exception Registration Record */ + APIRET rc; /* Return code */ + + /* I don't do any check on return code since harbour is exiting in any case */ + rc = DosUnsetExceptionHandler( &RegRec ); + HB_SYMBOL_UNUSED( rc ); } #endif } diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 33dac507dd..a231fdcad5 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -490,10 +490,7 @@ HB_EXPORT void hb_vmInit( BOOL bStartMainProc ) hb_vmDo( iArgCount ); /* invoke it with number of supplied parameters */ } -#if defined(HB_OS_OS2) - /* I don't do any check on return code since harbour is exiting in any case */ - rc = DosUnsetExceptionHandler( &RegRec ); -#endif + hb_vmUnsetExceptionHandler(); } HB_EXPORT int hb_vmQuit( void )