-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test on Linux
- Loading branch information
Showing
6 changed files
with
65 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: library/swift:4.1 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Test | ||
command: swift test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import Foundation | ||
|
||
#if os(Linux) | ||
typealias CGFloatCompatibleWithLinux = CGFloat | ||
|
||
class CGFloat { | ||
fileprivate let value: Double | ||
|
||
init(_ value: Double) { | ||
self.value = value | ||
} | ||
} | ||
|
||
// SEE: https://github.com/apple/swift/blob/d3cb915abb9af1e8ccfbcfd4515e2b75fc75b5f1/stdlib/public/SDK/CoreGraphics/CGFloat.swift.gyb#L363-L368 | ||
extension CGFloat: CustomReflectable { | ||
var customMirror: Mirror { | ||
return Mirror(reflecting: self.value) | ||
} | ||
} | ||
|
||
|
||
// SEE: https://github.com/apple/swift/blob/d3cb915abb9af1e8ccfbcfd4515e2b75fc75b5f1/stdlib/public/SDK/CoreGraphics/CGFloat.swift.gyb#L370-L376 | ||
extension CGFloat: CustomStringConvertible { | ||
var description: String { | ||
return "\(self.value)" | ||
} | ||
} | ||
|
||
|
||
func createCGFloat(_ value: Double) -> CGFloat { | ||
return CGFloat(value) | ||
} | ||
#else | ||
import CoreGraphics | ||
|
||
typealias CGFloatCompatibleWithLinux = CGFloat | ||
|
||
func createCGFloat(_ value: Double) -> CGFloat { | ||
return CGFloat(value) | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.