[pywin32-checkins] pywin32/win32/src PyWinTypes.h, 1.45, 1.46 PyTime.cpp, 1.18, 1.19
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2007-07-13 02:59:32
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8553 Modified Files: PyWinTypes.h PyTime.cpp Log Message: * Add PyWinObject_Astime_t * Disable the block which assumes wchar_t != ushort when using cl ver 14 Index: PyTime.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyTime.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** PyTime.cpp 24 May 2007 06:01:05 -0000 1.18 --- PyTime.cpp 13 Jul 2007 02:59:33 -0000 1.19 *************** *** 799,802 **** } - #endif // NO_PYWINTYPES_TIME --- 799,810 ---- } #endif // NO_PYWINTYPES_TIME + + PYWINTYPES_EXPORT BOOL PyWinObject_Astime_t(PyObject *ob, time_t *t) + { + // We need to get smarter about 64bit time_t values... + *t = (time_t)PyInt_AsLong(ob); + if (*t == -1 && PyErr_Occurred()) + return FALSE; + return TRUE; + } Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** PyWinTypes.h 5 Jun 2007 05:46:48 -0000 1.45 --- PyWinTypes.h 13 Jul 2007 02:59:33 -0000 1.46 *************** *** 164,168 **** // win32 structures that still use 'unsigned short' now fail from C++ with // VS8 so we provide a couple of helpers. ! #if _MSC_VER >= 1400 inline BOOL PyWinObject_AsWCHAR(PyObject *stringObject, unsigned short **pResult, BOOL bNoneOK = FALSE, DWORD *pResultLen = NULL) { --- 164,172 ---- // win32 structures that still use 'unsigned short' now fail from C++ with // VS8 so we provide a couple of helpers. ! // XXX - but, when trying to use VC2003 with x64, the SDK x64 compiler ! // reports itself as 14.00.40310.41 - so this breaks under that compiler ! // Its not clear how to resolve this, but while VS2003 is the default ! // compiler, that is what must work. ! #if 0 and _MSC_VER >= 1400 inline BOOL PyWinObject_AsWCHAR(PyObject *stringObject, unsigned short **pResult, BOOL bNoneOK = FALSE, DWORD *pResultLen = NULL) { *************** *** 382,385 **** --- 386,392 ---- #endif // NO_PYWINTYPES_TIME + // Convert a time object to a time_t value. + PYWINTYPES_EXPORT BOOL PyWinObject_Astime_t(PyObject *ob, time_t *t); + // functions to return WIN32_FIND_DATA tuples, used in shell, win32api, and win32file PYWINTYPES_EXPORT PyObject *PyObject_FromWIN32_FIND_DATAA(WIN32_FIND_DATAA *pData); |