]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Provide INFINITY if it's not provided.
authorDarren Tucker <dtucker@dtucker.net>
Wed, 16 Apr 2025 12:29:17 +0000 (22:29 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Wed, 16 Apr 2025 12:29:17 +0000 (22:29 +1000)
INFINITY is specified in c99, so define if not provided.

configure.ac
defines.h

index bbddca00908b866f01d7c79e1538ef4881a71abc..69b74add8d00d3340bf1d325f4e021d0b93cf03c 100644 (file)
@@ -2280,6 +2280,11 @@ AC_CHECK_DECLS([offsetof], , , [
 #include <stddef.h>
        ])
 
+AC_CHECK_DECLS([INFINITY], ,
+    AC_CHECK_DECLS(__builtin_inff),
+    [#include <math.h>]
+)
+
 # extra bits for select(2)
 AC_CHECK_DECLS([howmany, NFDBITS], [], [], [[
 #include <sys/param.h>
index d2baeb9407bd649cdb285a6910bb683453c10af7..3721ae16ef9285b595fe718d1a9b29b8f0ce16f4 100644 (file)
--- a/defines.h
+++ b/defines.h
@@ -986,4 +986,11 @@ struct winsize {
 /* The ML-KEM768 implementation also uses C89 features */
 # define USE_MLKEM768X25519    1
 #endif
+
+#if defined(HAVE_DECL_INFINITY) && HAVE_DECL_INFINITY == 0
+# if defined(HAVE_DECL___BUILTIN_INFF) && HAVE_DECL___BUILTIN_INFF == 1
+#  define INFINITY __builtin_inff()
+# endif
+#endif
+
 #endif /* _DEFINES_H */