From 46e52fdae08b89264a0b23f94391c2bf637def34 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 16 Apr 2025 22:29:17 +1000 Subject: [PATCH] Provide INFINITY if it's not provided. INFINITY is specified in c99, so define if not provided. --- configure.ac | 5 +++++ defines.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index bbddca009..69b74add8 100644 --- a/configure.ac +++ b/configure.ac @@ -2280,6 +2280,11 @@ AC_CHECK_DECLS([offsetof], , , [ #include ]) +AC_CHECK_DECLS([INFINITY], , + AC_CHECK_DECLS(__builtin_inff), + [#include ] +) + # extra bits for select(2) AC_CHECK_DECLS([howmany, NFDBITS], [], [], [[ #include diff --git a/defines.h b/defines.h index d2baeb940..3721ae16e 100644 --- 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 */ -- 2.47.3