Skip to content

Commit

Permalink
Try to fix MSVC Buck Build (#37242)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #37242

X-link: facebook/yoga#1278

Reviewed By: yungsters

Differential Revision: D45552325

fbshipit-source-id: 5687e8ec27a7a70df66e2f89e800210e3ce21ba3
  • Loading branch information
NickGerleman authored and facebook-github-bot committed May 4, 2023
1 parent 8e1d9a0 commit 1cd0f57
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 37 deletions.
3 changes: 2 additions & 1 deletion packages/react-native/ReactCommon/yoga/yoga/BitUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#include <bitset>
#include <cstdio>
#include <cstdint>
#include "YGEnums.h"

#include <yoga/YGEnums.h>

namespace facebook {
namespace yoga {
Expand Down
12 changes: 7 additions & 5 deletions packages/react-native/ReactCommon/yoga/yoga/CompactValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@

#pragma once

#include <cmath>
#include <cstdint>
#include <limits>

#include <yoga/YGMacros.h>
#include <yoga/YGValue.h>

#if defined(__has_include) && __has_include(<version>)
// needed to be able to evaluate defined(__cpp_lib_bit_cast)
#include <version>
Expand All @@ -20,11 +27,6 @@
#else
#include <cstring>
#endif
#include "YGValue.h"
#include "YGMacros.h"
#include <cmath>
#include <cstdint>
#include <limits>

static_assert(
std::numeric_limits<float>::is_iec559,
Expand Down
5 changes: 3 additions & 2 deletions packages/react-native/ReactCommon/yoga/yoga/YGConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

#pragma once

#include "Yoga-internal.h"
#include "Yoga.h"
#include <yoga/Yoga.h>

#include "BitUtils.h"
#include "Yoga-internal.h"

namespace facebook {
namespace yoga {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/ReactCommon/yoga/yoga/YGEnums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// @generated by enums.py

#include "YGEnums.h"
#include <yoga/YGEnums.h>

const char* YGAlignToString(const YGAlign value) {
switch (value) {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/ReactCommon/yoga/yoga/YGEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// @generated by enums.py

#pragma once
#include "YGMacros.h"
#include <yoga/YGMacros.h>

// clang-format off

Expand Down
7 changes: 5 additions & 2 deletions packages/react-native/ReactCommon/yoga/yoga/YGNodePrint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
*/

#ifdef DEBUG
#include "YGNodePrint.h"

#include <stdarg.h>
#include "YGEnums.h"

#include <yoga/YGEnums.h>

#include "YGNodePrint.h"
#include "YGNode.h"
#include "Yoga-internal.h"
#include "Utils.h"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/ReactCommon/yoga/yoga/YGNodePrint.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <string>

#include "Yoga.h"
#include <yoga/Yoga.h>

namespace facebook {
namespace yoga {
Expand Down
5 changes: 3 additions & 2 deletions packages/react-native/ReactCommon/yoga/yoga/YGStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
#include <array>
#include <cstdint>
#include <type_traits>

#include <yoga/Yoga.h>

#include "CompactValue.h"
#include "YGEnums.h"
#include "YGFloatOptional.h"
#include "Yoga-internal.h"
#include "Yoga.h"
#include "BitUtils.h"

class YOGA_EXPORT YGStyle {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/ReactCommon/yoga/yoga/YGValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

#include "YGValue.h"
#include <yoga/YGValue.h>

const YGValue YGValueZero = {0, YGUnitPoint};
const YGValue YGValueUndefined = {YGUndefined, YGUnitUndefined};
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native/ReactCommon/yoga/yoga/YGValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#pragma once

#include "YGEnums.h"
#include "YGMacros.h"
#include <yoga/YGEnums.h>
#include <yoga/YGMacros.h>

YG_EXTERN_C_BEGIN

Expand Down
4 changes: 3 additions & 1 deletion packages/react-native/ReactCommon/yoga/yoga/Yoga-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
#include <array>
#include <cmath>
#include <vector>

#include <yoga/Yoga.h>

#include "CompactValue.h"
#include "Yoga.h"

using YGVector = std::vector<YGNodeRef>;

Expand Down
16 changes: 4 additions & 12 deletions packages/react-native/ReactCommon/yoga/yoga/Yoga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,20 @@
* LICENSE file in the root directory of this source tree.
*/

#include "Yoga.h"
#include "log.h"
#include <float.h>
#include <string.h>
#include <algorithm>
#include <atomic>
#include <memory>

#include <yoga/Yoga.h>

#include "log.h"
#include "Utils.h"
#include "YGNode.h"
#include "YGNodePrint.h"
#include "Yoga-internal.h"
#include "event/event.h"
#ifdef _MSC_VER
#include <float.h>

/* define fmaxf if < VC12 */
#if _MSC_VER < 1800
__forceinline const float fmaxf(const float a, const float b) {
return (a > b) ? a : b;
}
#endif
#endif

using namespace facebook::yoga;
using detail::Log;
Expand Down
6 changes: 3 additions & 3 deletions packages/react-native/ReactCommon/yoga/yoga/Yoga.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include <stdbool.h>
#endif

#include "YGEnums.h"
#include "YGMacros.h"
#include "YGValue.h"
#include <yoga/YGEnums.h>
#include <yoga/YGMacros.h>
#include <yoga/YGValue.h>

YG_EXTERN_C_BEGIN

Expand Down
4 changes: 2 additions & 2 deletions packages/react-native/ReactCommon/yoga/yoga/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* LICENSE file in the root directory of this source tree.
*/

#include "log.h"
#include <yoga/Yoga.h>

#include "Yoga.h"
#include "log.h"
#include "YGConfig.h"
#include "YGNode.h"

Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/ReactCommon/yoga/yoga/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#pragma once

#include "YGEnums.h"
#include <yoga/YGEnums.h>

struct YGNode;
struct YGConfig;
Expand Down

0 comments on commit 1cd0f57

Please sign in to comment.