blueloveTH 3 年之前
父節點
當前提交
2d468311a8
共有 2 個文件被更改,包括 11 次插入5 次删除
  1. 10 1
      src/common.h
  2. 1 4
      src/obj.h

+ 10 - 1
src/common.h

@@ -34,10 +34,19 @@
 #define UNREACHABLE() throw std::runtime_error( __FILE__ + std::string(":") + std::to_string(__LINE__) + " UNREACHABLE()!");
 #endif
 
-#define PK_VERSION "0.8.8"
+#define PK_VERSION "0.8.9"
 
+#if defined(__EMSCRIPTEN__) || defined(PK_32_BIT)
+typedef int32_t i64;
+typedef float f64;
+const i64 kMinSafeInt = -((i64)1 << 30);
+const i64 kMaxSafeInt = ((i64)1 << 30) - 1;
+#else
 typedef int64_t i64;
 typedef double f64;
+const i64 kMinSafeInt = -((i64)1 << 62);
+const i64 kMaxSafeInt = ((i64)1 << 62) - 1;
+#endif
 
 struct Dummy { char _; };
 #define DUMMY_VAL Dummy()

+ 1 - 4
src/obj.h

@@ -142,7 +142,4 @@ union __8B {
     f64 _float;
     __8B(i64 val) : _int(val) {}
     __8B(f64 val) : _float(val) {}
-};
-
-const i64 kMinSafeInt = -((i64)1 << 62);
-const i64 kMaxSafeInt = ((i64)1 << 62) - 1;
+};