From 14708d1bbe475b75223f6b0c0ac89ac49f8505e9 Mon Sep 17 00:00:00 2001 From: prascle Date: Mon, 19 Apr 2004 06:35:42 +0000 Subject: [PATCH] PR: bug 5721 correction --- src/Utils/Utils_CatchSignals.cxx | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Utils/Utils_CatchSignals.cxx b/src/Utils/Utils_CatchSignals.cxx index 8d9b6c413..5ffc4f936 100644 --- a/src/Utils/Utils_CatchSignals.cxx +++ b/src/Utils/Utils_CatchSignals.cxx @@ -105,15 +105,23 @@ static void Handler(const int theSig ) myReserve = NULL; } char aMessage[1000]; + +#if defined __GNUC__ + #if __GNUC__ == 2 + #define __GNUC_2__ + #endif +#endif +#if defined __GNUC_2__ + const char* message = "La fonction strsignal n'est pas supportée par gcc2.95.4"; + sprintf (aMessage, "%d signal cautch : %s", theSig, message); +#else sprintf (aMessage, "%d signal cautch : %s", theSig, strsignal(theSig)); - -#ifdef _DEBUG_ - MESSAGE("Utils_CatchSignal Handler :: " << aMessage ); #endif + + + MESSAGE("Utils_CatchSignal Handler :: " << aMessage ); if(theCallBack == NULL) { -#ifdef _DEBUG_ MESSAGE("Utils_CatchSignal Handler : throw std::runtime_error()"); -#endif throw (std::runtime_error(aMessage)); } else ((void (*)())theCallBack)(); @@ -129,10 +137,8 @@ static SIG_PFV TryHandlerReset( int theSigNum ) if (signal(theSigNum, (SIG_PFV) &Handler) == SIG_IGN) { signal(theSigNum, SIG_IGN); -#ifdef _DEBUG_ MESSAGE("signal "<