Browse Source

For Linux import Glibc, for Darwin import Darwin

Marcin Krzyżanowski 10 years ago
parent
commit
4c2c87ce13

+ 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 {}