summaryrefslogtreecommitdiff
path: root/build-aux/snippet
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-11-14 23:08:21 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2016-11-15 09:12:53 -0800
commitc907efdb0747b408dd4d3dfbc9edf7c4086c9b51 (patch)
tree5ad0c54bd5218917478883344f83395501d18ef9 /build-aux/snippet
parentc3b131294aa42b7997cc9b9a0bbb2934aa27fd6c (diff)
downloadgnulib-c907efdb0747b408dd4d3dfbc9edf7c4086c9b51.tar.gz
snippet/c++defs: fix real-floating arg functions in C++ mode
Also, define isfinite, isinf, isnan, signbit in the gnulib namespace instead of in the global namespace. * build-aux/snippet/c++defs.h (_GL_BEGIN_NAMESPACE) (_GL_END_NAMESPACE): New. * lib/math.in.h (_GL_MATH_CXX_REAL_FLOATING_DECL_2): Use them. (isfinite, isinf, isnan, signbit) [__cplusplus && GNULIB_NAMESPACE]: Define them in the GNULIB_NAMESPACE namespace instead of in the global namespace. * tests/test-math-c++.cc: Check that the isfinite, isinf, isnan, signbit overloads exist in the GNULIB_NAMESPACE namespace, instead of in the global namespace.
Diffstat (limited to 'build-aux/snippet')
-rw-r--r--build-aux/snippet/c++defs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/build-aux/snippet/c++defs.h b/build-aux/snippet/c++defs.h
index 8fc95e37a9..b19a0befa3 100644
--- a/build-aux/snippet/c++defs.h
+++ b/build-aux/snippet/c++defs.h
@@ -17,6 +17,15 @@
#ifndef _GL_CXXDEFS_H
#define _GL_CXXDEFS_H
+/* Begin/end the GNULIB_NAMESPACE namespace. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
+# define _GL_END_NAMESPACE }
+#else
+# define _GL_BEGIN_NAMESPACE
+# define _GL_END_NAMESPACE
+#endif
+
/* The three most frequent use cases of these macros are:
* For providing a substitute for a function that is missing on some