[pypy-dev] test_rpoll.py::test_translate with MinGW32

bookaa rorsoft at gmail.com
Mon May 28 17:04:18 CEST 2012


with
    set cc=mingw32-gcc
this test fail:
    pytest.py pypy/rlib/test/test_rpoll.py::test_translate
this is how to patch:

diff -crN pypy-pypy-4a38b43757e3/pypy/rlib/_rsocket_rffi.py 
pypy-pypy-4a38b43757e3.bookaa/pypy/rlib/_rsocket_rffi.py
*** pypy-pypy-4a38b43757e3/pypy/rlib/_rsocket_rffi.py Tue May 22 14:03:20 
2012
--- pypy-pypy-4a38b43757e3.bookaa/pypy/rlib/_rsocket_rffi.py Mon May 28 
22:00:03 2012
***************
*** 58,69 ****
      header_lines = [
          '#include <WinSock2.h>',
          '#include <WS2tcpip.h>',
-         '#include <Mstcpip.h>',
          # winsock2 defines AF_UNIX, but not sockaddr_un
          '#undef AF_UNIX',
          ]
      if _MSVC:
          header_lines.extend([
              # these types do not exist on microsoft compilers
              'typedef int ssize_t;',
              'typedef unsigned __int16 uint16_t;',
--- 58,69 ----
      header_lines = [
          '#include <WinSock2.h>',
          '#include <WS2tcpip.h>',
          # winsock2 defines AF_UNIX, but not sockaddr_un
          '#undef AF_UNIX',
          ]
      if _MSVC:
          header_lines.extend([
+             '#include <Mstcpip.h>',
              # these types do not exist on microsoft compilers
              'typedef int ssize_t;',
              'typedef unsigned __int16 uint16_t;',
***************
*** 71,77 ****
              ])
      else: # MINGW
          includes = ('stdint.h',)
!         """
          header_lines.extend([
              '''\
              #ifndef _WIN32_WINNT
--- 71,77 ----
              ])
      else: # MINGW
          includes = ('stdint.h',)
!
          header_lines.extend([
              '''\
              #ifndef _WIN32_WINNT
***************
*** 89,95 ****
                  u_long  keepaliveinterval;
              };'''
              ])
!         """
      HEADER = '\n'.join(header_lines)
      COND_HEADER = ''
  constants = {}
--- 89,95 ----
                  u_long  keepaliveinterval;
              };'''
              ])
!
      HEADER = '\n'.join(header_lines)
      COND_HEADER = ''
  constants = {}
diff -crN pypy-pypy-4a38b43757e3/pypy/rpython/tool/rfficache.py 
pypy-pypy-4a38b43757e3.bookaa/pypy/rpython/tool/rfficache.py
*** pypy-pypy-4a38b43757e3/pypy/rpython/tool/rfficache.py Tue May 22 
14:03:20 2012
--- pypy-pypy-4a38b43757e3.bookaa/pypy/rpython/tool/rfficache.py Mon May 28 
21:58:02 2012
***************
*** 13,19 ****
  from pypy.tool.gcc_cache import build_executable_cache

  def ask_gcc(question, add_source=""):
!     includes = ['stdlib.h', 'stdio.h', 'sys/types.h']
      if os.name != 'nt':
          includes += ['inttypes.h']
      include_string = "\n".join(["#include 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bookaa28.dif
Type: application/octet-stream
Size: 6069 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120528/0af4a59e/attachment.obj>


More information about the pypy-dev mailing list