Update of /cvsroot/pywin32/pywin32/win32/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24654
Modified Files:
PyUnicode.cpp win32consolemodule.cpp
Log Message:
fix build errors in python 3.2
Index: win32consolemodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32consolemodule.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** win32consolemodule.cpp 8 Dec 2008 13:16:37 -0000 1.17
--- win32consolemodule.cpp 18 Dec 2010 01:09:15 -0000 1.18
***************
*** 110,114 ****
return FALSE;
}
! if (PyUnicode_AsWideChar((PyUnicodeObject *)obchar, onechar, 1)==-1)
return FALSE;
return TRUE;
--- 110,119 ----
return FALSE;
}
! #if (PY_VERSION_HEX < 0x03020000)
! #define PUAWC_TYPE PyUnicodeObject *
! #else
! #define PUAWC_TYPE PyObject *
! #endif
! if (PyUnicode_AsWideChar((PUAWC_TYPE)obchar, onechar, 1)==-1)
return FALSE;
return TRUE;
Index: PyUnicode.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyUnicode.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** PyUnicode.cpp 3 Feb 2009 05:22:25 -0000 1.34
--- PyUnicode.cpp 18 Dec 2010 01:09:15 -0000 1.35
***************
*** 256,266 ****
*pResult = SysAllocStringLen(NULL, nchars);
if (*pResult) {
! PyUnicode_AsWideChar((PyUnicodeObject *)stringObject, *pResult, nchars);
! // The SysAllocStringLen docs indicate that nchars+1 bytes are allocated,
! // and that normally a \0 is appened by the function. It also states
! // the \0 is not necessary! While it seems to work fine without it,
! // we do copy it, as the previous code, which used SysAllocStringLen
! // with a non-NULL arg is documented clearly as appending the \0.
! (*pResult)[nchars] = 0;
}
}
--- 256,274 ----
*pResult = SysAllocStringLen(NULL, nchars);
if (*pResult) {
! #if (PY_VERSION_HEX < 0x03020000)
! #define PUAWC_TYPE PyUnicodeObject *
! #else
! #define PUAWC_TYPE PyObject *
! #endif
! if (PyUnicode_AsWideChar((PUAWC_TYPE)stringObject, *pResult, nchars)==-1) {
! rc = FALSE;
! } else {
! // The SysAllocStringLen docs indicate that nchars+1 bytes are allocated,
! // and that normally a \0 is appened by the function. It also states
! // the \0 is not necessary! While it seems to work fine without it,
! // we do copy it, as the previous code, which used SysAllocStringLen
! // with a non-NULL arg is documented clearly as appending the \0.
! (*pResult)[nchars] = 0;
! }
}
}
|