diff --git a/AG/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGWeakAttribute.h b/AG/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGWeakAttribute.h index 1bfe921b..0efc34a3 100644 --- a/AG/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGWeakAttribute.h +++ b/AG/AttributeGraph.xcframework/ios-arm64-arm64e/AttributeGraph.framework/Headers/AGWeakAttribute.h @@ -28,6 +28,10 @@ AG_EXPORT AG_REFINED_FOR_SWIFT AGAttribute AGWeakAttributeGetAttribute(AGWeakAttribute weakAttribute); +AG_EXPORT +AG_REFINED_FOR_SWIFT +AGValue AGGraphGetWeakValue(AGWeakAttribute weakAttribute, AGValueOptions options, AGTypeID type); + AG_EXTERN_C_END AG_ASSUME_NONNULL_END diff --git a/AG/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGWeakAttribute.h b/AG/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGWeakAttribute.h index 1bfe921b..0efc34a3 100644 --- a/AG/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGWeakAttribute.h +++ b/AG/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Headers/AGWeakAttribute.h @@ -28,6 +28,10 @@ AG_EXPORT AG_REFINED_FOR_SWIFT AGAttribute AGWeakAttributeGetAttribute(AGWeakAttribute weakAttribute); +AG_EXPORT +AG_REFINED_FOR_SWIFT +AGValue AGGraphGetWeakValue(AGWeakAttribute weakAttribute, AGValueOptions options, AGTypeID type); + AG_EXTERN_C_END AG_ASSUME_NONNULL_END diff --git a/AG/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGWeakAttribute.h b/AG/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGWeakAttribute.h index 1bfe921b..0efc34a3 100644 --- a/AG/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGWeakAttribute.h +++ b/AG/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Headers/AGWeakAttribute.h @@ -28,6 +28,10 @@ AG_EXPORT AG_REFINED_FOR_SWIFT AGAttribute AGWeakAttributeGetAttribute(AGWeakAttribute weakAttribute); +AG_EXPORT +AG_REFINED_FOR_SWIFT +AGValue AGGraphGetWeakValue(AGWeakAttribute weakAttribute, AGValueOptions options, AGTypeID type); + AG_EXTERN_C_END AG_ASSUME_NONNULL_END diff --git a/AG/Sources/Headers/AGWeakAttribute.h b/AG/Sources/Headers/AGWeakAttribute.h index 1bfe921b..0efc34a3 100644 --- a/AG/Sources/Headers/AGWeakAttribute.h +++ b/AG/Sources/Headers/AGWeakAttribute.h @@ -28,6 +28,10 @@ AG_EXPORT AG_REFINED_FOR_SWIFT AGAttribute AGWeakAttributeGetAttribute(AGWeakAttribute weakAttribute); +AG_EXPORT +AG_REFINED_FOR_SWIFT +AGValue AGGraphGetWeakValue(AGWeakAttribute weakAttribute, AGValueOptions options, AGTypeID type); + AG_EXTERN_C_END AG_ASSUME_NONNULL_END diff --git a/Package.swift b/Package.swift index 12733999..94cede14 100644 --- a/Package.swift +++ b/Package.swift @@ -169,7 +169,7 @@ if attributeGraphCondition { openGraphShimsTarget.dependencies.append("OpenGraph") } -let compatibilityTestCondition = envEnable("OPENGRAPH_COMPATIBILITY_TEST", default: true) +let compatibilityTestCondition = envEnable("OPENGRAPH_COMPATIBILITY_TEST") if compatibilityTestCondition && attributeGraphCondition { openGraphCompatibilityTestTarget.dependencies.append("AttributeGraph") var swiftSettings: [SwiftSetting] = (openGraphCompatibilityTestTarget.swiftSettings ?? []) diff --git a/Plugins/UpdateModule/UpdateModuleCommand.swift b/Plugins/UpdateModule/UpdateModuleCommand.swift index b45ffb3d..e26600b0 100644 --- a/Plugins/UpdateModule/UpdateModuleCommand.swift +++ b/Plugins/UpdateModule/UpdateModuleCommand.swift @@ -12,7 +12,7 @@ struct UpdateModuleCommand: CommandPlugin { func performCommand(context: PackagePlugin.PluginContext, arguments: [String]) async throws { #if compiler(>=6.0) // Skip build on WASI 5.10 let process = Process() - process.executableURL = try context.tool(named: "zsh").url + process.executableURL = try context.tool(named: "bash").url process.arguments = ["AG/update.sh"] try process.run() process.waitUntilExit() diff --git a/Sources/OpenGraph/Attribute/Weak/WeakAttribute.swift b/Sources/OpenGraph/Attribute/Weak/WeakAttribute.swift index 3e918d1c..eaa99f97 100644 --- a/Sources/OpenGraph/Attribute/Weak/WeakAttribute.swift +++ b/Sources/OpenGraph/Attribute/Weak/WeakAttribute.swift @@ -49,7 +49,11 @@ public struct WeakAttribute { } public var value: Value? { - attribute?.value + OGGraphGetWeakValue(base, type: Value.self) + .value + // TO BE CONFIRMED + .assumingMemoryBound(to: Value?.self) + .pointee } public func changedValue(options: OGValueOptions = []) -> (value: Value, changed: Bool)? { @@ -62,3 +66,8 @@ extension WeakAttribute: Hashable {} extension WeakAttribute: CustomStringConvertible { public var description: String { base.description } } + +@_silgen_name("OGGraphGetWeakValue") +@inline(__always) +@inlinable +func OGGraphGetWeakValue(_ attribute: AnyWeakAttribute, options: OGValueOptions = [], type: Value.Type = Value.self) -> OGValue diff --git a/Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.cpp b/Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.cpp index d45bfc49..686c5474 100644 --- a/Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.cpp +++ b/Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.cpp @@ -16,3 +16,8 @@ OGAttribute OGWeakAttributeGetAttribute(OGWeakAttribute weakAttribute) { // TODO return OGAttributeNil; } + +OGValue OGGraphGetWeakValue(OGWeakAttribute weakAttribute, OGValueOptions options, OGTypeID type) { + // TODO + return {nullptr, false}; +} diff --git a/Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.h b/Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.h index e19537cc..fce42dd4 100644 --- a/Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.h +++ b/Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.h @@ -28,6 +28,10 @@ OG_EXPORT OG_REFINED_FOR_SWIFT OGAttribute OGWeakAttributeGetAttribute(OGWeakAttribute weakAttribute); +OG_EXPORT +OG_REFINED_FOR_SWIFT +OGValue OGGraphGetWeakValue(OGWeakAttribute weakAttribute, OGValueOptions options, OGTypeID type); + OG_EXTERN_C_END OG_ASSUME_NONNULL_END