Martin Lambers <[EMAIL PROTECTED]> writes:

> Hi,
>
> I get the following error when using the nanosleep module and
> crosscompiling to W32 with the Debian mingw32 package and 
> ./configure --host=i586-mingw32msvc :
>
> ../gnulib/libgnu.a(nanosleep.o):nanosleep.c:(.text+0x64): undefined reference 
> to `_select'
>
> The attached patch fixes this for me.

Wouldn't this be a good situation to have nanosleep depend on the
unistd module, and make the replacement unistd.h include winsock2.h on
mingw32 platforms?  After all, nanosleep.c include unistd.h, and
unistd.h define select on some platforms.

> --- gnulib/lib/nanosleep.c.orig 2005-09-23 06:15:13.000000000 +0200
> +++ gnulib/lib/nanosleep.c  2006-05-18 21:45:44.000000000 +0200
> @@ -25,6 +25,10 @@
>     prototype for rpl_nanosleep. (they'd conflict e.g., on alpha-dec-osf3.2)  
> */
>  #undef nanosleep
>
> +#ifdef _WIN32
> +#include <winsock2.h>
> +#endif
> +
>  #include <stdbool.h>
>  #include <stdio.h>
>  #include <sys/types.h>


Reply via email to