[CCing bug-gnulib]

----------  Forwarded Message  ----------

Subject: gnulib: isnan: Fix compilation error in C++ mode
Date: Dienstag, 27. Februar 2024, 23:08:47 CET
From: Christian Weisgerber <na...@mips.inka.de>
To: Bruno Haible <br...@clisp.org>

Hi,

regarding

isnan: Fix compilation error in C++ mode on macOS 14.4 / Xcode 15.2
https://lists.gnu.org/archive/html/bug-gnulib/2024-02/msg00121.html

I just came across the same problem on OpenBSD 7.5-beta (clang 16.0.6).
I guess the defined() check needs to be extended unless a more generic
solution can be found.

Index: gettext-tools/gnulib-lib/math.in.h
--- gettext-tools/gnulib-lib/math.in.h.orig
+++ gettext-tools/gnulib-lib/math.in.h
@@ -2668,7 +2668,7 @@ _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan)
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, rpl_isnan, bool)
 #    define isnan rpl_isnan
 #    define GNULIB_NAMESPACE_LACKS_ISNAN 1
-#   elif (((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__) && 
__clang_major__ >= 14)
+#   elif (((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || 
defined __OpenBSD__) && __clang_major__ >= 14)
   /* Neither of the two possible _GL_MATH_CXX_REAL_FLOATING_DECL_2 invocations
      works.  Inline functions are already present in 
/usr/include/c++/v1/math.h,
      which comes from LLVM.  */
-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

-----------------------------------------



Reply via email to