added function fatal(), called from stack handling macros
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 20 Apr 2003 19:43:12 +0000 (19:43 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 20 Apr 2003 19:43:12 +0000 (19:43 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2553 4a8a32a2-be11-0410-ad9d-d568d2c75423

support/Util/SDCCerr.c
support/Util/SDCCerr.h

index 2efbdc8c2071dafc056ab2617b8603595eb2fce2..b21cc39d672202c1f98d0d08292627f3c576468b 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 
 #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);
+}
index 88023af67d99feccf4579149233c90d4fd6e86a9..1c2384aca60e1b2c6c53ed54abde55c36fd353a5 100644 (file)
@@ -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