Re: GNULib Module nanosleep Breaks CVS Build On Windows

Jim Meyering <[email protected]> Wed, 12 May 2004 20:25:22 +0200
Newsgroups gmane.comp.lib.gnulib.bugs,gmane.comp.version-control.cvs.bugs
Message-ID <[email protected]>
Hi Conrad,

"Conrad T. Pino" <[email protected]> wrote:
>> Regarding getting declarations for select into nanosleep.c for WOE,
>> the proper (POSIX) way would be to include <sys/select.h>.
>> Would that work on your system?
>
> Unfortunately Windows 2000 and Visual Studio C++ 6.0 don't provide
> a "select.h" header file.

Is Visual Studio C++ 6.0 an important (by some measure)
development platform?  Isn't there a more-nearly POSIX-conforming
development environment that you can use?  I hate to spend time
worrying about systems that don't even come close to providing
POSIX conformance.

In any case, I hope we can do something cleaner than including
<winsock.h>.  If I were to change nanosleep.c to do this:

#if HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif

your system could get by with a definition like this in config.h

#define HAVE_SYS_SELECT_H 1

and then a package-supplied sys/select.h file containing the
required declarations in a directory searched by the compiler,
specified via `-I dir' or whatever the equivalent is.

That approach is more in line with the goal of keeping the
code from becoming encumbered with hacks designed solely to
accommodate non-conforming systems.

Jim