blueloveTH il y a 3 ans
Parent
commit
75d83787f4
2 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 1 0
      src/common.h
  2. 3 0
      src/vm.h

+ 1 - 0
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;

+ 3 - 0
src/vm.h

@@ -388,6 +388,8 @@ template<> i64 py_cast<i64>(VM* vm, const PyVar& obj){
 template<> i64 _py_cast<i64>(VM* vm, const PyVar& obj){
     return obj.bits >> 2;
 }
+
+#ifndef PKPY_USE_32_BITS
 template<> int py_cast<int>(VM* vm, const PyVar& obj){
     vm->check_type(obj, vm->tp_int);
     return obj.bits >> 2;
@@ -395,6 +397,7 @@ template<> int py_cast<int>(VM* vm, const PyVar& obj){
 template<> int _py_cast<int>(VM* vm, const PyVar& obj){
     return obj.bits >> 2;
 }
+#endif
 
 template<> f64 py_cast<f64>(VM* vm, const PyVar& obj){
     vm->check_type(obj, vm->tp_float);