From c907efdb0747b408dd4d3dfbc9edf7c4086c9b51 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 14 Nov 2016 23:08:21 +0000 Subject: 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. --- build-aux/snippet/c++defs.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'build-aux/snippet') 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 -- cgit v1.2.1