From b80b3ce4b3fe0ce3bfc4ee56e039a0201522dff2 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 28 Oct 2008 17:47:23 +0000 Subject: [PATCH] socketcompat.h: simplify, to match latest gnulib Now, sys/socket.h is always available, and errno works. --- ChangeLog | 5 +++++ src/socketcompat.h | 29 +++++------------------------ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22544a6639..1eac500a38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Oct 28 12:12:41 +0100 2008 Jim Meyering + + socketcompat.h: simplify, to match latest gnulib + Now, sys/socket.h is always available, and errno works. + Tue Oct 28 12:07:46 +0100 2008 Jim Meyering updates from gnulib diff --git a/src/socketcompat.h b/src/socketcompat.h index 51235f66be..a06fe36514 100644 --- a/src/socketcompat.h +++ b/src/socketcompat.h @@ -24,14 +24,7 @@ #include #include - -#ifndef HAVE_WINSOCK2_H /* Unix & Cygwin. */ - #include -#include -#include -#include -#include static inline int socket_errno (void) @@ -39,23 +32,11 @@ socket_errno (void) return errno; } -#else /* MinGW & Win32 */ - -#include - -/* Socket functions in Windows don't set errno. Instead of using errno - * to test for socket errors, call this function to get the errno. - */ -static inline int -socket_errno (void) -{ - return WSAGetLastError (); -} - -/* Compatibility. */ -#define EWOULDBLOCK WSAEWOULDBLOCK -#define ECONNREFUSED WSAECONNREFUSED - +#ifndef HAVE_WINSOCK2_H /* Unix & Cygwin. */ +# include +# include +# include +# include #endif /* HAVE_WINSOCK2_H */ #endif /* __WINSOCKWRAPPER_H__ */