]> Savannah Git Hosting - gnulib.git/commitdiff
math: Fix compilation errors in C++ mode on Android.
authorBruno Haible <bruno@clisp.org>
Tue, 10 Jan 2023 08:58:40 +0000 (09:58 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 10 Jan 2023 08:58:40 +0000 (09:58 +0100)
* lib/math.in.h: Declare nothing if this file gets included from
/usr/include/c++/v1/math.h too early.

ChangeLog
lib/math.in.h

index 1bedaf0ebdb6705076a26b74e08874617defa560..370d01990c09446d2181aa322f69ef15c7dada40 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-01-10  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        sys_ioctl: Fix compilation error in C++ mode on Android.
index f3d58afc0de2321c82c1a502c1a68337913cfeff..a1cb22936b19f7245ce94c9f1dfe671ff00730d8 100644 (file)
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+/* 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