Use abort() instead of exit() if it's available for InternalError() and

Fatal().

svn path=/trunk/yasm/; revision=158
0.3
Peter Johnson 24 years ago
parent 84e0411c49
commit fa6e459ce5
  1. 2
      configure.ac
  2. 2
      configure.in
  3. 12
      libyasm/errwarn.c
  4. 12
      src/errwarn.c

@ -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)

@ -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)

@ -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

@ -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

Loading…
Cancel
Save