summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-04-15 08:35:59 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-04-15 08:35:59 (GMT)
commit7e75f1aafba2e34ed5daef9e633684cf173f7a13 (patch)
tree4110b9f34bf892c5f6e18b7a85b3e5c2ccc1569a /Modules/socketmodule.c
parentc90b17ec8233009e4745dd8f77401f52c5d4a8d5 (diff)
downloadcpython-7e75f1aafba2e34ed5daef9e633684cf173f7a13.zip
cpython-7e75f1aafba2e34ed5daef9e633684cf173f7a13.tar.gz
cpython-7e75f1aafba2e34ed5daef9e633684cf173f7a13.tar.bz2
Patch #1191065: Fix preprocessor problems on systems where recvfrom
is a macro.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index bb5150f..93cb8e0 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -2208,18 +2208,20 @@ sock_recvfrom(PySocketSockObject *s, PyObject *args)
Py_BEGIN_ALLOW_THREADS
memset(&addrbuf, 0, addrlen);
timeout = internal_select(s, 0);
- if (!timeout)
- n = recvfrom(s->sock_fd, PyString_AS_STRING(buf), len, flags,
+ if (!timeout) {
#ifndef MS_WINDOWS
#if defined(PYOS_OS2) && !defined(PYCC_GCC)
- (struct sockaddr *) &addrbuf, &addrlen
+ n = recvfrom(s->sock_fd, PyString_AS_STRING(buf), len, flags,
+ (struct sockaddr *) &addrbuf, &addrlen);
#else
- (void *) &addrbuf, &addrlen
+ n = recvfrom(s->sock_fd, PyString_AS_STRING(buf), len, flags,
+ (void *) &addrbuf, &addrlen);
#endif
#else
- (struct sockaddr *) &addrbuf, &addrlen
+ n = recvfrom(s->sock_fd, PyString_AS_STRING(buf), len, flags,
+ (struct sockaddr *) &addrbuf, &addrlen);
#endif
- );
+ }
Py_END_ALLOW_THREADS
if (timeout) {