mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
fix 32bits
This commit is contained in:
parent
2475fcda77
commit
75d83787f4
@ -35,6 +35,7 @@ typedef int32_t i64;
|
|||||||
typedef float f64;
|
typedef float f64;
|
||||||
#define S_TO_INT std::stoi
|
#define S_TO_INT std::stoi
|
||||||
#define S_TO_FLOAT std::stof
|
#define S_TO_FLOAT std::stof
|
||||||
|
#define PKPY_USE_32_BITS
|
||||||
#else
|
#else
|
||||||
typedef int64_t i64;
|
typedef int64_t i64;
|
||||||
typedef double f64;
|
typedef double f64;
|
||||||
|
3
src/vm.h
3
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){
|
template<> i64 _py_cast<i64>(VM* vm, const PyVar& obj){
|
||||||
return obj.bits >> 2;
|
return obj.bits >> 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef PKPY_USE_32_BITS
|
||||||
template<> int py_cast<int>(VM* vm, const PyVar& obj){
|
template<> int py_cast<int>(VM* vm, const PyVar& obj){
|
||||||
vm->check_type(obj, vm->tp_int);
|
vm->check_type(obj, vm->tp_int);
|
||||||
return obj.bits >> 2;
|
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){
|
template<> int _py_cast<int>(VM* vm, const PyVar& obj){
|
||||||
return obj.bits >> 2;
|
return obj.bits >> 2;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
template<> f64 py_cast<f64>(VM* vm, const PyVar& obj){
|
template<> f64 py_cast<f64>(VM* vm, const PyVar& obj){
|
||||||
vm->check_type(obj, vm->tp_float);
|
vm->check_type(obj, vm->tp_float);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user