Skip to content

Commit

Permalink
Try to fix MSVC Buck Build (#37242)
Browse files Browse the repository at this point in the history
Summary:
X-link: facebook/react-native#37242

Pull Request resolved: #1278

Reviewed By: yungsters

Differential Revision: D45552325

fbshipit-source-id: 881e83b72166900fc475bcf77ec2849759766894
  • Loading branch information
NickGerleman authored and facebook-github-bot committed May 4, 2023
1 parent f3633a2 commit 8c13cbe
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 39 deletions.
4 changes: 2 additions & 2 deletions enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def to_log_lower(symbol):
with open(root + "/yoga/YGEnums.h", "w") as f:
f.write(get_license("cpp"))
f.write("#pragma once\n")
f.write('#include "YGMacros.h"\n\n')
f.write("#include <yoga/YGMacros.h>\n\n")
f.write("// clang-format off\n\n\n")

f.write("YG_EXTERN_C_BEGIN\n\n")
Expand Down Expand Up @@ -159,7 +159,7 @@ def to_log_lower(symbol):
# write out C body for printing
with open(root + "/yoga/YGEnums.cpp", "w") as f:
f.write(get_license("cpp"))
f.write('#include "YGEnums.h"\n\n')
f.write("#include <yoga/YGEnums.h>\n\n")
items = sorted(ENUMS.items())
for name, values in items:
f.write("const char* YG%sToString(const YG%s value) {\n" % (name, name))
Expand Down
3 changes: 2 additions & 1 deletion 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 8c13cbe

Please sign in to comment.