Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8982
Modified Files:
dbi.cpp
Log Message:
Use PyWinObject_Astime_t for time_t conversion. That makes this module
depend on pywintypes, but that should be fine.
Index: dbi.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/dbi.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** dbi.cpp 24 May 2007 06:01:05 -0000 1.9
--- dbi.cpp 13 Jul 2007 03:00:16 -0000 1.10
***************
*** 12,17 ****
#include <time.h>
! #include "Python.h"
! #include "intobject.h"
/* Python 1.5.2 doesn't have PyObject_New
--- 12,16 ----
#include <time.h>
! #include "pywintypes.h"
/* Python 1.5.2 doesn't have PyObject_New
***************
*** 26,32 ****
#include "dbi.h"
! #ifdef _WIN64
! # define ctime _ctime32
! #endif
typedef struct
--- 25,31 ----
#include "dbi.h"
! //#ifdef _WIN64
! //# define ctime _ctime32
! //#endif
typedef struct
***************
*** 95,100 ****
static PyObject *dateStr(PyObject *o)
{
! long l = PyInt_AsLong(dbiValue(o));
! return PyString_FromStringAndSize(ctime(&l), 24); /* less \n */
}
--- 94,101 ----
static PyObject *dateStr(PyObject *o)
{
! time_t t;
! if (!PyWinObject_Astime_t(dbiValue(o), &t))
! return NULL;
! return PyString_FromStringAndSize(ctime(&t), 24); /* less \n */
}
|