diff --git a/src/common.h b/src/common.h index 58a715c7..f5bdf49e 100644 --- a/src/common.h +++ b/src/common.h @@ -35,6 +35,7 @@ typedef int32_t i64; typedef float f64; #define S_TO_INT std::stoi #define S_TO_FLOAT std::stof +#define PKPY_USE_32_BITS #else typedef int64_t i64; typedef double f64; diff --git a/src/vm.h b/src/vm.h index 53da8946..60a41622 100644 --- a/src/vm.h +++ b/src/vm.h @@ -388,6 +388,8 @@ template<> i64 py_cast(VM* vm, const PyVar& obj){ template<> i64 _py_cast(VM* vm, const PyVar& obj){ return obj.bits >> 2; } + +#ifndef PKPY_USE_32_BITS template<> int py_cast(VM* vm, const PyVar& obj){ vm->check_type(obj, vm->tp_int); return obj.bits >> 2; @@ -395,6 +397,7 @@ template<> int py_cast(VM* vm, const PyVar& obj){ template<> int _py_cast(VM* vm, const PyVar& obj){ return obj.bits >> 2; } +#endif template<> f64 py_cast(VM* vm, const PyVar& obj){ vm->check_type(obj, vm->tp_float);