Skip to content

Commit

Permalink
Add OGTypeSignature (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye authored Jan 3, 2025
1 parent 29f405c commit 4aeda45
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"location" : "https://github.com/OpenSwiftUIProject/DarwinPrivateFrameworks.git",
"state" : {
"branch" : "main",
"revision" : "cab10e11f4ad918b3556b5ccaddd0aabb4cd8652"
"revision" : "5a0e8d14d6fbe728951ece9ded2c6f2a6708f5a6"
}
},
{
Expand Down
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

0 comments on commit 4aeda45

Please sign in to comment.