Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b0541a

Browse files
Drop the workaround for old SwiftPM
1 parent 3f0343b commit 3b0541a

File tree

1 file changed

+0
-33
lines changed
  • IntegrationTests/TestSuites/Sources/ConcurrencyTests

1 file changed

+0
-33
lines changed

IntegrationTests/TestSuites/Sources/ConcurrencyTests/main.swift

-33
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import WASILibc
66
import Darwin
77
#endif
88

9-
#if compiler(>=5.5)
10-
119
func performanceNow() -> Double {
1210
return JSObject.global.performance.now().number!
1311
}
@@ -213,32 +211,6 @@ func entrypoint() async throws {
213211
#endif
214212
}
215213

216-
217-
// Note: Please define `USE_SWIFT_TOOLS_VERSION_NEWER_THAN_5_5` if the swift-tools-version is newer
218-
// than 5.5 to avoid the linking issue.
219-
#if USE_SWIFT_TOOLS_VERSION_NEWER_THAN_5_5
220-
// Workaround: The latest SwiftPM rename main entry point name of executable target
221-
// to avoid conflicting "main" with test target since `swift-tools-version >= 5.5`.
222-
// The main symbol is renamed to "{{module_name}}_main" and it's renamed again to be
223-
// "main" when linking the executable target. The former renaming is done by Swift compiler,
224-
// and the latter is done by linker, so SwiftPM passes some special linker flags for each platform.
225-
// But SwiftPM assumes that wasm-ld supports it by returning an empty array instead of nil even though
226-
// wasm-ld doesn't support it yet.
227-
// ref: https://github.com/apple/swift-package-manager/blob/1be68e811d0d814ba7abbb8effee45f1e8e6ec0d/Sources/Build/BuildPlan.swift#L117-L126
228-
// So define an explicit "main" by @_cdecl
229-
@_cdecl("main")
230-
func main(argc: Int32, argv: Int32) -> Int32 {
231-
JavaScriptEventLoop.installGlobalExecutor()
232-
Task {
233-
do {
234-
try await entrypoint()
235-
} catch {
236-
print(error)
237-
}
238-
}
239-
return 0
240-
}
241-
#else
242214
JavaScriptEventLoop.installGlobalExecutor()
243215
Task {
244216
do {
@@ -247,8 +219,3 @@ Task {
247219
print(error)
248220
}
249221
}
250-
251-
#endif
252-
253-
254-
#endif

0 commit comments

Comments
 (0)