Update of /cvsroot/pywin32/pywin32/win32/src/win32print
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16887/win32print
Modified Files:
Tag: py3k
win32print.cpp
Log Message:
Changes to build for Python 3.0
Index: win32print.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32print/win32print.cpp,v
retrieving revision 1.30
retrieving revision 1.30.2.1
diff -C2 -d -r1.30 -r1.30.2.1
*** win32print.cpp 10 Feb 2008 13:35:33 -0000 1.30
--- win32print.cpp 29 Aug 2008 05:00:24 -0000 1.30.2.1
***************
*** 2585,2589 ****
/* List of functions exported by this module */
! // @module win32print|A module, encapsulating the Windows Win32 API.
static struct PyMethodDef win32print_functions[] = {
{"OpenPrinter", PyOpenPrinter, 1}, // @pymeth OpenPrinter|Retrieves a handle to a printer.
--- 2585,2589 ----
/* List of functions exported by this module */
! // @module win32print|A module encapsulating the Windows printing API.
static struct PyMethodDef win32print_functions[] = {
{"OpenPrinter", PyOpenPrinter, 1}, // @pymeth OpenPrinter|Retrieves a handle to a printer.
***************
*** 2646,2658 ****
! extern "C" __declspec(dllexport) void
! initwin32print(void)
{
PyObject *module, *dict;
PyWinGlobals_Ensure();
! module = Py_InitModule("win32print", win32print_functions);
! if (!module) return;
! dict = PyModule_GetDict(module);
! if (!dict) return;
AddConstant(dict, "PRINTER_INFO_1", 1);
AddConstant(dict, "PRINTER_ENUM_LOCAL", PRINTER_ENUM_LOCAL);
--- 2646,2682 ----
! extern "C" __declspec(dllexport)
! #if (PY_VERSION_HEX < 0x03000000)
! void initwin32print(void)
! #else
! PyObject *PyInit_win32print(void)
! #endif
{
PyObject *module, *dict;
PyWinGlobals_Ensure();
!
! #if (PY_VERSION_HEX < 0x03000000)
! module = Py_InitModule("win32print", win32print_functions);
! if (!module)
! return;
! dict = PyModule_GetDict(module);
! if (!dict)
! return;
! #else
! static PyModuleDef win32print_def = {
! PyModuleDef_HEAD_INIT,
! "win32print",
! "A module encapsulating the Windows printing API.",
! -1,
! win32print_functions
! };
! module = PyModule_Create(&win32print_def);
! if (!module)
! return NULL;
! dict = PyModule_GetDict(module);
! if (!dict)
! return NULL;
! #endif
!
AddConstant(dict, "PRINTER_INFO_1", 1);
AddConstant(dict, "PRINTER_ENUM_LOCAL", PRINTER_ENUM_LOCAL);
***************
*** 2836,2839 ****
}
dummy_tuple=PyTuple_New(0);
- }
--- 2860,2866 ----
}
dummy_tuple=PyTuple_New(0);
+ #if (PY_VERSION_HEX >= 0x03000000)
+ return module;
+ #endif
+ }
|