Skip to content

Commit

Permalink
Merge pull request #182 from mattrubin/xcode-10
Browse files Browse the repository at this point in the history
Fix compilation with Xcode 10 beta
  • Loading branch information
mattrubin authored Jun 7, 2018
2 parents a1bdada + 5364a18 commit a1660a6
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CommonCrypto/appletvos/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module CommonCrypto [system] {
module CommonCryptoShim [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/include/CommonCrypto/CommonCrypto.h"
export *
}
2 changes: 1 addition & 1 deletion CommonCrypto/appletvsimulator/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module CommonCrypto [system] {
module CommonCryptoShim [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/CommonCrypto/CommonCrypto.h"
export *
}
2 changes: 1 addition & 1 deletion CommonCrypto/iphoneos/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module CommonCrypto [system] {
module CommonCryptoShim [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/CommonCrypto/CommonCrypto.h"
export *
}
2 changes: 1 addition & 1 deletion CommonCrypto/iphonesimulator/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module CommonCrypto [system] {
module CommonCryptoShim [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/CommonCrypto/CommonCrypto.h"
export *
}
2 changes: 1 addition & 1 deletion CommonCrypto/macosx/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module CommonCrypto [system] {
module CommonCryptoShim [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/CommonCrypto/CommonCrypto.h"
export *
}
2 changes: 1 addition & 1 deletion CommonCrypto/watchos/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module CommonCrypto [system] {
module CommonCryptoShim [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/usr/include/CommonCrypto/CommonCrypto.h"
export *
}
2 changes: 1 addition & 1 deletion CommonCrypto/watchsimulator/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module CommonCrypto [system] {
module CommonCryptoShim [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/usr/include/CommonCrypto/CommonCrypto.h"
export *
}
10 changes: 9 additions & 1 deletion Sources/Crypto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@
//

import Foundation
import CommonCrypto
#if swift(>=4.1)
#if canImport(CommonCrypto)
import CommonCrypto
#else
import CommonCryptoShim
#endif
#else
import CommonCryptoShim
#endif

func HMAC(algorithm: Generator.Algorithm, key: Data, data: Data) -> Data {
let (hashFunction, hashLength) = algorithm.hashInfo
Expand Down

0 comments on commit a1660a6

Please sign in to comment.