From 2d468311a892d072c46492ba760d99b6fb905551 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Mon, 20 Feb 2023 04:31:43 +0800 Subject: [PATCH] up --- src/common.h | 11 ++++++++++- src/obj.h | 5 +---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/common.h b/src/common.h index e858f634..a074986d 100644 --- a/src/common.h +++ b/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() diff --git a/src/obj.h b/src/obj.h index 9a5ee417..c3f5cb27 100644 --- a/src/obj.h +++ b/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; \ No newline at end of file +}; \ No newline at end of file