|
|
@@ -20,7 +20,7 @@
|
|
|
#include <typeindex>
|
|
|
#include <initializer_list>
|
|
|
|
|
|
-#define PK_VERSION "1.4.5"
|
|
|
+#define PK_VERSION "1.4.6"
|
|
|
|
|
|
#include "config.h"
|
|
|
#include "export.h"
|
|
|
@@ -70,26 +70,18 @@ namespace std = ::std;
|
|
|
template <size_t T>
|
|
|
struct NumberTraits;
|
|
|
|
|
|
-inline constexpr bool is_negative_shift_well_defined(){
|
|
|
-#ifdef __EMSCRIPTEN__
|
|
|
- return false;
|
|
|
-#endif
|
|
|
- // rshift does not affect the sign bit
|
|
|
- return -1 >> 1 == -1;
|
|
|
-}
|
|
|
-
|
|
|
template <>
|
|
|
struct NumberTraits<4> {
|
|
|
using int_t = int32_t;
|
|
|
static constexpr int_t kMaxSmallInt = (1 << 28) - 1;
|
|
|
- static constexpr int_t kMinSmallInt = is_negative_shift_well_defined() ? -(1 << 28) : 0;
|
|
|
+ static constexpr int_t kMinSmallInt = 0;
|
|
|
};
|
|
|
|
|
|
template <>
|
|
|
struct NumberTraits<8> {
|
|
|
using int_t = int64_t;
|
|
|
static constexpr int_t kMaxSmallInt = (1ll << 60) - 1;
|
|
|
- static constexpr int_t kMinSmallInt = is_negative_shift_well_defined() ? -(1ll << 60) : 0;
|
|
|
+ static constexpr int_t kMinSmallInt = 0;
|
|
|
};
|
|
|
|
|
|
using Number = NumberTraits<sizeof(void*)>;
|