aboutsummaryrefslogtreecommitdiff
path: root/libiberty/strsignal.c
diff options
context:
space:
mode:
Diffstat (limited to 'libiberty/strsignal.c')
-rw-r--r--libiberty/strsignal.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c
index 7d40b4cedff..c7bb10c441c 100644
--- a/libiberty/strsignal.c
+++ b/libiberty/strsignal.c
@@ -64,12 +64,12 @@ struct signal_info
{
int value; /* The numeric value from <signal.h> */
const char *name; /* The equivalent symbolic value */
-#ifdef NEED_sys_siglist
+#ifndef HAVE_SYS_SIGLIST
const char *msg; /* Short message about this value */
#endif
};
-#ifdef NEED_sys_siglist
+#ifndef HAVE_SYS_SIGLIST
# define ENTRY(value, name, msg) {value, name, msg}
#else
# define ENTRY(value, name, msg) {value, name}
@@ -236,14 +236,20 @@ static int num_signal_names = 0;
same name, it differs from other implementations in that it is dynamically
initialized rather than statically initialized. */
-#ifdef NEED_sys_siglist
+#ifndef HAVE_SYS_SIGLIST
static int sys_nsig;
static const char **sys_siglist;
#else
+#ifdef NSIG
static int sys_nsig = NSIG;
+#else
+#ifdef _NSIG
+static int sys_nsig = _NSIG;
+#endif
+#endif
extern const char * const sys_siglist[];
#endif
@@ -313,7 +319,7 @@ init_signal_tables ()
}
}
-#ifdef NEED_sys_siglist
+#ifndef HAVE_SYS_SIGLIST
/* Now attempt to allocate the sys_siglist table, zero it out, and then
initialize it from the statically initialized signal_table. */
@@ -408,7 +414,7 @@ DESCRIPTION
*/
-#ifdef NEED_strsignal
+#ifndef HAVE_STRSIGNAL
const char *
strsignal (signo)
@@ -417,7 +423,7 @@ strsignal (signo)
const char *msg;
static char buf[32];
-#ifdef NEED_sys_siglist
+#ifndef HAVE_SYS_SIGLIST
if (signal_names == NULL)
{
@@ -446,7 +452,7 @@ strsignal (signo)
return (msg);
}
-#endif /* NEED_strsignal */
+#endif /* ! HAVE_STRSIGNAL */
/*
@@ -574,7 +580,7 @@ DESCRIPTION
followed by a newline.
*/
-#ifdef NEED_psignal
+#ifndef HAVE_PSIGNAL
void
psignal (signo, message)
@@ -595,7 +601,7 @@ psignal (signo, message)
}
}
-#endif /* NEED_psignal */
+#endif /* ! HAVE_PSIGNAL */
/* A simple little main that does nothing but print all the signal translations