Skip to content

Commit

Permalink
Merge pull request #1031 from mxcl/v7-travis-swift-5-GM
Browse files Browse the repository at this point in the history
[travis] Swift 5 GM; Fix Linux compile
  • Loading branch information
mxcl authored Mar 26, 2019
2 parents a2bdfa9 + b6fa4d4 commit 9043465
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
xcode_destination: 'OS=12.2,name=Apple TV'

- name: Linux
env: SWIFT_VERSION='5.0-DEVELOPMENT-SNAPSHOT-2019-01-22-a'
env: SWIFT_VERSION='5.0'
os: linux
language: generic
install: eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
Expand Down
4 changes: 4 additions & 0 deletions Sources/hang.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ import CoreFoundation
*/
public func hang<T>(_ promise: Promise<T>) throws -> T {
#if os(Linux) || os(Android)
#if compiler(>=5)
let runLoopMode: CFRunLoopMode = kCFRunLoopDefaultMode
#else
// isMainThread is not yet implemented on Linux.
let runLoopModeRaw = RunLoopMode.defaultRunLoopMode.rawValue._bridgeToObjectiveC()
let runLoopMode: CFString = unsafeBitCast(runLoopModeRaw, to: CFString.self)
#endif
#else
guard Thread.isMainThread else {
// hang doesn't make sense on threads that aren't the main thread.
Expand Down

0 comments on commit 9043465

Please sign in to comment.