Make all headers public and add #ifdef __cplusplus #1150

Closed
janicduplessis wants to merge 1 commits from cppheaders into main
10 changed files with 44 additions and 1 deletions

View File

@@ -33,6 +33,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

View File

@@ -7,6 +7,8 @@
#pragma once
#ifdef __cplusplus
#include <cstdio>
#include <cstdint>
#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

View File

@@ -7,6 +7,8 @@
#pragma once
#ifdef __cplusplus
#include "YGValue.h"
#include "YGMacros.h"
#include <cmath>
@@ -182,3 +184,5 @@ constexpr bool operator!=(CompactValue a, CompactValue b) noexcept {
} // namespace detail
} // namespace yoga
} // namespace facebook
#endif

View File

@@ -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

View File

@@ -6,6 +6,9 @@
*/
#pragma once
#ifdef __cplusplus
#include "Yoga-internal.h"
#include "Yoga.h"
@@ -74,3 +77,5 @@ public:
setCloneNodeCallback(YGCloneNodeFunc{nullptr});
}
};
#endif

View File

@@ -7,6 +7,8 @@
#pragma once
#ifdef __cplusplus
#include <cmath>
#include <limits>
#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

View File

@@ -6,6 +6,9 @@
*/
#pragma once
#ifdef __cplusplus
#include "BitUtils.h"
#include "YGFloatOptional.h"
#include "Yoga-internal.h"
@@ -85,3 +88,5 @@ public:
bool operator==(YGLayout layout) const;
bool operator!=(YGLayout layout) const { return !(*this == layout); }
};
#endif

View File

@@ -6,7 +6,11 @@
*/
#ifdef DEBUG
#pragma once
#ifdef __cplusplus
#include <string>
#include "Yoga.h"
@@ -22,4 +26,7 @@ void YGNodeToString(
} // namespace yoga
} // namespace facebook
#endif
#endif

View File

@@ -6,6 +6,9 @@
*/
#pragma once
#ifdef __cplusplus
#include <algorithm>
#include <array>
#include <cmath>
@@ -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

View File

@@ -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