From: Bruno Haible Date: Tue, 10 Jan 2023 08:58:40 +0000 (+0100) Subject: math: Fix compilation errors in C++ mode on Android. X-Git-Tag: v1.0~1868 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=4be3a1e878f313388daa799333d61949edceaab3;p=gnulib.git math: Fix compilation errors in C++ mode on Android. * lib/math.in.h: Declare nothing if this file gets included from /usr/include/c++/v1/math.h too early. --- diff --git a/ChangeLog b/ChangeLog index 1bedaf0ebd..370d01990c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-01-10 Bruno Haible + + math: Fix compilation errors in C++ mode on Android. + * lib/math.in.h: Declare nothing if this file gets included from + /usr/include/c++/v1/math.h too early. + 2023-01-10 Bruno Haible sys_ioctl: Fix compilation error in C++ mode on Android. diff --git a/lib/math.in.h b/lib/math.in.h index f3d58afc0d..a1cb22936b 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -15,6 +15,11 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ +/* On Android, in C++ mode, when /usr/include/c++/v1/math.h is being included + and /usr/include/math.h has not yet been included, skip this file, since it + would lead to many syntax errors. */ +#if !(defined __ANDROID__ && defined _LIBCPP_MATH_H && !defined INFINITY) + #ifndef _@GUARD_PREFIX@_MATH_H #if __GNUC__ >= 3 @@ -2725,3 +2730,4 @@ _GL_INLINE_HEADER_END #endif /* _@GUARD_PREFIX@_MATH_H */ #endif /* _GL_INCLUDING_MATH_H */ #endif /* _@GUARD_PREFIX@_MATH_H */ +#endif