mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
this should fix obj.this on 64-bits architectures
This commit is contained in:
parent
95c7d74a4d
commit
a96c08b5c8
@ -78,9 +78,9 @@ write_code(ostream &out) {
|
||||
<< " PyObject *in_dict = ((PyInstanceObject *)obj)->in_dict;\n"
|
||||
<< " if (in_dict != (PyObject *)NULL && PyDict_Check(in_dict)) {\n"
|
||||
<< " PyObject *thisobj = PyDict_GetItemString(in_dict, \"this\");\n"
|
||||
<< " if (thisobj != (PyObject *)NULL && PyInt_Check(thisobj)) {\n"
|
||||
<< " if (thisobj != (PyObject *)NULL && PyLong_Check(thisobj)) {\n"
|
||||
<< " (*addr) = ("
|
||||
<< _pointer_type->get_local_name(&parser) << ")PyInt_AsLong(thisobj);\n"
|
||||
<< _pointer_type->get_local_name(&parser) << ")PyLong_AsVoidPtr(thisobj);\n"
|
||||
<< " return 1;\n"
|
||||
<< " }\n"
|
||||
<< " }\n"
|
||||
|
@ -73,7 +73,7 @@ write_code(ostream &out) {
|
||||
<< " PyObject *classobj = " << classobj_func << "();\n"
|
||||
<< " PyInstanceObject *instance = (PyInstanceObject *)PyInstance_New(classobj, (PyObject *)NULL, (PyObject *)NULL);\n"
|
||||
<< " if (instance != (PyInstanceObject *)NULL) {\n"
|
||||
<< " PyObject *thisptr = PyInt_FromLong((long)addr);\n"
|
||||
<< " PyObject *thisptr = PyLong_FromVoidPtr((void*)addr);\n"
|
||||
<< " PyDict_SetItemString(instance->in_dict, \"this\", thisptr);\n"
|
||||
<< " }\n"
|
||||
<< " return (PyObject *)instance;\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user