mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
Compile fixes for older Python 3 versions
This commit is contained in:
parent
a387fb9f35
commit
65a705217e
@ -48,7 +48,7 @@ size_t PyLongOrInt_AsSize_t(PyObject *vv) {
|
||||
}
|
||||
|
||||
if (!PyLong_Check(vv)) {
|
||||
PyErr_BadInternalCall();
|
||||
Dtool_Raise_TypeError("a long or int was expected");
|
||||
return (size_t)-1;
|
||||
}
|
||||
|
||||
@ -950,7 +950,7 @@ bool Dtool_ExtractArg(PyObject **result, PyObject *args, PyObject *kwds,
|
||||
if (kwds != NULL && ((PyDictObject *)kwds)->ma_used == 1 &&
|
||||
PyDict_Next(kwds, &ppos, &key, result)) {
|
||||
// We got the item, we just need to make sure that it had the right key.
|
||||
#if PY_VERSION_HEX >= 0x03050000
|
||||
#if PY_VERSION_HEX >= 0x03060000
|
||||
return PyUnicode_CheckExact(key) && _PyUnicode_EqualToASCIIString(key, keyword);
|
||||
#elif PY_MAJOR_VERSION >= 3
|
||||
return PyUnicode_CheckExact(key) && PyUnicode_CompareWithASCIIString(key, keyword) == 0;
|
||||
@ -999,7 +999,7 @@ bool Dtool_ExtractOptionalArg(PyObject **result, PyObject *args, PyObject *kwds,
|
||||
}
|
||||
|
||||
// We got the item, we just need to make sure that it had the right key.
|
||||
#if PY_VERSION_HEX >= 0x03050000
|
||||
#if PY_VERSION_HEX >= 0x03060000
|
||||
return PyUnicode_CheckExact(key) && _PyUnicode_EqualToASCIIString(key, keyword);
|
||||
#elif PY_MAJOR_VERSION >= 3
|
||||
return PyUnicode_CheckExact(key) && PyUnicode_CompareWithASCIIString(key, keyword) == 0;
|
||||
|
@ -145,19 +145,21 @@ extern "C" {
|
||||
EXPCL_PYSTUB int PyType_GenericAlloc(...);
|
||||
EXPCL_PYSTUB int PyType_IsSubtype(...);
|
||||
EXPCL_PYSTUB int PyType_Ready(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS2_AsWideChar(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS2_AsWideCharString(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS2_CompareWithASCIIString(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS2_FromFormat(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS2_FromString(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS2_FromStringAndSize(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS2_FromWideChar(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS2_AsWideChar(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS2_AsWideCharString(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS2_GetSize(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS4_AsWideChar(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS4_AsWideCharString(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS4_CompareWithASCIIString(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS4_FromFormat(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS4_FromString(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS4_FromStringAndSize(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS4_FromWideChar(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS4_AsWideChar(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS4_AsWideCharString(...);
|
||||
EXPCL_PYSTUB int PyUnicodeUCS4_GetSize(...);
|
||||
EXPCL_PYSTUB int PyUnicode_AsUTF8(...);
|
||||
EXPCL_PYSTUB int PyUnicode_AsUTF8AndSize(...);
|
||||
@ -362,19 +364,21 @@ int PyTuple_Type(...) { return 0; };
|
||||
int PyType_GenericAlloc(...) { return 0; };
|
||||
int PyType_IsSubtype(...) { return 0; }
|
||||
int PyType_Ready(...) { return 0; };
|
||||
int PyUnicodeUCS2_AsWideChar(...) { return 0; }
|
||||
int PyUnicodeUCS2_AsWideCharString(...) { return 0; }
|
||||
int PyUnicodeUCS2_CompareWithASCIIString(...) { return 0; }
|
||||
int PyUnicodeUCS2_FromFormat(...) { return 0; }
|
||||
int PyUnicodeUCS2_FromString(...) { return 0; }
|
||||
int PyUnicodeUCS2_FromStringAndSize(...) { return 0; }
|
||||
int PyUnicodeUCS2_FromWideChar(...) { return 0; }
|
||||
int PyUnicodeUCS2_AsWideChar(...) { return 0; }
|
||||
int PyUnicodeUCS2_AsWideCharString(...) { return 0; }
|
||||
int PyUnicodeUCS2_GetSize(...) { return 0; }
|
||||
int PyUnicodeUCS4_AsWideChar(...) { return 0; }
|
||||
int PyUnicodeUCS4_AsWideCharString(...) { return 0; }
|
||||
int PyUnicodeUCS4_CompareWithASCIIString(...) { return 0; }
|
||||
int PyUnicodeUCS4_FromFormat(...) { return 0; }
|
||||
int PyUnicodeUCS4_FromString(...) { return 0; }
|
||||
int PyUnicodeUCS4_FromStringAndSize(...) { return 0; }
|
||||
int PyUnicodeUCS4_FromWideChar(...) { return 0; }
|
||||
int PyUnicodeUCS4_AsWideChar(...) { return 0; }
|
||||
int PyUnicodeUCS4_AsWideCharString(...) { return 0; }
|
||||
int PyUnicodeUCS4_GetSize(...) { return 0; }
|
||||
int PyUnicode_AsUTF8(...) { return 0; }
|
||||
int PyUnicode_AsUTF8AndSize(...) { return 0; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user