Skip to content

Commit 4aeda45

Browse files
authored
Add OGTypeSignature (#98)
1 parent 29f405c commit 4aeda45

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/OpenGraph_SPI/Runtime/OGTypeID.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ OGTypeKind OGTypeGetKind(OGTypeID typeID) {
4242

4343
#if OPENGRAPH_RELEASE >= OPENGRAPH_RELEASE_2024
4444

45-
void const* OGTypeGetSignature(OGTypeID typeID) {
45+
OGTypeSignature const OGTypeGetSignature(OGTypeID typeID) {
4646
#ifdef OPENGRAPH_SWIFT_TOOLCHAIN_SUPPORTED
4747
auto metadata = reinterpret_cast<OG::swift::metadata const*>(typeID);
4848
// TODO
49-
return nullptr;
49+
return OGTypeSignature{};
5050
#else
51-
return nullptr;
51+
return OGTypeSignature{};
5252
#endif
5353
}
5454
void const* OGTypeGetDescriptor(OGTypeID typeID) {

Sources/OpenGraph_SPI/Runtime/OGTypeID.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ typedef OG_CLOSED_ENUM(uint32_t, OGTypeKind) {
3030
OGTypeKindMetatype,
3131
} OG_SWIFT_NAME(Metadata.Kind);
3232

33+
#if OPENGRAPH_RELEASE >= OPENGRAPH_RELEASE_2024
34+
35+
typedef struct OG_SWIFT_NAME(Signature) OGTypeSignature {
36+
uint32_t bytes[5];
37+
} OGTypeSignature;
38+
39+
#endif
40+
3341
OG_EXTERN_C_BEGIN
3442

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

4149
OG_EXPORT
4250
OG_REFINED_FOR_SWIFT
43-
void const* _Nullable OGTypeGetSignature(OGTypeID typeID) OG_SWIFT_NAME(getter:Metadata.signature(self:));
51+
OGTypeSignature const OGTypeGetSignature(OGTypeID typeID) OG_SWIFT_NAME(getter:Metadata.signature(self:));
4452

4553
OG_EXPORT
4654
OG_REFINED_FOR_SWIFT

0 commit comments

Comments
 (0)