[pywin32-checkins] pywin32/win32/src PyWinTypes.h,1.23,1.24
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
|
From: Mark H. <mha...@us...> - 2004-09-07 10:04:50
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21152 Modified Files: PyWinTypes.h Log Message: Add PyBool_FromLong helper for pre python 2.3 builds. Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** PyWinTypes.h 7 Sep 2004 04:27:04 -0000 1.23 --- PyWinTypes.h 7 Sep 2004 10:04:35 -0000 1.24 *************** *** 228,231 **** --- 228,243 ---- PyObject *PyLong_FromI64(__int64 ival); BOOL PyLong_AsI64(PyObject *val, __int64 *lval); + + // Some boolean helpers for Python 2.2 and earlier + #if (PY_VERSION_HEX < 0x02030000 && !defined(PYWIN_NO_BOOL_FROM_LONG)) + // PyBool_FromLong only in 2.3 and later + inline PyObject *PyBool_FromLong(long v) + { + PyObject *ret= v ? Py_True : Py_False; + Py_INCREF(ret); + return ret; + } + #endif + /* ** OVERLAPPED Object and API |