Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-11-18 16:17:49 +0100
committerMartin Hořeňovský2023-12-10 18:44:06 +0100
commitbfd9f0f5a67c0127b25ac82eb828f6ab71aaae1e (patch)
treea0efb539745f0ca7186bacc24da48bea66669411 /src/catch2/internal
parent9a1e73568c86644bda84d2d8c719955a050bb3e3 (diff)
downloadcatch3-bfd9f0f5a67c0127b25ac82eb828f6ab71aaae1e.tar.gz
Move nextafter polyfill to polyfills.hpp
Diffstat (limited to 'src/catch2/internal')
-rw-r--r--src/catch2/internal/catch_polyfills.cpp8
-rw-r--r--src/catch2/internal/catch_polyfills.hpp5
2 files changed, 13 insertions, 0 deletions
diff --git a/src/catch2/internal/catch_polyfills.cpp b/src/catch2/internal/catch_polyfills.cpp
index 96efad5d..776c2243 100644
--- a/src/catch2/internal/catch_polyfills.cpp
+++ b/src/catch2/internal/catch_polyfills.cpp
@@ -31,4 +31,12 @@ namespace Catch {
}
#endif
+#if !defined( CATCH_CONFIG_GLOBAL_NEXTAFTER )
+ float nextafter( float x, float y ) { return std::nextafter( x, y ); }
+ double nextafter( double x, double y ) { return std::nextafter( x, y ); }
+#else
+ float nextafter( float x, float y ) { return ::nextafterf( x, y ); }
+ double nextafter( double x, double y ) { return ::nextafter( x, y ); }
+#endif
+
} // end namespace Catch
diff --git a/src/catch2/internal/catch_polyfills.hpp b/src/catch2/internal/catch_polyfills.hpp
index 23a9332b..4503f8f2 100644
--- a/src/catch2/internal/catch_polyfills.hpp
+++ b/src/catch2/internal/catch_polyfills.hpp
@@ -9,8 +9,13 @@
#define CATCH_POLYFILLS_HPP_INCLUDED
namespace Catch {
+
bool isnan(float f);
bool isnan(double d);
+
+ float nextafter(float x, float y);
+ double nextafter(double x, double y);
+
}
#endif // CATCH_POLYFILLS_HPP_INCLUDED