Skip to content

Commit

Permalink
Explicitly #define isnan __builtin_isnan for Android clang-5 to mimic…
Browse files Browse the repository at this point in the history
… gcc's default behavior

Reviewed By: passy

Differential Revision: D6527499

fbshipit-source-id: 65d9e43c7e7d973a6c92e9863ebe469b35a24ac8
  • Loading branch information
gkmhub authored and facebook-github-bot committed Dec 13, 2017
1 parent 0b1e644 commit f8fe6b0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ReactCommon/yoga/yoga/Yoga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ static int YGDefaultLog(const YGConfigRef config,
#endif

bool YGFloatIsUndefined(const float value) {
// TODO(gkm): Ugh! Some Android builds (r13b & clang-3.8) fail
// with the kludge below, so we must tailor it specifically for
// NDK r15c which has clang-5.0. NDK r16 will make it all better.
#if __ANDROID__ && __clang_major__ == 5 // TODO(gkm): remove for NDK >= 16
#undef isnan
#define isnan __builtin_isnan
#endif
return isnan(value);
}

Expand Down

0 comments on commit f8fe6b0

Please sign in to comment.