# HG changeset patch # User John W. Eaton # Date 1295004006 18000 # Node ID ab231f944252e12883ddb72e078b84112d626ce8 # Parent bd6e37860be57134ed556ecbcf885395ad2fbed2 avoid exposing gnulib:: in header files diff -r bd6e37860be5 -r ab231f944252 liboctave/ChangeLog --- a/liboctave/ChangeLog Fri Jan 14 06:18:51 2011 -0500 +++ b/liboctave/ChangeLog Fri Jan 14 06:20:06 2011 -0500 @@ -1,3 +1,8 @@ +2011-01-14 John W. Eaton + + * lo-mappers.cc (xfloor): Move function body here from + lo-mappers.h to avoid exposing gnulib:: in a header file. + 2011-01-14 John W. Eaton * file-stat.cc (mode_as_string): Call strmode instead of mode_string. diff -r bd6e37860be5 -r ab231f944252 liboctave/lo-mappers.cc --- a/liboctave/lo-mappers.cc Fri Jan 14 06:18:51 2011 -0500 +++ b/liboctave/lo-mappers.cc Fri Jan 14 06:20:06 2011 -0500 @@ -48,6 +48,11 @@ return gnulib::trunc (x); } +double xfloor (double x) +{ + return gnulib::floor (x); +} + double xround (double x) { diff -r bd6e37860be5 -r ab231f944252 liboctave/lo-mappers.h --- a/liboctave/lo-mappers.h Fri Jan 14 06:18:51 2011 -0500 +++ b/liboctave/lo-mappers.h Fri Jan 14 06:20:06 2011 -0500 @@ -33,7 +33,7 @@ extern OCTAVE_API double xtrunc (double x); inline double xcopysign (double x, double y) { return copysign (x, y); } inline double xceil (double x) { return ceil (x); } -inline double xfloor (double x) { return gnulib::floor (x); } +extern OCTAVE_API double xfloor (double x); inline double arg (double x) { return atan2 (0.0, x); } inline double conj (double x) { return x; } inline double fix (double x) { return xtrunc (x); } diff -r bd6e37860be5 -r ab231f944252 src/ChangeLog --- a/src/ChangeLog Fri Jan 14 06:18:51 2011 -0500 +++ b/src/ChangeLog Fri Jan 14 06:20:06 2011 -0500 @@ -1,3 +1,8 @@ +2011-01-14 John W. Eaton + + * sighandlers.cc (BADSIG, BLOCK_SIGNAL, SIGCHLD, BLOCK_CHILD, + UNBLOCK_CHILD): Move macro definitions here from sighandlers.h. + 2011-01-14 John W. Eaton * Update copyright notices for 2011. diff -r bd6e37860be5 -r ab231f944252 src/sighandlers.cc --- a/src/sighandlers.cc Fri Jan 14 06:18:51 2011 -0500 +++ b/src/sighandlers.cc Fri Jan 14 06:20:06 2011 -0500 @@ -73,6 +73,28 @@ // List of signals we have caught since last call to octave_signal_handler. static bool octave_signals_caught[NSIG]; +// Signal handler return type. +#ifndef BADSIG +#define BADSIG (void (*)(int))-1 +#endif + +#define BLOCK_SIGNAL(sig, nvar, ovar) \ + do \ + { \ + gnulib::sigemptyset (&nvar); \ + gnulib::sigaddset (&nvar, sig); \ + gnulib::sigemptyset (&ovar); \ + gnulib::sigprocmask (SIG_BLOCK, &nvar, &ovar); \ + } \ + while (0) + +#if !defined (SIGCHLD) && defined (SIGCLD) +#define SIGCHLD SIGCLD +#endif + +#define BLOCK_CHILD(nvar, ovar) BLOCK_SIGNAL (SIGCHLD, nvar, ovar) +#define UNBLOCK_CHILD(ovar) gnulib::sigprocmask (SIG_SETMASK, &ovar, 0) + // Called from octave_quit () to actually do something about the signals // we have caught. diff -r bd6e37860be5 -r ab231f944252 src/sighandlers.h --- a/src/sighandlers.h Fri Jan 14 06:18:51 2011 -0500 +++ b/src/sighandlers.h Fri Jan 14 06:20:06 2011 -0500 @@ -43,28 +43,6 @@ #include "base-list.h" -// Signal handler return type. -#ifndef BADSIG -#define BADSIG (void (*)(int))-1 -#endif - -#define BLOCK_SIGNAL(sig, nvar, ovar) \ - do \ - { \ - gnulib::sigemptyset (&nvar); \ - gnulib::sigaddset (&nvar, sig); \ - gnulib::sigemptyset (&ovar); \ - gnulib::sigprocmask (SIG_BLOCK, &nvar, &ovar); \ - } \ - while (0) - -#if !defined (SIGCHLD) && defined (SIGCLD) -#define SIGCHLD SIGCLD -#endif - -#define BLOCK_CHILD(nvar, ovar) BLOCK_SIGNAL (SIGCHLD, nvar, ovar) -#define UNBLOCK_CHILD(ovar) gnulib::sigprocmask (SIG_SETMASK, &ovar, 0) - typedef void sig_handler (int); // FIXME -- the data should probably be private...