changeset 11525:ab231f944252

avoid exposing gnulib:: in header files
author John W. Eaton <jwe@octave.org>
date Fri, 14 Jan 2011 06:20:06 -0500
parents bd6e37860be5
children 7ef6031cb35e
files liboctave/ChangeLog liboctave/lo-mappers.cc liboctave/lo-mappers.h src/ChangeLog src/sighandlers.cc src/sighandlers.h
diffstat 6 files changed, 38 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-14  John W. Eaton  <jwe@octave.org>
+
+	* 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  <jwe@octave.org>
 
 	* file-stat.cc (mode_as_string): Call strmode instead of mode_string.
--- a/liboctave/lo-mappers.cc
+++ b/liboctave/lo-mappers.cc
@@ -48,6 +48,11 @@
   return gnulib::trunc (x);
 }
 
+double xfloor (double x)
+{
+  return gnulib::floor (x);
+}
+
 double
 xround (double x)
 {
--- a/liboctave/lo-mappers.h
+++ b/liboctave/lo-mappers.h
@@ -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); }
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-14  John W. Eaton  <jwe@octave.org>
+
+	* sighandlers.cc (BADSIG, BLOCK_SIGNAL, SIGCHLD, BLOCK_CHILD,
+	UNBLOCK_CHILD): Move macro definitions here from sighandlers.h.
+
 2011-01-14  John W. Eaton  <jwe@octave.org>
 
 	* Update copyright notices for 2011.
--- a/src/sighandlers.cc
+++ b/src/sighandlers.cc
@@ -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.
 
--- a/src/sighandlers.h
+++ b/src/sighandlers.h
@@ -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...