bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH]: Fix poll module under Win32


From: Bruno Haible
Subject: Re: [PATCH]: Fix poll module under Win32
Date: Tue, 16 Jan 2007 12:44:34 +0100 (MET)
User-agent: KMail/1.5.4

Yoann Vandoorselaere wrote:
> - gnulib-poll-depend.diff:
> Add a dependencies on the sys_select module, fixing inclusion error
> under MinGW.

Looks OK.

> - gnulib-sys_socket-error.diff: 
> Under MinGW, map error code required by the poll module (namely
> ESHUTDOWN, ECONNRESET, ECONNABORTED, ENETRESET, ENOTCONN), plus some
> other useful error code.

The conditional should be
  #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
rather than
  #if defined _WIN32 || defined __WIN32__
because the users of <sys/socket.h> use functions which, under Cygwin,
come from cygwin.dll, rather than from the native Woe32 DLLs.

Background: On Cygwin, a user can choose (through a gcc command line option)
to define _WIN32 in order to indicate that he wants to use native Woe32
APIs in addition to the cygwin.dll APIs that emulate POSIX. Therefore in
source code which uses Woe32 API functions, we use
  #if defined _WIN32 || defined __WIN32__
But to distinguish API that operates differently under Mingw than under
Unix (including Cygwin), we use
  #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]