File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
#ifdef _WIN32
4
4
#include <winsock2.h>
5
+ #include <ws2tcpip.h>
5
6
typedef SOCKET Socket ;
6
7
#define sa_family_t unsigned int
7
8
#else
17
18
#define snprintf _snprintf
18
19
#endif
19
20
20
- /* Assuemd maximum packet size. If ever changing this to something beyond a
21
+ /* Assumed maximum packet size. If ever changing this to something beyond a
21
22
* 16-bit number, then make sure to change the receive offsets in the data
22
23
* structure below. */
23
24
#define PACKET_SIZE 65535
24
25
25
26
/* Error handling varies between POSIX and WinSock. */
27
+ MVM_NO_RETURN static void throw_error (MVMThreadContext * tc , int r , char * operation ) MVM_NO_RETURN_GCC ;
26
28
#ifdef _WIN32
27
29
#define MVM_IS_SOCKET_ERROR (x ) ((x ) == SOCKET_ERROR )
28
30
static void throw_error (MVMThreadContext * tc , int r , char * operation ) {
@@ -402,7 +404,8 @@ MVMint64 socket_getport(MVMThreadContext *tc, MVMOSHandle *h) {
402
404
MVMIOSyncSocketData * data = (MVMIOSyncSocketData * )h -> body .data ;
403
405
404
406
struct sockaddr_storage name ;
405
- int error , len = sizeof (struct sockaddr_storage );
407
+ int error ;
408
+ socklen_t len = sizeof (struct sockaddr_storage );
406
409
MVMint64 port = 0 ;
407
410
408
411
error = getsockname (data -> handle , (struct sockaddr * ) & name , & len );
You can’t perform that action at this time.
0 commit comments