]> granicus.if.org Git - yasm/commitdiff
Use abort() instead of exit() if it's available for InternalError() and
authorPeter Johnson <peter@tortall.net>
Sun, 16 Sep 2001 05:39:35 +0000 (05:39 -0000)
committerPeter Johnson <peter@tortall.net>
Sun, 16 Sep 2001 05:39:35 +0000 (05:39 -0000)
Fatal().

svn path=/trunk/yasm/; revision=158

configure.ac
configure.in
libyasm/errwarn.c
src/errwarn.c

index b42dbee90abde0c7c4e2f33cf259acd1fb8c3304..8e4e11e58c9cc7e3b7887a21c5fed9ee1003a4e4 100644 (file)
@@ -31,7 +31,7 @@ AC_C_CONST
 AC_TYPE_SIZE_T
 
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(memcpy toascii)
+AC_CHECK_FUNCS(memcpy toascii abort)
 AC_REPLACE_FUNCS(strdup strtoul)
 
 AC_CHECK_HEADERS(limits.h sys/queue.h sys/cdefs.h)
index b42dbee90abde0c7c4e2f33cf259acd1fb8c3304..8e4e11e58c9cc7e3b7887a21c5fed9ee1003a4e4 100644 (file)
@@ -31,7 +31,7 @@ AC_C_CONST
 AC_TYPE_SIZE_T
 
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(memcpy toascii)
+AC_CHECK_FUNCS(memcpy toascii abort)
 AC_REPLACE_FUNCS(strdup strtoul)
 
 AC_CHECK_HEADERS(limits.h sys/queue.h sys/cdefs.h)
index 63f25929e1ba47d3cdae86174dd77f343e71eb28..83a54ab88679a00fc3f930a387b94fb7ecad7638 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: errwarn.c,v 1.23 2001/08/30 03:45:26 peter Exp $
+/* $Id: errwarn.c,v 1.24 2001/09/16 05:39:35 peter Exp $
  * Error and warning reporting and related functions.
  *
  *  Copyright (C) 2001  Peter Johnson
@@ -45,7 +45,7 @@
 #include "globals.h"
 #include "errwarn.h"
 
-RCSID("$Id: errwarn.c,v 1.23 2001/08/30 03:45:26 peter Exp $");
+RCSID("$Id: errwarn.c,v 1.24 2001/09/16 05:39:35 peter Exp $");
 
 /* Total error count for entire assembler run.
  * Assembler should exit with EXIT_FAILURE if this is >= 0 on finish. */
@@ -126,7 +126,11 @@ InternalError(unsigned int line, char *file, char *message)
 {
     fprintf(stderr, _("INTERNAL ERROR at %s, line %d: %s\n"), file, line,
            message);
+#ifdef HAVE_ABORT
+    abort();
+#else
     exit(EXIT_FAILURE);
+#endif
 }
 
 /* Report a fatal error.  These are unrecoverable (such as running out of
@@ -135,7 +139,11 @@ void
 Fatal(fatal_num num)
 {
     fprintf(stderr, "%s %s\n", _("FATAL:"), gettext(fatal_msgs[num]));
+#ifdef HAVE_ABORT
+    abort();
+#else
     exit(EXIT_FAILURE);
+#endif
 }
 
 /* Register an error.  Uses argtypes as described above to specify the
index 63f25929e1ba47d3cdae86174dd77f343e71eb28..83a54ab88679a00fc3f930a387b94fb7ecad7638 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: errwarn.c,v 1.23 2001/08/30 03:45:26 peter Exp $
+/* $Id: errwarn.c,v 1.24 2001/09/16 05:39:35 peter Exp $
  * Error and warning reporting and related functions.
  *
  *  Copyright (C) 2001  Peter Johnson
@@ -45,7 +45,7 @@
 #include "globals.h"
 #include "errwarn.h"
 
-RCSID("$Id: errwarn.c,v 1.23 2001/08/30 03:45:26 peter Exp $");
+RCSID("$Id: errwarn.c,v 1.24 2001/09/16 05:39:35 peter Exp $");
 
 /* Total error count for entire assembler run.
  * Assembler should exit with EXIT_FAILURE if this is >= 0 on finish. */
@@ -126,7 +126,11 @@ InternalError(unsigned int line, char *file, char *message)
 {
     fprintf(stderr, _("INTERNAL ERROR at %s, line %d: %s\n"), file, line,
            message);
+#ifdef HAVE_ABORT
+    abort();
+#else
     exit(EXIT_FAILURE);
+#endif
 }
 
 /* Report a fatal error.  These are unrecoverable (such as running out of
@@ -135,7 +139,11 @@ void
 Fatal(fatal_num num)
 {
     fprintf(stderr, "%s %s\n", _("FATAL:"), gettext(fatal_msgs[num]));
+#ifdef HAVE_ABORT
+    abort();
+#else
     exit(EXIT_FAILURE);
+#endif
 }
 
 /* Register an error.  Uses argtypes as described above to specify the