Mercurial > hg > octave-terminal
changeset 14338:1ecfba4427ff stable
workaround for apparent bug in GCC 4.1.2 (bug #30685)
* sighandlers.cc: Use GNULIB_NAMEPSACE:: instead of gnulib::.
Define away GNULIB_NAMESPACE if using GCC 4.1.2.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 Feb 2012 15:27:00 -0500 |
parents | 4d917a6a858b |
children | 3e4350f09a55 |
files | src/sighandlers.cc |
diffstat | 1 files changed, 21 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/sighandlers.cc +++ b/src/sighandlers.cc @@ -79,13 +79,25 @@ #define BADSIG (void (*)(int))-1 #endif +// The following is a workaround for an apparent bug in GCC 4.1.2 and +// possibly earlier versions. See Octave bug report #30685 for details. +#if defined (__GNUC__) +# if ! (__GNUC__ > 4 \ + || (__GNUC__ == 4 && (__GNUC_MINOR__ > 1 \ + || (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ > 2)))) +# undef GNULIB_NAMESPACE +# define GNULIB_NAMESPACE +# warning "disabling GNULIB_NAMESPACE for signal functions -- consider upgrading to a current version of GCC" +# endif +#endif + #define BLOCK_SIGNAL(sig, nvar, ovar) \ do \ { \ - gnulib::sigemptyset (&nvar); \ - gnulib::sigaddset (&nvar, sig); \ - gnulib::sigemptyset (&ovar); \ - gnulib::sigprocmask (SIG_BLOCK, &nvar, &ovar); \ + GNULIB_NAMESPACE::sigemptyset (&nvar); \ + GNULIB_NAMESPACE::sigaddset (&nvar, sig); \ + GNULIB_NAMESPACE::sigemptyset (&ovar); \ + GNULIB_NAMESPACE::sigprocmask (SIG_BLOCK, &nvar, &ovar); \ } \ while (0) @@ -94,7 +106,7 @@ #endif #define BLOCK_CHILD(nvar, ovar) BLOCK_SIGNAL (SIGCHLD, nvar, ovar) -#define UNBLOCK_CHILD(ovar) gnulib::sigprocmask (SIG_SETMASK, &ovar, 0) +#define UNBLOCK_CHILD(ovar) GNULIB_NAMESPACE::sigprocmask (SIG_SETMASK, &ovar, 0) // Called from octave_quit () to actually do something about the signals // we have caught. @@ -185,7 +197,7 @@ { octave_set_signal_handler (sig_number, SIG_DFL); - gnulib::raise (sig_number); + GNULIB_NAMESPACE::raise (sig_number); } } } @@ -216,10 +228,10 @@ act.sa_flags |= SA_RESTART; #endif - gnulib::sigemptyset (&act.sa_mask); - gnulib::sigemptyset (&oact.sa_mask); + GNULIB_NAMESPACE::sigemptyset (&act.sa_mask); + GNULIB_NAMESPACE::sigemptyset (&oact.sa_mask); - gnulib::sigaction (sig, &act, &oact); + GNULIB_NAMESPACE::sigaction (sig, &act, &oact); return oact.sa_handler; }