瀏覽代碼

For Linux import Glibc, for Darwin import Darwin

Marcin Krzyżanowski 10 年之前
父節點
當前提交
4c2c87ce13
共有 4 個文件被更改,包括 23 次插入4 次删除
  1. 5 1
      CryptoSwift/Cipher.swift
  2. 6 1
      CryptoSwift/IntExtension.swift
  3. 6 1
      CryptoSwift/UInt32Extension.swift
  4. 6 1
      CryptoSwift/UInt8Extension.swift

+ 5 - 1
CryptoSwift/Cipher.swift

@@ -6,7 +6,11 @@
 //  Copyright (c) 2014 Marcin Krzyzanowski. All rights reserved.
 //
 
-import Darwin
+#if os(Linux)
+    import Glibc
+#else
+    import Darwin.C
+#endif
 
 public enum CipherError: ErrorType {
     case Encrypt

+ 6 - 1
CryptoSwift/IntExtension.swift

@@ -14,7 +14,12 @@
 //  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
 //  - This notice may not be removed or altered from any source or binary distribution.
 
-import Darwin
+#if os(Linux)
+    import Glibc
+#else
+    import Darwin.C
+#endif
+
 
 /* array of bits */
 extension Int {

+ 6 - 1
CryptoSwift/UInt32Extension.swift

@@ -6,7 +6,12 @@
 //  Copyright (c) 2014 Marcin Krzyzanowski. All rights reserved.
 //
 
-import Darwin
+#if os(Linux)
+    import Glibc
+#else
+    import Darwin.C
+#endif
+
 
 protocol _UInt32Type { }
 extension UInt32: _UInt32Type {}

+ 6 - 1
CryptoSwift/UInt8Extension.swift

@@ -6,7 +6,12 @@
 //  Copyright (c) 2014 Marcin Krzyzanowski. All rights reserved.
 //
 
-import Darwin
+#if os(Linux)
+    import Glibc
+#else
+    import Darwin.C
+#endif
+
 
 public protocol _UInt8Type { }
 extension UInt8: _UInt8Type {}