From e265e1efee0e7bc22a9b74b7e8e5dd5274b3309a Mon Sep 17 00:00:00 2001 From: Amol Bhave Date: Fri, 10 May 2019 07:12:18 -0700 Subject: [PATCH] Add builtin folly::nextafter when using uclibc Summary: When building using uclibc, std::nextafter doesn't exist. This is similar case as for android, where std::nextafter doesn't exist. Add additional condition to choose folly supplied versions of this function. Reviewed By: yfeldblum Differential Revision: D15291534 fbshipit-source-id: f6c9e213248f4e2a6e88e20578aeade46dc85d6b --- folly/portability/Math.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/folly/portability/Math.h b/folly/portability/Math.h index 86b4a8af9b3..80183f27222 100644 --- a/folly/portability/Math.h +++ b/folly/portability/Math.h @@ -20,7 +20,7 @@ namespace folly { -#ifndef __ANDROID__ +#if !defined(__ANDROID__) && !defined(__UCLIBC__) /** * Most platforms hopefully provide std::nextafter. @@ -28,13 +28,13 @@ namespace folly { /* using override */ using std::nextafter; -#else // !__ANDROID__ +#else // !__ANDROID__ && !__UCLIBC__ /** - * On Android, std::nextafter isn't implemented. However, the C functions and - * compiler builtins are still provided. Using the GCC builtin is actually - * slightly faster, as they're constexpr and the use cases within folly are in - * constexpr context. + * On Android and uclibc, std::nextafter isn't implemented. However, the C + * functions and compiler builtins are still provided. Using the GCC builtin is + * actually slightly faster, as they're constexpr and the use cases within folly + * are in constexpr context. */ #if defined(__GNUC__) && !defined(__clang__) @@ -67,5 +67,5 @@ inline long double nextafter(long double x, long double y) { #endif // __GNUC__ -#endif // __ANDROID__ +#endif // !__ANDROID__ && !__UCLIBC__ } // namespace folly