Skip to content

Commit 00f89f0

Browse files
committed
Fix Linux build: guard Darwin-only CGPath code
1 parent b698b77 commit 00f89f0

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

Sources/OpenRenderBox/Path/ORBPath.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,6 @@ static const ORBPathCallbacks empty_path_callbacks = {
2525
nullptr,
2626
};
2727

28-
namespace {
29-
ORBPath make_rect(CGRect rect, const CGAffineTransform *transform, ORBPathElement element) {
30-
if (CGRectIsNull(rect)) {
31-
return ORBPathNull;
32-
}
33-
if (transform == nullptr || CGAffineTransformIsIdentity(*transform)) {
34-
// TODO
35-
return ORBPathNull;
36-
} else {
37-
// TODO
38-
return ORBPathNull;
39-
}
40-
}
41-
} /* anonymous namespace */
42-
4328
// Empty path (storage = null)
4429
const ORBPath ORBPathEmpty = {
4530
nullptr,
@@ -70,6 +55,21 @@ void ORBPathRelease(ORBPath path) {
7055

7156
// MARK: - Path Creation
7257

58+
namespace {
59+
ORBPath make_rect(CGRect rect, const CGAffineTransform *transform, ORBPathElement element) {
60+
if (CGRectIsNull(rect)) {
61+
return ORBPathNull;
62+
}
63+
if (transform == nullptr || CGAffineTransformIsIdentity(*transform)) {
64+
// TODO
65+
return ORBPathNull;
66+
} else {
67+
// TODO
68+
return ORBPathNull;
69+
}
70+
}
71+
} /* anonymous namespace */
72+
7373
// TODO: TO be implemented natively
7474

7575
ORBPath ORBPathMakeWithCGPath(CGPathRef cgPath) {

Sources/OpenRenderBox/Path/PathStorage.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@ Storage::~Storage() {
6767
}
6868
// TODO: MapCache
6969
if (flags().isExternal()) {
70+
#if ORB_TARGET_OS_DARWIN
7071
if (cachedCGPath() != nullptr) {
7172
auto oldCache = cachedCGPath();
7273
_cached_cgPath = nullptr;
7374
CFRelease(oldCache);
7475
}
76+
#endif
7577
free((void *)external_storage());
7678
}
7779
}
@@ -107,6 +109,7 @@ bool Storage::apply_elements_(void *info, ORBPathApplyCallback callback) const O
107109
return true;
108110
}
109111

112+
#if ORB_TARGET_OS_DARWIN
110113
CGPathRef Storage::cgpath() const ORB_NOEXCEPT {
111114
if (flags().isInline()) {
112115
return nullptr;
@@ -145,6 +148,7 @@ CGPathRef Storage::cgpath() const ORB_NOEXCEPT {
145148
return expected;
146149
}
147150
}
151+
#endif
148152

149153
} /* Path */
150154
} /* ORB */

0 commit comments

Comments
 (0)