Update of /cvsroot/ctypes/ctypes/source
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15402
Modified Files:
Tag: branch_1_0
_ctypes.c
Log Message:
Simplify the code.
Index: _ctypes.c
===================================================================
RCS file: /cvsroot/ctypes/ctypes/source/_ctypes.c,v
retrieving revision 1.226.2.39
retrieving revision 1.226.2.40
diff -C2 -d -r1.226.2.39 -r1.226.2.40
*** _ctypes.c 30 Dec 2005 17:22:49 -0000 1.226.2.39
--- _ctypes.c 2 Jan 2006 15:06:40 -0000 1.226.2.40
***************
*** 106,109 ****
--- 106,115 ----
#ifdef MS_WIN32
#include <windows.h>
+ # ifdef _WIN32_WCE
+ /* Unlike desktop Windows, WinCE has both W and A variants of
+ GetProcAddress, but the default W version is not what we want */
+ # undef GetProcAddress
+ # define GetProcAddress GetProcAddressA
+ # endif
#else
#include <dlfcn.h>
***************
*** 244,248 ****
#ifdef MS_WIN32
! address = (void *)GetProcAddressA(handle, name);
if (!address) {
PyErr_Format(PyExc_ValueError,
--- 250,254 ----
#ifdef MS_WIN32
! address = (void *)GetProcAddress(handle, name);
if (!address) {
PyErr_Format(PyExc_ValueError,
***************
*** 2341,2345 ****
StgDictObject *dict = PyType_stgdict((PyObject *)type);
! address = (PPROC)GetProcAddressA(handle, name);
if (address)
return address;
--- 2347,2351 ----
StgDictObject *dict = PyType_stgdict((PyObject *)type);
! address = (PPROC)GetProcAddress(handle, name);
if (address)
return address;
***************
*** 2355,2359 ****
for (i = 0; i < 32; ++i) {
sprintf(mangled_name, "_%s@%d", name, i*4);
! address = (PPROC)GetProcAddressA(handle, mangled_name);
if (address)
return address;
--- 2361,2365 ----
for (i = 0; i < 32; ++i) {
sprintf(mangled_name, "_%s@%d", name, i*4);
! address = (PPROC)GetProcAddress(handle, mangled_name);
if (address)
return address;
|