From: borutr Date: Sun, 20 Apr 2003 19:43:12 +0000 (+0000) Subject: added function fatal(), called from stack handling macros X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=bfd60fe0cc5ae4f16ce456a39f622bcc52ac2a70;p=fw%2Fsdcc added function fatal(), called from stack handling macros git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2553 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/support/Util/SDCCerr.c b/support/Util/SDCCerr.c index 2efbdc8c..b21cc39d 100644 --- a/support/Util/SDCCerr.c +++ b/support/Util/SDCCerr.c @@ -17,6 +17,7 @@ */ #include +#include #include "SDCCerr.h" @@ -477,3 +478,19 @@ void werror (int errNum, ... ) va_end( marker ); } + +/* +------------------------------------------------------------------------------- +fatal - Output a standard eror message with variable number of arguements and + call exit() +------------------------------------------------------------------------------- +*/ +void fatal (int exitCode, int errNum, ... ) +{ + va_list marker; + va_start(marker,errNum); + vwerror(errNum, marker); + va_end( marker ); + + exit(exitCode); +} diff --git a/support/Util/SDCCerr.h b/support/Util/SDCCerr.h index 88023af6..1c2384ac 100644 --- a/support/Util/SDCCerr.h +++ b/support/Util/SDCCerr.h @@ -235,4 +235,13 @@ werror - Output a standard eror message with variable number of arguements void werror (int errNum, ... ) ; +/* +------------------------------------------------------------------------------- +fatal - Output a standard eror message with variable number of arguements and + call exit() +------------------------------------------------------------------------------- +*/ + +void fatal (int exitCode, int errNum, ... ) ; + #endif