瀏覽代碼

Changes to compile on IOS

mingodad 9 年之前
父節點
當前提交
e06f2b45a2
共有 1 個文件被更改,包括 20 次插入1 次删除
  1. 20 1
      myaxtls/os_int.h

+ 20 - 1
myaxtls/os_int.h

@@ -56,7 +56,26 @@ typedef INT64 int64_t;
 #include <inttypes.h>
 #else
 #include <stdint.h>
-//#include <endian.h>
+#if defined(TARGET_IOS)
+
+#elif defined(__BSD__)
+    #include <sys/types.h>
+    #include <sys/endian.h>
+#else
+    #include <endian.h>
+    // Android compatibility
+    #ifndef be32toh
+        #define be32toh(val) betoh32(val)
+        #define le32toh(val) letoh32(val)
+    #endif
+
+    #ifndef be64toh
+        #define be64toh(val) betoh64(val)
+    #endif
+    #ifndef le64toh
+        #define le64toh(val) letoh64(val)
+    #endif
+#endif
 #endif /* Not Solaris */
 
 #endif /* Not Win32 */