Skip to content

Commit 2330950

Browse files
committed
Tests fix
1 parent 91ef19d commit 2330950

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Sources/JExtractSwiftLib/FFM/FFMSwift2JavaGenerator+SwiftThunkPrinting.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ extension FFMSwift2JavaGenerator {
128128
let mainSymbolSourceModules = Set(
129129
self.lookupContext.symbolTable.importedModules.values.filter { $0.alternativeModules?.isMainSourceOfSymbols ?? false }.map(\.moduleName)
130130
)
131-
131+
132132
for module in self.lookupContext.symbolTable.importedModules.keys.sorted() {
133133
guard module != "Swift" else {
134134
continue
@@ -167,9 +167,13 @@ extension FFMSwift2JavaGenerator {
167167
}
168168
}
169169

170-
printer.print("#else")
171-
printer.print("import \(module)")
172-
printer.print("#endif")
170+
if (importGroups.keys.isEmpty) {
171+
printer.print("import \(module)")
172+
} else {
173+
printer.print("#else")
174+
printer.print("import \(module)")
175+
printer.print("#endif")
176+
}
173177
}
174178
printer.println()
175179
}

0 commit comments

Comments
 (0)