Skip to content

Commit dd0c919

Browse files
committed
include objc workaround for linux
1 parent 5d7677e commit dd0c919

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

Samples/JExtractPluginSampleApp/Sources/JExtractPluginSampleLib/MyCoolSwiftClass.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ public class MyCoolSwiftClass {
2525
}
2626
}
2727

28+
#if os(Linux)
29+
// FIXME: why do we need this workaround?
2830
@_silgen_name("_objc_autoreleaseReturnValue")
2931
public func _objc_autoreleaseReturnValue(a: Any) {}
3032

3133
@_silgen_name("objc_autoreleaseReturnValue")
3234
public func objc_autoreleaseReturnValue(a: Any) {}
35+
#endif

Samples/SwiftKitSampleApp/Sources/MySwiftLibrary/MySwiftLibrary.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,12 @@ private func p(_ msg: String, file: String = #fileID, line: UInt = #line, functi
9090
print("[swift][\(file):\(line)](\(function)) \(msg)")
9191
fflush(stdout)
9292
}
93+
94+
#if os(Linux)
95+
// FIXME: why do we need this workaround?
96+
@_silgen_name("_objc_autoreleaseReturnValue")
97+
public func _objc_autoreleaseReturnValue(a: Any) {}
98+
99+
@_silgen_name("objc_autoreleaseReturnValue")
100+
public func objc_autoreleaseReturnValue(a: Any) {}
101+
#endif

Sources/ExampleSwiftLibrary/MySwiftLibrary.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,12 @@ private func p(_ msg: String, file: String = #fileID, line: UInt = #line, functi
101101
print("[swift][\(file):\(line)](\(function)) \(msg)")
102102
fflush(stdout)
103103
}
104+
105+
#if os(Linux)
106+
// FIXME: why do we need this workaround?
107+
@_silgen_name("_objc_autoreleaseReturnValue")
108+
public func _objc_autoreleaseReturnValue(a: Any) {}
109+
110+
@_silgen_name("objc_autoreleaseReturnValue")
111+
public func objc_autoreleaseReturnValue(a: Any) {}
112+
#endif

0 commit comments

Comments
 (0)