From f378d9bc38be5257ad54a74618f90f6a7fcefb8a Mon Sep 17 00:00:00 2001 From: manojampalam Date: Wed, 2 Mar 2016 21:31:33 -0800 Subject: [PATCH] Undoing wrong changes to socket.h --- .../win32/win32compat/includes/sys/socket.h | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/contrib/win32/win32compat/includes/sys/socket.h b/contrib/win32/win32compat/includes/sys/socket.h index 87d6783..8d54a60 100644 --- a/contrib/win32/win32compat/includes/sys/socket.h +++ b/contrib/win32/win32compat/includes/sys/socket.h @@ -48,16 +48,34 @@ void allocate_standard_descriptor(int fd); /* Redirect callers of socket functions to use our indirection functions */ - +#if NEED_FUNC_MACROS +#define isatty(sfd) WSHELPisatty(sfd) +#define fstat(sfd, buf) WSHELPfstat(sfd, buf) +#define fdopen(sfd, mode) WSHELPfdopen(sfd, mode) +#define pipe(pfds) WSHELPpipe(pfds) +#define dup(oldfd) WSHELPdup(oldfd) +#define socket(af, type, protocol) WSHELPsocket(af, type, protocol) +#define setsockopt(sfd, level, optname, optval, optlen) WSHELPsetsockopt(sfd, level, optname, optval, optlen) +#define getsockopt(sfd, level, optname, optval, optlen) WSHELPgetsockopt(sfd, level, optname, optval, optlen) +#define getsockname(sfd, name, namelen) WSHELPgetsockname(sfd, name, namelen) +#define getpeername(sfd, name, namelen) WSHELPgetpeername(sfd, name, namelen) +#define ioctlsocket(sfd, cmd, argp) WSHELPioctlsocket(sfd, cmd, argp) +#define listen(sfd, backlog) WSHELPlisten(sfd, backlog) +#define bind(sfd, name, namelen) WSHELPbind(sfd, name, namelen) +#define connect(sfd, name, namelen) WSHELPconnect(sfd, name, namelen) +#define shutdown(sfd, how) WSHELPshutdown(sfd, how) +#define accept(sfd, addr, addrlen) WSHELPaccept(sfd, addr, addrlen) +#define select(sfds, readsfds, writesfds, exceptsfds, timeout) WSHELPselect(sfds, readsfds, writesfds, exceptsfds, timeout) +#else /* NEED_FUNC_MACROS */ //#define isatty WSHELPisatty -#define fstat _WSHELPfstat +#define fstat WSHELPfstat #define fdopen WSHELPfdopen -#define pipe _WSHELPpipe +#define pipe WSHELPpipe #define socket WSHELPsocket #define dup WSHELPdup #define dup2 WSHELPdup2 #define open WSHELPopen -#define creat _WSHELPcreat +#define creat WSHELPcreat #define setsockopt WSHELPsetsockopt #define getsockopt WSHELPgetsockopt #define getsockname WSHELPgetsockname @@ -69,7 +87,7 @@ void allocate_standard_descriptor(int fd); #define shutdown WSHELPshutdown #define accept WSHELPaccept #define select WSHELPselect -//#endif /* NEED_FUNC_MACROS */ +#endif /* NEED_FUNC_MACROS */ /* Declare new functions */ int socketpair(int socks[2]);