Update of /cvsroot/pywin32/pywin32/isapi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14043
Modified Files:
PyExtensionObjects.cpp PyExtensionObjects.h PyFilterObjects.h
StdAfx.h
Log Message:
merge handling if WRITE_RESTRICTED warnings and allow to compile with vc6
Index: StdAfx.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/StdAfx.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** StdAfx.h 6 Oct 2004 05:11:54 -0000 1.1
--- StdAfx.h 3 Jan 2009 06:11:46 -0000 1.2
***************
*** 35,38 ****
--- 35,52 ----
#include "Python.h"
+ // No Py_RETURN_NONE in py23
+ #if (PY_VERSION_HEX < 0x02040000)
+ /* Macro for returning Py_None from a function */
+ #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
+ #endif
+
+ // include structmember here to deal with warnings related to WRITE_RESTRICTED
+ #ifdef WRITE_RESTRICTED
+ #undef WRITE_RESTRICTED
+ #endif
+ #include "structmember.h"
+ // avoid anyone accidently using the wrong WRITE_RESTRICTED...
+ #undef WRITE_RESTRICTED
+
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
Index: PyExtensionObjects.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** PyExtensionObjects.h 1 Jan 2009 22:37:29 -0000 1.8
--- PyExtensionObjects.h 3 Jan 2009 06:11:46 -0000 1.9
***************
*** 27,37 ****
#include "ControlBlock.h"
-
- #ifdef WRITE_RESTRICTED
- #undef WRITE_RESTRICTED
- #endif
- #include "structmember.h"
- // avoid anyone accidently using the wrong WRITE_RESTRICTED...
- #undef WRITE_RESTRICTED
#include "tupleobject.h"
--- 27,30 ----
Index: PyFilterObjects.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyFilterObjects.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** PyFilterObjects.h 30 Dec 2008 12:18:34 -0000 1.7
--- PyFilterObjects.h 3 Jan 2009 06:11:46 -0000 1.8
***************
*** 27,37 ****
#include "FilterContext.h"
-
- #ifdef WRITE_RESTRICTED
- #undef WRITE_RESTRICTED
- #endif
- #include "structmember.h"
- // avoid anyone accidently using the wrong WRITE_RESTRICTED...
- #undef WRITE_RESTRICTED
#include "tupleobject.h"
--- 27,30 ----
Index: PyExtensionObjects.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** PyExtensionObjects.cpp 1 Jan 2009 22:37:29 -0000 1.12
--- PyExtensionObjects.cpp 3 Jan 2009 06:11:46 -0000 1.13
***************
*** 78,88 ****
PyECB *pyECB = NULL;
BOOL worked = FALSE;
if (!g_callbackMap)
CALLBACK_ERROR("Callback when no callback map exists");
! PyObject *key = PyLong_FromVoidPtr(ecb->ConnID);
if (!key)
CALLBACK_ERROR("Failed to create map key from connection ID");
! PyObject *ob = PyDict_GetItem(g_callbackMap, key);
if (!ob)
CALLBACK_ERROR("Failed to locate map entry for this commID");
--- 78,95 ----
PyECB *pyECB = NULL;
BOOL worked = FALSE;
+ PyObject *callback = NULL;
+ PyObject *user_arg = NULL;
+ PyObject *args = NULL;
+ PyObject *key = NULL;
+ PyObject *ob = NULL;
+ PyObject *result = NULL;
+
if (!g_callbackMap)
CALLBACK_ERROR("Callback when no callback map exists");
! key = PyLong_FromVoidPtr(ecb->ConnID);
if (!key)
CALLBACK_ERROR("Failed to create map key from connection ID");
! ob = PyDict_GetItem(g_callbackMap, key);
if (!ob)
CALLBACK_ERROR("Failed to locate map entry for this commID");
***************
*** 97,106 ****
CALLBACK_ERROR("Object in callback map not a tuple of correct size?");
! PyObject *callback = PyTuple_GET_ITEM(ob, 0);
! PyObject *user_arg = PyTuple_Size(ob)==2 ? PyTuple_GET_ITEM(ob, 1) : Py_None;
! PyObject *args = Py_BuildValue("(OOkk)", pyECB, user_arg, cbIO, dwError);
if (!args)
CALLBACK_ERROR("Failed to build callback args");
! PyObject *result = PyObject_Call(callback, args, NULL);
Py_DECREF(args);
if (!result)
--- 104,113 ----
CALLBACK_ERROR("Object in callback map not a tuple of correct size?");
! callback = PyTuple_GET_ITEM(ob, 0);
! user_arg = PyTuple_Size(ob)==2 ? PyTuple_GET_ITEM(ob, 1) : Py_None;
! args = Py_BuildValue("(OOkk)", pyECB, user_arg, cbIO, dwError);
if (!args)
CALLBACK_ERROR("Failed to build callback args");
! result = PyObject_Call(callback, args, NULL);
Py_DECREF(args);
if (!result)
|