Re: nanosleep on mingw

2010-04-04 Thread Bruno Haible
Jim Meyering wrote: > You're welcome to commit that. Committed. The only thing I'm worried about is that it's a compromise between precision of the time interval and ues of CPU time: Someone who invokes nanosleep with an argument of 0.3 seconds may complain that 9.4 ms of busy-looping is not accep

Re: nanosleep on mingw

2010-04-04 Thread Jim Meyering
Bruno Haible wrote: ... > So here is a proposed patch for implementing a Woe32 nanosleep with a > resolution of ca. 10 microseconds or higher. > > 2010-04-04 Bruno Haible > > Implement nanosleep for native Windows. > * lib/nanosleep.c (nanosleep): New implementation for native Window

Re: nanosleep on mingw

2010-04-04 Thread Bruno Haible
The current implementation of nanosleep is broken on mingw for several reasons: 1) It requires linking with -lws2_32, as evidenced by these error messages: gcc-3 -mno-cygwin -g -O2 -L/usr/local/mingw/lib -o test-nanosleep.exe test-nanosleep.o ../gllib/libgnu.a ../gllib/libgnu.a(select.

Re: nanosleep on mingw

2010-04-03 Thread Bruno Haible
Hi Jim, > Though note that the patches to modules/time and m4/time_h.m4 > did not apply and I did them manually. Yes, I was constantly changing the same parts of these two files. > Please apply. Applied. Bruno

Re: nanosleep on mingw

2010-04-03 Thread Jim Meyering
Bruno Haible wrote: > Similarly, on mingw with warn-on-use.h modified to work like if g++ >= 4.3 > were present, I'm seeing this error: > > ../gllib/time.h:359: error: `nanosleep' was not declared in this scope > > It would also be an error on the other platforms lacking nanosleep, > with g++ 4.3