On Tue, 4 Apr 2000, Patrik Stridvall wrote:
[...]
> > Another related question is winsock.h . Some of the standard socket
> > functions have different arguments than their unix counterparts
> > (eg. getpeername()'s 3rd arg is socklen_t * in unix and int * in
> > Windows). At the moment winsock.h includes the unix headers at the
> > top which means that these prototypes don't match the Windows ones.
> > Should winsock.h be rewritten to not include these headers?
This question can potentially be extended to all the C headers:
Should we rewrite all C headers to be standalone and not include the
unix headers?
This would be a lot of work and I think it is unnecessary. I prefer
to try to add and remove things to/from them like Patrick proposed.
To go back to getpeername's situation we could use the following ugly hack:
#define getpeername(a,b,c) __not_to_be_used_getpeername(a,b,c)
#include <sys/socket.h>
extern int getpeername(SOCKET __fd, struct sockaddr* __addr, int* __len);
Note that getpeername's case is quite strange because although the
headers use 'socklen_t*', 'man getpeername' says that the third
parameter is an 'int*' (of course it's the same thing anyway)!
[...]
The rest snipped off because a lot has happened since.
--
Francois Gouget [EMAIL PROTECTED] http://fgouget.free.fr/
It really galls me that most of the computer power in the world
is wasted on screen savers.
Chris Caldwell from the GIMPS project
http://www.mersenne.org/prime.htm