@@ -6,8 +6,6 @@ import WASILibc
66import Darwin
77#endif
88
9- #if compiler(>=5.5)
10-
119func performanceNow( ) -> Double {
1210return 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
242214JavaScriptEventLoop . installGlobalExecutor ( )
243215Task {
244216do {
@@ -247,8 +219,3 @@ Task {
247219print ( error)
248220}
249221}
250-
251- #endif
252-
253-
254- #endif