diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-09-04 10:34:54 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-09-04 10:34:54 -0700 |
commit | 1088b9226e7dac7314dab52ef0696a5f540900cd (patch) | |
tree | bfae7d26f4b411f5c6a0ef33cfcd0c526619ee56 /src/msdos.c | |
parent | 30934d334e8a67c8992d910428758d5b93e0f04f (diff) |
Simplify redefinition of 'abort' (Bug#12316).
Do not try to redefine the 'abort' function. Instead, redo
the code so that it calls 'emacs_abort' rather than 'abort'.
This removes the need for the NO_ABORT configure-time macro
and makes it easier to change the abort code to do a backtrace.
* configure.ac (NO_ABRT): Remove.
* admin/CPP-DEFINES (NO_ABORT): Remove.
* nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove.
* src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
* src/emacs.c (abort) [!DOS_NT && !NO_ABORT]:
Remove; sysdep.c's emacs_abort now takes its place.
* src/lisp.h (emacs_abort): New decl. All calls from Emacs code to
'abort' changed to use 'emacs_abort'.
* src/msdos.c (dos_abort) [defined abort]: Remove; not used.
(abort) [!defined abort]: Rename to ...
(emacs_abort): ... new name.
* src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
the place of the old 'abort' in emacs.c.
* src/w32.c, src/w32fns.c (abort): Do not #undef.
* src/w32.c (emacs_abort): Rename from w32_abort.
Diffstat (limited to 'src/msdos.c')
-rw-r--r-- | src/msdos.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/msdos.c b/src/msdos.c index ac348e9437..ed5d3240aa 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -796,7 +796,7 @@ IT_set_face (int face) /* The default face for the frame should always be realized and cached. */ if (!fp) - abort (); + emacs_abort (); } screen_face = face; fg = fp->foreground; @@ -1393,7 +1393,7 @@ IT_insert_glyphs (struct frame *f, struct glyph *start, int len) static void IT_delete_glyphs (struct frame *f, int n) { - abort (); + emacs_abort (); } /* set-window-configuration on window.c needs this. */ @@ -3013,7 +3013,7 @@ XMenuAddPane (Display *foo, XMenu *menu, const char *txt, int enable) const char *p; if (!enable) - abort (); + emacs_abort (); IT_menu_make_room (menu); menu->submenu[menu->count] = IT_menu_create (); @@ -4119,7 +4119,7 @@ sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, FD_ZERO (efds); if (nfds != 1) - abort (); + emacs_abort (); /* If we are looking only for the terminal, with no timeout, just read it and wait -- that's more efficient. */ @@ -4214,26 +4214,8 @@ init_gettimeofday (void) } #endif -#ifdef abort -#undef abort void -dos_abort (char *file, int line) -{ - char buffer1[200], buffer2[400]; - int i, j; - - sprintf (buffer1, "<EMACS FATAL ERROR IN %s LINE %d>", file, line); - for (i = j = 0; buffer1[i]; i++) { - buffer2[j++] = buffer1[i]; - buffer2[j++] = 0x70; - } - dosmemput (buffer2, j, (int)ScreenPrimary); - ScreenSetCursor (2, 0); - abort (); -} -#else -void -abort (void) +emacs_abort (void) { dos_ttcooked (); ScreenSetCursor (10, 0); @@ -4249,7 +4231,6 @@ abort (void) #endif /* __DJGPP_MINOR__ >= 2 */ exit (2); } -#endif void syms_of_msdos (void) |