Skip to content

Commit

Permalink
Add builtin folly::nextafter when using uclibc
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ammubhave authored and facebook-github-bot committed May 10, 2019
1 parent b8d837f commit e265e1e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions folly/portability/Math.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@

namespace folly {

#ifndef __ANDROID__
#if !defined(__ANDROID__) && !defined(__UCLIBC__)

/**
* Most platforms hopefully provide std::nextafter.
*/

/* 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__)
Expand Down Expand Up @@ -67,5 +67,5 @@ inline long double nextafter(long double x, long double y) {

#endif // __GNUC__

#endif // __ANDROID__
#endif // !__ANDROID__ && !__UCLIBC__
} // namespace folly

0 comments on commit e265e1e

Please sign in to comment.