Skip to content
Browse files
Make YGValue.h compile with Clang on Windows
- We use a fork of Microsoft's react-native-windows which uses a fork of Facebook's react-native
- YGValue.h does not compile with Clang on Windows
- This change should fix that
- I want to put the change here so that it bubbles back to our fork >

[General][Fixed] Make YGValue.h compile with Clang on Windows

Reviewed By: SidharthGuglani

Differential Revision: D19717489

fbshipit-source-id: ad867ecaf910bb64a777a06c656a1867bb15484b
  • Loading branch information
christophpurrer authored and facebook-github-bot committed Feb 5, 2020
1 parent 46dcce0 commit 014bc95135a38d65b991509492c0979cfd153e71
Showing 1 changed file with 11 additions and 0 deletions.
@@ -11,6 +11,13 @@
#include "YGEnums.h"
#include "YGMacros.h"

#if defined(_MSC_VER) && defined(__clang__)
#include <limits>
constexpr float YGUndefined = std::numeric_limits<float>::quiet_NaN();

// Not defined in MSVC++
@@ -20,6 +27,7 @@ static const uint32_t __nan = 0x7fc00000;

#define YGUndefined NAN

typedef struct YGValue {
float value;
@@ -30,7 +38,10 @@ YOGA_EXPORT extern const YGValue YGValueAuto;
YOGA_EXPORT extern const YGValue YGValueUndefined;
YOGA_EXPORT extern const YGValue YGValueZero;


#ifdef __cplusplus

0 comments on commit 014bc95

Please sign in to comment.