Commit c622b48f authored by Paul Eggert's avatar Paul Eggert

Improve sys_siglist detection.

* configure.ac (sys_siglist): Look for its decl in <signal.h>.
Otherwise, it's not found in either Fedora 17 or Solaris 11.
* src/sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
defined as a macro, as is done in Solaris.
(sys_siglist_entries): New macro.
(save_strsignal): Use it.
* src/syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
parent 559e479c
2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
Improve sys_siglist detection.
* configure.ac (sys_siglist): Look for its decl in <signal.h>.
Otherwise, it's not found in either Fedora 17 or Solaris 11.
2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
Merge from gnulib, incorporating:
......
......@@ -1284,10 +1284,12 @@ dnl On Solaris 8 there's a compilation warning for term.h because
dnl it doesn't define `bool'.
AC_CHECK_HEADERS(term.h, , , -)
AC_HEADER_TIME
AC_CHECK_DECLS([sys_siglist])
AC_CHECK_DECLS([sys_siglist], [], [], [[#include <signal.h>
]])
if test $ac_cv_have_decl_sys_siglist != yes; then
# For Tru64, at least:
AC_CHECK_DECLS([__sys_siglist])
AC_CHECK_DECLS([__sys_siglist], [], [], [[#include <signal.h>
]])
if test $ac_cv_have_decl___sys_siglist = yes; then
AC_DEFINE(sys_siglist, __sys_siglist,
[Define to any substitute for sys_siglist.])
......
2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
Improve sys_siglist detection.
* sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
defined as a macro, as is done in Solaris.
(sys_siglist_entries): New macro.
(save_strsignal): Use it.
* syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
* nsfns.m (Fx_create_frame): Call x_default_parameter with
......
......@@ -1545,8 +1545,18 @@ deliver_thread_signal (int sig, signal_handler_t handler)
#if !HAVE_DECL_SYS_SIGLIST
# undef sys_siglist
# define sys_siglist my_sys_siglist
# ifdef _sys_siglist
# define sys_siglist _sys_siglist
# else
# define sys_siglist my_sys_siglist
static char const *sys_siglist[NSIG];
# endif
#endif
#ifdef _sys_nsig
# define sys_siglist_entries _sys_nsig
#else
# define sys_siglist_entries NSIG
#endif
/* Handle bus errors, invalid instruction, etc. */
......@@ -1609,7 +1619,7 @@ init_signals (bool dumping)
main_thread = pthread_self ();
#endif
#if !HAVE_DECL_SYS_SIGLIST
#if !HAVE_DECL_SYS_SIGLIST && !defined _sys_siglist
if (! initialized)
{
sys_siglist[SIGABRT] = "Aborted";
......@@ -1757,7 +1767,7 @@ init_signals (bool dumping)
sys_siglist[SIGXFSZ] = "File size limit exceeded";
# endif
}
#endif /* !HAVE_DECL_SYS_SIGLIST */
#endif /* !HAVE_DECL_SYS_SIGLIST && !_sys_siglist */
/* Don't alter signal handlers if dumping. On some machines,
changing signal handlers sets static data that would make signals
......@@ -2285,7 +2295,7 @@ safe_strsignal (int code)
{
char const *signame = 0;
if (0 <= code && code < NSIG)
if (0 <= code && code < sys_siglist_entries)
signame = sys_siglist[code];
if (! signame)
signame = "Unknown signal";
......
......@@ -43,7 +43,7 @@ extern sigset_t empty_mask;
typedef void (*signal_handler_t) (int);
extern void emacs_sigaction_init (struct sigaction *, signal_handler_t);
char const *safe_strsignal (int);
char const *safe_strsignal (int) ATTRIBUTE_CONST;
#if NSIG < NSIG_MINIMUM
# undef NSIG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment