… | |
… | |
36 | * provisions above, a recipient may use your version of this file under |
36 | * provisions above, a recipient may use your version of this file under |
37 | * either the BSD or the GPL. |
37 | * either the BSD or the GPL. |
38 | */ |
38 | */ |
39 | |
39 | |
40 | #ifdef _WIN32 |
40 | #ifdef _WIN32 |
41 | |
|
|
42 | /* timeb.h is actually xsi legacy functionality */ |
|
|
43 | #include <sys/timeb.h> |
|
|
44 | |
41 | |
45 | /* note: the comment below could not be substantiated, but what would I care */ |
42 | /* note: the comment below could not be substantiated, but what would I care */ |
46 | /* MSDN says this is required to handle SIGFPE */ |
43 | /* MSDN says this is required to handle SIGFPE */ |
47 | /* my wild guess would be that using something floating-pointy is required */ |
44 | /* my wild guess would be that using something floating-pointy is required */ |
48 | /* for the crt to do something about it */ |
45 | /* for the crt to do something about it */ |
… | |
… | |
89 | goto fail; |
86 | goto fail; |
90 | |
87 | |
91 | if (connect (sock [0], (struct sockaddr *)&addr, addr_size)) |
88 | if (connect (sock [0], (struct sockaddr *)&addr, addr_size)) |
92 | goto fail; |
89 | goto fail; |
93 | |
90 | |
|
|
91 | /* TODO: returns INVALID_SOCKET on winsock accept, not < 0. fix it */ |
|
|
92 | /* when convenient, probably by just removing error checking altogether? */ |
94 | if ((sock [1] = accept (listener, 0, 0)) < 0) |
93 | if ((sock [1] = accept (listener, 0, 0)) < 0) |
95 | goto fail; |
94 | goto fail; |
96 | |
95 | |
97 | /* windows vista returns fantasy port numbers for sockets: |
96 | /* windows vista returns fantasy port numbers for sockets: |
98 | * example for two interconnected tcp sockets: |
97 | * example for two interconnected tcp sockets: |