Skip to content

Add OGGraphAnyInputsChanged API #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-15]
xcode-version: [16.0] # Swift 6.0
xcode-version: ["16.0"] # Swift 6.0
runs-on: ${{ matrix.os }}
env:
OPENGRAPH_WERROR: 1
Expand Down
2 changes: 1 addition & 1 deletion Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion Sources/OpenGraph/Attribute/Attribute/AnyAttribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
public var _bodyPointer: UnsafeRawPointer {
info.body
}

public var valueType: Any.Type {
info.type.pointee.valueTypeID.type
}
Expand Down Expand Up @@ -97,3 +97,10 @@
body: (UnsafeMutableRawPointer) -> Void
)
}

extension [AnyAttribute] {
@_transparent
public var anyInputsChanged: Bool {
__OGGraphAnyInputsChanged(self, count)

Check warning on line 104 in Sources/OpenGraph/Attribute/Attribute/AnyAttribute.swift

View check run for this annotation

Codecov / codecov/patch

Sources/OpenGraph/Attribute/Attribute/AnyAttribute.swift#L103-L104

Added lines #L103 - L104 were not covered by tests
}
}
5 changes: 5 additions & 0 deletions Sources/OpenGraph_SPI/Graph/OGGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,8 @@ void OGGraphSetNeedsUpdate(OGGraphRef graph) {
}
// graph->context->set_needs_update();
}

bool OGGraphAnyInputsChanged(const OGAttribute *inputs, size_t count) {
// TODO
return false;
}
10 changes: 10 additions & 0 deletions Sources/OpenGraph_SPI/include/OGBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@
#define OG_CONSTEXPR
#endif

#if !defined(__counted_by)
#if __has_attribute(__counted_by__)
#define __counted_by(N) __attribute__((__counted_by__(N)))
#else
#define __counted_by(N)
#endif
#endif

#define OG_COUNTED_BY(N) __counted_by(N)

#include "OGSwiftSupport.h"
#include "OGTargetConditionals.h"
#include <CoreFoundation/CoreFoundation.h>
Expand Down
4 changes: 4 additions & 0 deletions Sources/OpenGraph_SPI/include/OGGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ OG_EXPORT
OG_REFINED_FOR_SWIFT
void OGGraphSetNeedsUpdate(OGGraphRef graph) OG_SWIFT_NAME(OGGraphRef.setNeedsUpdate(self:));

OG_EXPORT
OG_REFINED_FOR_SWIFT
bool OGGraphAnyInputsChanged(const OGAttribute *inputs OG_COUNTED_BY(count), size_t count);

OG_EXTERN_C_END

OG_ASSUME_NONNULL_END
Expand Down