[pypy-svn] r46782 - pypy/dist/pypy/rlib

arigo at codespeak.net arigo at codespeak.net
Fri Sep 21 12:14:19 CEST 2007


Author: arigo
Date: Fri Sep 21 12:14:18 2007
New Revision: 46782

Modified:
   pypy/dist/pypy/rlib/_rsocket_rffi.py
Log:
Add the includes needed for the external functions.


Modified: pypy/dist/pypy/rlib/_rsocket_rffi.py
==============================================================================
--- pypy/dist/pypy/rlib/_rsocket_rffi.py	(original)
+++ pypy/dist/pypy/rlib/_rsocket_rffi.py	Fri Sep 21 12:14:18 2007
@@ -33,6 +33,7 @@
     COND_HEADER = ''.join(['#ifdef %s\n#include <%s>\n#endif\n' % cond_include
                           for cond_include in cond_includes])
 if _MS_WINDOWS:
+    includes = ('WinSock2.h', 'WS2tcpip.h')
     HEADER = '\n'.join([
         '#include <WinSock2.h>',
         '#include <WS2tcpip.h>',
@@ -376,8 +377,15 @@
 if MS_WINDOWS:
     fd_set = cConfig.fd_set
 
-#c_int_size = sizeof(rffi.INT)
-external = rffi.llexternal
+
+if _POSIX:
+    includes = list(includes)
+    for _name, _header in cond_includes:
+        if getattr(cConfig, _name) is not None:
+            includes.append(_header)
+
+def external(name, args, result):
+    return rffi.llexternal(name, args, result, includes=includes)
 
 if _POSIX:
     dup = external('dup', [socketfd_type], socketfd_type)



More information about the Pypy-commit mailing list