diff --git a/Yoga.podspec b/Yoga.podspec index 2b09977daa..077f6ccd60 100644 --- a/Yoga.podspec +++ b/Yoga.podspec @@ -1,8 +1,9 @@ -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. + Pod::Spec.new do |spec| spec.name = 'Yoga' spec.version = '1.14.0' @@ -33,6 +34,6 @@ Pod::Spec.new do |spec| '-fPIC' ] spec.source_files = 'yoga/**/*.{c,h,cpp}' - spec.public_header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGNode,YGStyle,YGValue}.h' + spec.public_header_files = 'yoga/*.h' end diff --git a/yoga/BitUtils.h b/yoga/BitUtils.h index b17751ad33..a60ea7609c 100644 --- a/yoga/BitUtils.h +++ b/yoga/BitUtils.h @@ -7,6 +7,8 @@ #pragma once +#ifdef __cplusplus + #include #include #include "YGEnums.h" @@ -65,3 +67,5 @@ inline void setBooleanData(uint8_t& flags, size_t index, bool value) { } // namespace detail } // namespace yoga } // namespace facebook + +#endif diff --git a/yoga/CompactValue.h b/yoga/CompactValue.h index 6879ca146f..1f03cf721a 100644 --- a/yoga/CompactValue.h +++ b/yoga/CompactValue.h @@ -7,6 +7,8 @@ #pragma once +#ifdef __cplusplus + #include "YGValue.h" #include "YGMacros.h" #include @@ -182,3 +184,5 @@ constexpr bool operator!=(CompactValue a, CompactValue b) noexcept { } // namespace detail } // namespace yoga } // namespace facebook + +#endif diff --git a/yoga/Utils.h b/yoga/Utils.h index d21e8ecb32..8588ecc594 100644 --- a/yoga/Utils.h +++ b/yoga/Utils.h @@ -6,6 +6,9 @@ */ #pragma once + +#ifdef __cplusplus + #include "YGNode.h" #include "Yoga-internal.h" #include "CompactValue.h" @@ -145,3 +148,5 @@ inline YGFloatOptional YGResolveValueMargin( } void throwLogicalErrorWithMessage(const char* message); + +#endif diff --git a/yoga/YGConfig.h b/yoga/YGConfig.h index 607408ace4..e15cc12253 100644 --- a/yoga/YGConfig.h +++ b/yoga/YGConfig.h @@ -6,6 +6,9 @@ */ #pragma once + +#ifdef __cplusplus + #include "Yoga-internal.h" #include "Yoga.h" @@ -74,3 +77,5 @@ struct YOGA_EXPORT YGConfig { setCloneNodeCallback(YGCloneNodeFunc{nullptr}); } }; + +#endif diff --git a/yoga/YGFloatOptional.h b/yoga/YGFloatOptional.h index 4aa9e76e29..6af7bbafbf 100644 --- a/yoga/YGFloatOptional.h +++ b/yoga/YGFloatOptional.h @@ -7,6 +7,8 @@ #pragma once +#ifdef __cplusplus + #include #include #include "Yoga-internal.h" @@ -68,3 +70,5 @@ inline bool operator>=(YGFloatOptional lhs, YGFloatOptional rhs) { inline bool operator<=(YGFloatOptional lhs, YGFloatOptional rhs) { return lhs < rhs || lhs == rhs; } + +#endif diff --git a/yoga/YGLayout.h b/yoga/YGLayout.h index 6c23934207..e3a4a1943b 100644 --- a/yoga/YGLayout.h +++ b/yoga/YGLayout.h @@ -6,6 +6,9 @@ */ #pragma once + +#ifdef __cplusplus + #include "BitUtils.h" #include "YGFloatOptional.h" #include "Yoga-internal.h" @@ -85,3 +88,5 @@ struct YGLayout { bool operator==(YGLayout layout) const; bool operator!=(YGLayout layout) const { return !(*this == layout); } }; + +#endif diff --git a/yoga/YGNodePrint.h b/yoga/YGNodePrint.h index 0e25b9728b..83b3f860e4 100644 --- a/yoga/YGNodePrint.h +++ b/yoga/YGNodePrint.h @@ -6,7 +6,11 @@ */ #ifdef DEBUG + #pragma once + +#ifdef __cplusplus + #include #include "Yoga.h" @@ -22,4 +26,7 @@ void YGNodeToString( } // namespace yoga } // namespace facebook + +#endif + #endif diff --git a/yoga/Yoga-internal.h b/yoga/Yoga-internal.h index 08f9da171c..492543ef1d 100644 --- a/yoga/Yoga-internal.h +++ b/yoga/Yoga-internal.h @@ -6,6 +6,9 @@ */ #pragma once + +#ifdef __cplusplus + #include #include #include @@ -148,3 +151,5 @@ static const float kDefaultFlexShrink = 0.0f; static const float kWebDefaultFlexShrink = 1.0f; extern bool YGFloatsEqual(const float a, const float b); + +#endif diff --git a/yoga/log.h b/yoga/log.h index 1d270e82e4..b9bfea4f39 100644 --- a/yoga/log.h +++ b/yoga/log.h @@ -7,6 +7,8 @@ #pragma once +#ifdef __cplusplus + #include "YGEnums.h" struct YGNode; @@ -36,3 +38,5 @@ struct Log { } // namespace detail } // namespace yoga } // namespace facebook + +#endif