summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Hořeňovský <martin.horenovsky@gmail.com>2020-02-03 11:26:31 +0100
committerGitHub <noreply@github.com>2020-02-03 11:26:31 +0100
commitb3b07215d1ca2224aea6ff3e21d87ad0f7750df2 (patch)
treef91896dcda5f14e9d91efa21ff0107a858e459a2
parent1715b6b92382f5eed0d5d0ce753f15ec48560773 (diff)
parent2652bb86e3f72292951dfb5ad272a7c0a018118c (diff)
downloadcatch2-b3b07215d1ca2224aea6ff3e21d87ad0f7750df2.tar.gz
Merge pull request #1854 from neheb/patch-1
catch_compiler_capabilities.h: use proper math define
-rw-r--r--include/internal/catch_compiler_capabilities.h2
-rw-r--r--include/internal/catch_matchers_floating.cpp18
2 files changed, 1 insertions, 19 deletions
diff --git a/include/internal/catch_compiler_capabilities.h b/include/internal/catch_compiler_capabilities.h
index 0cc7ed40..9eebd8de 100644
--- a/include/internal/catch_compiler_capabilities.h
+++ b/include/internal/catch_compiler_capabilities.h
@@ -203,7 +203,7 @@
#define CATCH_CONFIG_COLOUR_NONE
#endif
-#if defined(__UCLIBC__)
+#if !defined(_GLIBCXX_USE_C99_MATH_TR1)
#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER
#endif
diff --git a/include/internal/catch_matchers_floating.cpp b/include/internal/catch_matchers_floating.cpp
index c226fc56..bcca0725 100644
--- a/include/internal/catch_matchers_floating.cpp
+++ b/include/internal/catch_matchers_floating.cpp
@@ -59,16 +59,8 @@ namespace {
return static_cast<uint64_t>(ulpDiff) <= maxUlpDiff;
}
-} //end anonymous namespace
-
#if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
-#if defined(__clang__)
-#pragma clang diagnostic push
-// The long double overload is currently unused
-#pragma clang diagnostic ignored "-Wunused-function"
-#endif
-
float nextafter(float x, float y) {
return ::nextafterf(x, y);
}
@@ -77,18 +69,8 @@ namespace {
return ::nextafter(x, y);
}
- long double nextafter(long double x, long double y) {
- return ::nextafterl(x, y);
- }
-
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
-
#endif // ^^^ CATCH_CONFIG_GLOBAL_NEXTAFTER ^^^
-namespace {
-
template <typename FP>
FP step(FP start, FP direction, uint64_t steps) {
for (uint64_t i = 0; i < steps; ++i) {