Skip to content

Add OGTypeSignature #98

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 1 commit into from
Jan 3, 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 Package.resolved

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

6 changes: 3 additions & 3 deletions Sources/OpenGraph_SPI/Runtime/OGTypeID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ OGTypeKind OGTypeGetKind(OGTypeID typeID) {

#if OPENGRAPH_RELEASE >= OPENGRAPH_RELEASE_2024

void const* OGTypeGetSignature(OGTypeID typeID) {
OGTypeSignature const OGTypeGetSignature(OGTypeID typeID) {
#ifdef OPENGRAPH_SWIFT_TOOLCHAIN_SUPPORTED
auto metadata = reinterpret_cast<OG::swift::metadata const*>(typeID);
// TODO
return nullptr;
return OGTypeSignature{};
#else
return nullptr;
return OGTypeSignature{};
#endif
}
void const* OGTypeGetDescriptor(OGTypeID typeID) {
Expand Down
10 changes: 9 additions & 1 deletion Sources/OpenGraph_SPI/Runtime/OGTypeID.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ typedef OG_CLOSED_ENUM(uint32_t, OGTypeKind) {
OGTypeKindMetatype,
} OG_SWIFT_NAME(Metadata.Kind);

#if OPENGRAPH_RELEASE >= OPENGRAPH_RELEASE_2024

typedef struct OG_SWIFT_NAME(Signature) OGTypeSignature {
uint32_t bytes[5];
} OGTypeSignature;

#endif

OG_EXTERN_C_BEGIN

OG_EXPORT
Expand All @@ -40,7 +48,7 @@ OGTypeKind OGTypeGetKind(OGTypeID typeID) OG_SWIFT_NAME(getter:Metadata.kind(sel

OG_EXPORT
OG_REFINED_FOR_SWIFT
void const* _Nullable OGTypeGetSignature(OGTypeID typeID) OG_SWIFT_NAME(getter:Metadata.signature(self:));
OGTypeSignature const OGTypeGetSignature(OGTypeID typeID) OG_SWIFT_NAME(getter:Metadata.signature(self:));

OG_EXPORT
OG_REFINED_FOR_SWIFT
Expand Down