summaryrefslogtreecommitdiff
path: root/nt
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-09-04 10:34:54 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-09-04 10:34:54 -0700
commit1088b9226e7dac7314dab52ef0696a5f540900cd (patch)
treebfae7d26f4b411f5c6a0ef33cfcd0c526619ee56 /nt
parent30934d334e8a67c8992d910428758d5b93e0f04f (diff)
downloademacs-1088b9226e7dac7314dab52ef0696a5f540900cd.tar.gz
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 'nt')
-rw-r--r--nt/ChangeLog5
-rw-r--r--nt/inc/ms-w32.h9
-rw-r--r--nt/inc/unistd.h6
3 files changed, 10 insertions, 10 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 4ceb74ed0b5..97b6128f32d 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ Simplify redefinition of 'abort' (Bug#12316).
+ * inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove.
+
2012-09-02 Juanma Barranquero <lekktu@gmail.com>
* config.nt: Sync with autogen/config.in.
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index 8945fb7be4d..a18cf23374c 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -334,16 +334,7 @@ extern char *get_emacs_configuration_options (void);
#include <malloc.h>
#endif
-/* stdlib.h must be included after redefining malloc & friends, but
- before redefining abort. Isn't library redefinition funny? */
#include <stdlib.h>
-
-/* Redefine abort. */
-#ifdef HAVE_NTGUI
-#define abort w32_abort
-extern _Noreturn void w32_abort (void);
-#endif
-
#include <sys/stat.h>
/* Define for those source files that do not include enough NT system files. */
diff --git a/nt/inc/unistd.h b/nt/inc/unistd.h
index fb1f1c4b3bf..7db6cf08bea 100644
--- a/nt/inc/unistd.h
+++ b/nt/inc/unistd.h
@@ -3,8 +3,12 @@
#ifndef _UNISTD_H
#define _UNISTD_H
+/* On Microsoft platforms, <stdlib.h> declares 'environ'; on POSIX
+ platforms, <unistd.h> does. Every file in Emacs that includes
+ <unistd.h> also includes <stdlib.h>, so there's no need to declare
+ 'environ' here. */
+
extern ssize_t readlink (const char *, char *, size_t);
extern int symlink (char const *, char const *);
#endif /* _UNISTD_H */
-