File tree Expand file tree Collapse file tree 4 files changed +8
-0
lines changed
Samples/SwiftKitSampleApp/src/main/java/com/example/swift Expand file tree Collapse file tree 4 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ static void examples() {
86
86
try (var arena = SwiftArena .ofConfined ()) {
87
87
var origBytes = arena .allocateFrom ("foobar" );
88
88
var origDat = Data .init (origBytes , origBytes .byteSize (), arena );
89
+ SwiftKit .trace ("origDat.count = " + origDat .getCount ());
89
90
90
91
// var origBytes = arena.allocate(ValueLayout.JAVA_INT, arry.length);
91
92
// origBytes.copyFrom(MemorySegment.ofArray(arry));
Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ package class FFMSwift2JavaGenerator: Swift2JavaGenerator {
63
63
return String ( filePathPart. replacing ( " .swift " , with: " +SwiftJava.swift " ) )
64
64
} )
65
65
self . expectedOutputSwiftFiles. insert ( " \( translator. swiftModuleName) Module+SwiftJava.swift " )
66
+
67
+ // FIXME: Can we avoid this?
68
+ self . expectedOutputSwiftFiles. insert ( " Data+SwiftJava.swift " )
66
69
} else {
67
70
self . expectedOutputSwiftFiles = [ ]
68
71
}
Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ package class JNISwift2JavaGenerator: Swift2JavaGenerator {
58
58
return String ( filePathPart. replacing ( " .swift " , with: " +SwiftJava.swift " ) )
59
59
} )
60
60
self . expectedOutputSwiftFiles. insert ( " \( translator. swiftModuleName) Module+SwiftJava.swift " )
61
+
62
+ // FIXME: Can we avoid this?
63
+ self . expectedOutputSwiftFiles. insert ( " Data+SwiftJava.swift " )
61
64
} else {
62
65
self . expectedOutputSwiftFiles = [ ]
63
66
}
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ private let swiftSourceFile: SourceFileSyntax = """
88
88
private let foundationSourceFile : SourceFileSyntax = """
89
89
public struct Data {
90
90
public init(bytes: UnsafeRawPointer, count: Int)
91
+ public var count: Int { get }
91
92
public func withUnsafeBytes(_ body: (UnsafeRawBufferPointer) -> Void)
92
93
}
93
94
"""
You can’t perform that action at this time.
0 commit comments