Commit 23d27c61 authored by Matti Picus's avatar Matti Picus
Browse files

properly define ssize_t and recv() for win64 in _rsocket_ffi

--HG--
branch : py3.7
parent f901c8d0dcd9
Pipeline #21549 passed with stage
in 8 minutes and 38 seconds
......@@ -65,7 +65,13 @@ if _WIN32:
header_lines.extend([
'#include <Mstcpip.h>',
# these types do not exist on microsoft compilers
'#ifdef _WIN64',
'typedef long long ssize_t;',
'typedef unsigned long long size_t;',
'#else',
'typedef int ssize_t;',
'typedef unsigned int size_t;',
'#endif',
'typedef unsigned __int16 uint16_t;',
'typedef unsigned __int32 uint32_t;',
])
......@@ -1242,8 +1248,12 @@ socketgetsockopt = external('getsockopt', [socketfd_type, rffi.INT,
socketsetsockopt = external('setsockopt', [socketfd_type, rffi.INT,
rffi.INT, rffi.VOIDP, socklen_t], rffi.INT,
save_err=SAVE_ERR)
socketrecv = external('recv', [socketfd_type, rffi.VOIDP, rffi.INT,
rffi.INT], ssize_t, save_err=SAVE_ERR)
if WIN32:
socketrecv = external('recv', [socketfd_type, rffi.VOIDP, rffi.INT,
rffi.INT], rffi.INT, save_err=SAVE_ERR)
else:
socketrecv = external('recv', [socketfd_type, rffi.VOIDP, rffi.INT,
rffi.INT], ssize_t, save_err=SAVE_ERR)
recvfrom = external('recvfrom', [socketfd_type, rffi.VOIDP, size_t,
rffi.INT, sockaddr_ptr, socklen_t_ptr], rffi.INT,
save_err=SAVE_ERR)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment