Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11793
Modified Files:
Tag: py3k
shell.cpp
Log Message:
Changes to build for Py3k
Index: shell.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v
retrieving revision 1.68
retrieving revision 1.68.2.1
diff -C2 -d -r1.68 -r1.68.2.1
*** shell.cpp 18 Aug 2008 13:01:43 -0000 1.68
--- shell.cpp 29 Aug 2008 08:33:13 -0000 1.68.2.1
***************
*** 2089,2093 ****
if (attr && attr != Py_None) {
fd->dwFlags |= FD_FILESIZE;
! ok = PyLong_AsTwoI32(attr, (int *)&fd->nFileSizeHigh, (unsigned *)&fd->nFileSizeLow);
}
Py_XDECREF(attr);
--- 2089,2098 ----
if (attr && attr != Py_None) {
fd->dwFlags |= FD_FILESIZE;
! ULARGE_INTEGER fsize;
! ok=PyWinObject_AsULARGE_INTEGER(attr, &fsize);
! if (ok){
! fd->nFileSizeHigh=fsize.HighPart;
! fd->nFileSizeLow=fsize.LowPart;
! }
}
Py_XDECREF(attr);
***************
*** 2239,2243 ****
if (fd->dwFlags & FD_FILESIZE) {
! val = PyLong_FromTwoInts(fd->nFileSizeHigh, fd->nFileSizeLow);
if (val) PyDict_SetItemString(sub, "nFileSize", val);
Py_XDECREF(val);
--- 2244,2251 ----
if (fd->dwFlags & FD_FILESIZE) {
! ULARGE_INTEGER fsize;
! fsize.LowPart=fd->nFileSizeLow;
! fsize.HighPart=fd->nFileSizeHigh;
! val = PyWinObject_FromULARGE_INTEGER(fsize);
if (val) PyDict_SetItemString(sub, "nFileSize", val);
Py_XDECREF(val);
***************
*** 3190,3194 ****
/* List of module functions */
! // @module shell|A module, encapsulating the ActiveX Control interfaces
static struct PyMethodDef shell_methods[]=
{
--- 3198,3202 ----
/* List of module functions */
! // @module shell|A module wrapping Windows Shell functions and interfaces
static struct PyMethodDef shell_methods[]=
{
***************
*** 3328,3342 ****
#define ADD_IID(tok) AddIID(dict, #tok, tok)
/* Module initialisation */
! extern "C" __declspec(dllexport) void initshell()
{
! char *modName = "shell";
! PyObject *oModule;
! // Create the module and add the functions
! oModule = Py_InitModule(modName, shell_methods);
! if (!oModule) /* Eeek - some serious error! */
return;
! PyObject *dict = PyModule_GetDict(oModule);
! if (!dict) return; /* Another serious error!*/
PyDict_SetItemString(dict, "error", PyWinExc_COMError);
--- 3336,3375 ----
#define ADD_IID(tok) AddIID(dict, #tok, tok)
+
/* Module initialisation */
! extern "C" __declspec(dllexport)
! #if (PY_VERSION_HEX < 0x03000000)
! void initshell(void)
! #else
! PyObject *PyInit_shell(void)
! #endif
{
! PyObject *dict, *module;
! PyWinGlobals_Ensure();
!
! #if (PY_VERSION_HEX < 0x03000000)
! #define RETURN_ERROR return;
! module = Py_InitModule("shell", shell_methods);
! if (!module)
return;
! dict = PyModule_GetDict(module);
! if (!dict)
! return;
! #else
! #define RETURN_ERROR return NULL;
! static PyModuleDef shell_def = {
! PyModuleDef_HEAD_INIT,
! "shell",
! "A module wrapping Windows Shell functions and interfaces",
! -1,
! shell_methods
! };
! module = PyModule_Create(&shell_def);
! if (!module)
! return NULL;
! dict = PyModule_GetDict(module);
! if (!dict)
! return NULL;
! #endif
PyDict_SetItemString(dict, "error", PyWinExc_COMError);
***************
*** 3501,3503 ****
--- 3534,3540 ----
# pragma message("Please update your SDK headers - IE5 features missing!")
#endif
+
+ #if (PY_VERSION_HEX >= 0x03000000)
+ return module;
+ #endif
}
|