Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions AG/Sources/Headers/AGWeakAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? [])
Expand Down
2 changes: 1 addition & 1 deletion Plugins/UpdateModule/UpdateModuleCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
11 changes: 10 additions & 1 deletion Sources/OpenGraph/Attribute/Weak/WeakAttribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ public struct WeakAttribute<Value> {
}

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)? {
Expand All @@ -62,3 +66,8 @@ extension WeakAttribute: Hashable {}
extension WeakAttribute: CustomStringConvertible {
public var description: String { base.description }
}

@_silgen_name("OGGraphGetWeakValue")
@inline(__always)
@inlinable
func OGGraphGetWeakValue<Value>(_ attribute: AnyWeakAttribute, options: OGValueOptions = [], type: Value.Type = Value.self) -> OGValue
5 changes: 5 additions & 0 deletions Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ OGAttribute OGWeakAttributeGetAttribute(OGWeakAttribute weakAttribute) {
// TODO
return OGAttributeNil;
}

OGValue OGGraphGetWeakValue(OGWeakAttribute weakAttribute, OGValueOptions options, OGTypeID type) {
// TODO
return {nullptr, false};
}
4 changes: 4 additions & 0 deletions Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down