From: Bruno Haible Date: Wed, 2 Dec 2020 20:15:21 +0000 (+0100) Subject: Fix compilation errors in test-math-c++.cc on FreeBSD 12.2/arm64. X-Git-Tag: v1.0~3438 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=e2b183be701e84114edbc4ac68bf2c748a9601f5;p=gnulib.git Fix compilation errors in test-math-c++.cc on FreeBSD 12.2/arm64. * lib/math.in.h (_GL_INCLUDING_MATH_H): New macro, to work around recursive self-include problem on FreeBSD 12.2 in C++ mode. --- diff --git a/ChangeLog b/ChangeLog index b32f1909cd..ae48d2dcdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-12-02 Bruno Haible + + Fix compilation errors in test-math-c++.cc on FreeBSD 12.2/arm64. + * lib/math.in.h (_GL_INCLUDING_MATH_H): New macro, to work around + recursive self-include problem on FreeBSD 12.2 in C++ mode. + 2020-12-02 Bruno Haible spawn-pipe: Allow caller to specify directory for the subprocess. diff --git a/lib/math.in.h b/lib/math.in.h index a0202716b9..1d7b7031c4 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -22,8 +22,23 @@ #endif @PRAGMA_COLUMNS@ +#if defined _GL_INCLUDING_MATH_H +/* Special invocation convention: + - On FreeBSD 12.2 we have a sequence of nested includes + -> -> -> -> + -> -> -> -> + In this situation, the functions are not yet declared, therefore we cannot + provide the C++ aliases. */ + +#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ + +#else +/* Normal invocation convention. */ + /* The include_next requires a split double-inclusion guard. */ +#define _GL_INCLUDING_MATH_H #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ +#undef _GL_INCLUDING_MATH_H #ifndef _@GUARD_PREFIX@_MATH_H #define _@GUARD_PREFIX@_MATH_H @@ -2601,4 +2616,5 @@ _GL_WARN_REAL_FLOATING_DECL (signbit); _GL_INLINE_HEADER_END #endif /* _@GUARD_PREFIX@_MATH_H */ +#endif /* _GL_INCLUDING_MATH_H */ #endif /* _@GUARD_PREFIX@_MATH_H */