diff options
author | Bruno Haible <bruno@clisp.org> | 2002-01-09 19:50:49 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-22 00:39:38 +0200 |
commit | 9772fa7f8761c3fcf0bfabdcccceaebea0e90005 (patch) | |
tree | 2dd2ec5b64668593d0993f438874ae1850d8735c | |
parent | 4a8e58ba59eee0dded31bdb5bf2e5ddb61b27ccc (diff) | |
download | external_gettext-9772fa7f8761c3fcf0bfabdcccceaebea0e90005.zip external_gettext-9772fa7f8761c3fcf0bfabdcccceaebea0e90005.tar.gz external_gettext-9772fa7f8761c3fcf0bfabdcccceaebea0e90005.tar.bz2 |
Irix 6.5 portability.
-rw-r--r-- | src/ChangeLog | 9 | ||||
-rw-r--r-- | src/msgfmt.c | 26 |
2 files changed, 28 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 61289d5..f75cc5e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,14 @@ 2002-01-09 Bruno Haible <bruno@clisp.org> + * msgfmt.c (USE_SIGINFO): New macro. + (sigfpe_code, sigfpe_handler, install_sigfpe_handler, + uninstall_sigfpe_handler, check_plural_eval): Use USE_SIGINFO instead + of HAVE_SIGINFO. + (install_sigfpe_handler, uninstall_sigfpe_handler): On Irix, treat + SIGTRAP like SIGFPE. + +2002-01-09 Bruno Haible <bruno@clisp.org> + * x-java.l (strip_ending_spaces): Fix logic. 2002-01-09 Tommy Johansson <tommy.johansson@kanalen.org> diff --git a/src/msgfmt.c b/src/msgfmt.c index 669f1bb..976cc8d 100644 --- a/src/msgfmt.c +++ b/src/msgfmt.c @@ -1,5 +1,5 @@ /* Converts Uniforum style .po files to binary .mo files - Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, April 1995. This program is free software; you can redistribute it and/or modify @@ -53,6 +53,12 @@ #define SIZEOF(a) (sizeof(a) / sizeof(a[0])) +/* We use siginfo to get precise information about the signal. + But siginfo doesn't work on Irix 6.5. */ +#if HAVE_SIGINFO && !defined (__sgi) +# define USE_SIGINFO 1 +#endif + /* This structure defines a derived class of the po_ty class. (See po.h for an explanation.) */ typedef struct msgfmt_class_ty msgfmt_class_ty; @@ -174,7 +180,7 @@ static const char *add_mo_suffix PARAMS ((const char *)); static struct msg_domain *new_domain PARAMS ((const char *name, const char *file_name)); static bool is_nonobsolete PARAMS ((const message_ty *mp)); -#if HAVE_SIGINFO +#if USE_SIGINFO static void sigfpe_handler PARAMS ((int sig, siginfo_t *sip, void *scp)); #else static void sigfpe_handler PARAMS ((int sig)); @@ -620,7 +626,7 @@ is_nonobsolete (mp) static sigjmp_buf sigfpe_exit; -#if HAVE_SIGINFO +#if USE_SIGINFO static int sigfpe_code; @@ -652,7 +658,7 @@ sigfpe_handler (sig) static void install_sigfpe_handler () { -#if HAVE_SIGINFO +#if USE_SIGINFO struct sigaction action; action.sa_sigaction = sigfpe_handler; action.sa_flags = SA_SIGINFO; @@ -660,13 +666,16 @@ install_sigfpe_handler () sigaction (SIGFPE, &action, (struct sigaction *) NULL); #else signal (SIGFPE, sigfpe_handler); +# if defined (__sgi) && defined (SIGTRAP) /* Irix sends SIGTRAP, not SIGFPE. */ + signal (SIGTRAP, sigfpe_handler); +# endif #endif } static void uninstall_sigfpe_handler () { -#if HAVE_SIGINFO +#if USE_SIGINFO struct sigaction action; action.sa_handler = SIG_DFL; action.sa_flags = 0; @@ -674,6 +683,9 @@ uninstall_sigfpe_handler () sigaction (SIGFPE, &action, (struct sigaction *) NULL); #else signal (SIGFPE, SIG_DFL); +# if defined (__sgi) && defined (SIGTRAP) /* Irix sends SIGTRAP, not SIGFPE. */ + signal (SIGTRAP, SIG_DFL); +# endif #endif } @@ -735,11 +747,11 @@ check_plural_eval (plural_expr, nplurals_value, header_pos) /* End of protection against arithmetic exceptions. */ uninstall_sigfpe_handler (); -#if HAVE_SIGINFO +#if USE_SIGINFO switch (sigfpe_code) #endif { -#if HAVE_SIGINFO +#if USE_SIGINFO # ifdef FPE_INTDIV case FPE_INTDIV: msg = _("plural expression can produce division by zero"); |