[YogaKit] support macOS, tvOS, Carthage; auto apply layout like AutoLayout. #1026
@@ -10,6 +10,7 @@
|
|||||||
#include "YGMacros.h"
|
#include "YGMacros.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
YG_EXTERN_CXX_BEGIN
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace yoga {
|
namespace yoga {
|
||||||
namespace enums {
|
namespace enums {
|
||||||
@@ -27,6 +28,7 @@ constexpr int n() {
|
|||||||
} // namespace enums
|
} // namespace enums
|
||||||
} // namespace yoga
|
} // namespace yoga
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
YG_EXTERN_C_END
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define YG_ENUM_DECL(NAME, ...) \
|
#define YG_ENUM_DECL(NAME, ...) \
|
||||||
@@ -37,6 +39,7 @@ constexpr int n() {
|
|||||||
#define YG_ENUM_SEQ_DECL(NAME, ...) \
|
#define YG_ENUM_SEQ_DECL(NAME, ...) \
|
||||||
YG_ENUM_DECL(NAME, __VA_ARGS__) \
|
YG_ENUM_DECL(NAME, __VA_ARGS__) \
|
||||||
YG_EXTERN_C_END \
|
YG_EXTERN_C_END \
|
||||||
|
YG_EXTERN_CXX_BEGIN \
|
||||||
namespace facebook { \
|
namespace facebook { \
|
||||||
namespace yoga { \
|
namespace yoga { \
|
||||||
namespace enums { \
|
namespace enums { \
|
||||||
@@ -47,6 +50,7 @@ constexpr int n() {
|
|||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
|
YG_EXTERN_C_END \
|
||||||
YG_EXTERN_C_BEGIN
|
YG_EXTERN_C_BEGIN
|
||||||
#else
|
#else
|
||||||
#define YG_ENUM_SEQ_DECL YG_ENUM_DECL
|
#define YG_ENUM_SEQ_DECL YG_ENUM_DECL
|
||||||
|
@@ -8,9 +8,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
#define YG_EXTERN_CXX_BEGIN extern "C++" {
|
||||||
#define YG_EXTERN_C_BEGIN extern "C" {
|
#define YG_EXTERN_C_BEGIN extern "C" {
|
||||||
#define YG_EXTERN_C_END }
|
#define YG_EXTERN_C_END }
|
||||||
#else
|
#else
|
||||||
|
#define YG_EXTERN_CXX_BEGIN
|
||||||
#define YG_EXTERN_C_BEGIN
|
#define YG_EXTERN_C_BEGIN
|
||||||
#define YG_EXTERN_C_END
|
#define YG_EXTERN_C_END
|
||||||
#endif
|
#endif
|
||||||
|
@@ -15,8 +15,10 @@
|
|||||||
#define COMPILING_WITH_CLANG_ON_WINDOWS
|
#define COMPILING_WITH_CLANG_ON_WINDOWS
|
||||||
#endif
|
#endif
|
||||||
#if defined(COMPILING_WITH_CLANG_ON_WINDOWS)
|
#if defined(COMPILING_WITH_CLANG_ON_WINDOWS)
|
||||||
|
YG_EXTERN_CXX_BEGIN
|
||||||
#include <limits>
|
#include <limits>
|
||||||
constexpr float YGUndefined = std::numeric_limits<float>::quiet_NaN();
|
constexpr float YGUndefined = std::numeric_limits<float>::quiet_NaN();
|
||||||
|
YG_EXTERN_C_END
|
||||||
#else
|
#else
|
||||||
YG_EXTERN_C_BEGIN
|
YG_EXTERN_C_BEGIN
|
||||||
|
|
||||||
@@ -44,6 +46,7 @@ YG_EXTERN_C_END
|
|||||||
#undef COMPILING_WITH_CLANG_ON_WINDOWS
|
#undef COMPILING_WITH_CLANG_ON_WINDOWS
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
YG_EXTERN_CXX_BEGIN
|
||||||
|
|
||||||
inline bool operator==(const YGValue& lhs, const YGValue& rhs) {
|
inline bool operator==(const YGValue& lhs, const YGValue& rhs) {
|
||||||
if (lhs.unit != rhs.unit) {
|
if (lhs.unit != rhs.unit) {
|
||||||
@@ -92,4 +95,5 @@ inline YGValue operator"" _percent(unsigned long long value) {
|
|||||||
} // namespace yoga
|
} // namespace yoga
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|
||||||
|
YG_EXTERN_C_END
|
||||||
#endif
|
#endif
|
||||||
|
@@ -360,6 +360,7 @@ WIN_EXPORT float YGRoundValueToPixelGrid(
|
|||||||
YG_EXTERN_C_END
|
YG_EXTERN_C_END
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
YG_EXTERN_CXX_BEGIN
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -371,4 +372,5 @@ void YGTraversePreOrder(
|
|||||||
|
|
||||||
void YGNodeSetChildren(YGNodeRef owner, const std::vector<YGNodeRef>& children);
|
void YGNodeSetChildren(YGNodeRef owner, const std::vector<YGNodeRef>& children);
|
||||||
|
|
||||||
|
YG_EXTERN_C_END
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user