stoneCC / serf

Automatically exported from code.google.com/p/serf
Apache License 2.0
0 stars 0 forks source link

patch to compile serf for NetWare #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
NetWare platform defines accept() and connect() as macros in their Winsock2 
header novsock2.h [1]:
/* BSD sockets clashes that can be maped directly to WSA calls */
#define connect(s,name,namelen) WSAConnect(s,name,namelen, 0,0,0,0)
#define accept(s,addr,addrlen)  WSAAccept(s,addr,addrlen,0,0)

this clashes with the struct serf_listener_t member accept;
then compilation breaks in incoming.c:

incoming.c:78:53: macro "accept" passed 5 arguments, but takes just 3
incoming.c: In function `serf__process_listener':
incoming.c:78: warning: assignment makes integer from pointer without a cast

I guess what happens is that the preprocessor just sees 
'accept(a,b,c,whoops?,morewhoops?)' and breaks ...

attached fix against current svn trunk which renames the struct member fixes 
the problem.

[1] http://svwe20.itex.at/ndk/libc/include/winsock/novsock2.h

Original issue reported on code.google.com by 0x1...@googlemail.com on 23 Mar 2011 at 9:29

Attachments:

GoogleCodeExporter commented 9 years ago
Can't test this patch, but since it's harmless for the other platforms I've 
committed it in r1484.

Thanks!

Original comment by lieven.govaerts@gmail.com on 16 Jun 2011 at 7:57