ioctl on mingw

2010-04-04 Thread Bruno Haible
Similarly, I get this error on mingw in C++ mode: ../gllib/sys/ioctl.h:318: error: `ioctl' was not declared in this scope and, once this is fixed: g++-3 -mno-cygwin-L/usr/local/mingw/lib -o test-sys_ioctl-c++.exe test-sys_ioctl-c++.o ../gllib/libgnu.a ../gllib/libgnu.a(ioctl.o): I

measuring elapsed time on mingw

2010-04-04 Thread Bruno Haible
Hi, Just a side note about how to measure elapsed time on mingw. (I needed this in order to evaluate how to implement nanosleep on mingw.) Summary: - GetSystemTimeAsFileTime, _ftime, gettimeofday (from newer mingw runtimes) all have about 15.6 ms resolution. - QueryPerformanceCounter [1]

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.

tmpfile on mingw

2010-04-04 Thread Bruno Haible
On mingw, one of the unit tests suggested by John Eaton fails: g++-3 -mno-cygwin -DHAVE_CONFIG_H -I. -I. -I. -I.. -I./.. -I../gllib -I./../gllib -I/usr/local/mingw/include -Wall -MT test-stdio-c++2.o -MD -MP -MF .deps/test-stdio-c++2.Tpo -c -o test-stdio-c++2.o test-stdio-c++2.cc In file

Re: tmpfile on mingw

2010-04-04 Thread Bruno Haible
Additionally, tmpfile is just one function, so let's use the common macro naming scheme (cf. 2010-03-27 commits). 2010-04-04 Bruno Haible * m4/tmpfile.m4 (gl_FUNC_TMPFILE): Renamed from gl_TMPFILE. * modules/tmpfile (configure.ac): Update. --- m4/tmpfile.m4.orig Sun Apr 4 1

rmdir: simplify test

2010-04-04 Thread Bruno Haible
Hi, The rmdir module does not satisfy the common idiom (distinguish missing and broken function). But this part is already marked as "simplify this module in 2010 if no one reports a missing rmdir" Did someone report a missing rmdir? Or can we remove this part of the autoconf test? Here's the

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

ceill, floorl, roundl, truncl on Cygwin

2010-04-04 Thread Bruno Haible
On Cygwin 1.7.2, the C++ tests fail for ceill, floorl, roundl, truncl: ../gllib/math.h:478: error: 'ceill' was not declared in this scope ../gllib/math.h:478: error: invalid type in declaration before ';' token ../gllib/math.h:556: error: 'floorl' was not declared in this scope ../gllib/ma

trunc, truncf on Solaris

2010-04-04 Thread Bruno Haible
On Solaris 8, I'm seeing these errors: ../gllib/math.h:816: error: 'truncf' was not declared in this scope ../gllib/math.h:835: error: 'trunc' was not declared in this scope This fixes it, by using the simpler idiom for a missing function. 2010-04-04 Bruno Haible math: Fix some

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

cosl, sinl, logl on Solaris, Cygwin

2010-04-04 Thread Bruno Haible
On Cygwin 1.7.2 and Solaris 8, I'm seeing these errors: ../gllib/math.h:526: error: 'cosl' was not declared in this scope ../gllib/math.h:672: error: 'logl' was not declared in this scope ../gllib/math.h:766: error: 'sinl' was not declared in this scope There is no reason to define rpl_cosl

Re: tmpfile on mingw

2010-04-04 Thread Ben Pfaff
Bruno Haible writes: > The reason is that does a > > using ::tmpfile; > > but gnulib has renamed that function to rpl_tmpfile, already before the system > headers were included. This fixes it: I'm happy with these patches. -- Ben Pfaff http://benpfaff.org

[Patch] stdio-impl.h has too indiscriminate #ifdef

2010-04-04 Thread Hauke Fath
Hi, I am seeing a build failure of Gnu m4 on NetBSD 1.5 [...] source='freadahead.c' object='freadahead.o' libtool=no DEPDIR=.deps depmode=gcc /bin/sh ../build-aux/depcomp cc -I. - O2 -pipe -c freadahead.c freadahead.c: In function `freadahead': freadahead.c:41: structure has no member nam

frexpl on Solaris, Cygwin

2010-04-04 Thread Bruno Haible
On Solaris 8 and Cygwin 1.7.2 I'm seeing this error: ../gllib/math.h:620: error: 'frexpl' was not declared in this scope Again, the problem is that REPLACE_FREXPL is set when the function does not exist. This fixes it. 2010-04-04 Bruno Haible frexpl: Fix a C++ test error on Solari

vfprintf on Solaris

2010-04-04 Thread Bruno Haible
On Solaris 8, with GCC 4.3.3, I'm seeing these errors in the C++ tests: g++ -DHAVE_CONFIG_H -I. -I. -I. -I.. -I./.. -I../gllib -I./../gllib -I/home/haible/prefix-x86/include -Wall -MT test-stdio-c++.o -MD -MP -MF .deps/test-stdio-c++.Tpo -c -o test-stdio-c++.o test-stdio-c++.cc In file

Re: [Patch] stdio-impl.h has too indiscriminate #ifdef

2010-04-04 Thread Bruno Haible
Hi, Hauke Fath wrote: > -# if defined __NetBSD__ || defined __OpenBSD__ /* NetBSD, OpenBSD */ > +# if (defined __NetBSD__ && __NetBSD__ >= 10527) || defined __OpenBSD__ > /* NetBSD, OpenBSD */ The introduction of the '_ext' field happened in NetBSD on 2001-12-07, according to

strerror: Update documentation

2010-04-04 Thread Bruno Haible
The idiom used to declare strerror() in lib/string.in.h does not cope with the case of a missing strerror function (at least not in C++ mode). But such platforms are likely older than 1998. Therefore I don't think they are relevant any more. 2010-04-04 Bruno Haible strerror: Update do

strtod: Avoid a possible C++ test error

2010-04-04 Thread Bruno Haible
On platforms where strtod() does not exist, the C++ tests would fail with g++ >= 4.3, because REPLACE_STRTOD would be set in this case. This supposedly fixes it. 2010-04-04 Bruno Haible strtod: Avoid a possible C++ test error. * m4/strtod.m4 (gl_FUNC_STRTOD): When setting HAVE

Re: [Patch] stdio-impl.h has too indiscriminate #ifdef

2010-04-04 Thread Hauke Fath
At 21:57 Uhr +0100 4.4.2010, Bruno Haible wrote: >Hi, > >Hauke Fath wrote: >> -# if defined __NetBSD__ || defined __OpenBSD__ /* NetBSD, OpenBSD */ >> +# if (defined __NetBSD__ && __NetBSD__ >= 10527) || defined >>__OpenBSD__ /* NetBSD, OpenBSD */ > >The introduction of the '_ext' field happene

Re: [Patch] stdio-impl.h has too indiscriminate #ifdef

2010-04-04 Thread Bruno Haible
Hi Hauke, > -- it should actually be > > if (defined __NetBSD__ && __NetBSD_Version__ >= 10527) > > where __NetBSD_Version__ is defined in , in the kernel source > tree at src/sys/sys/param.h. > > The relevant version bump of this file is >

Re: Zile build breaks in lib/btow.c on NetBSD 1.5

2010-04-04 Thread Bruno Haible
Hi, Hauke Fath wrote: > and this NetBSD version's does not #define WEOF. > > > btowc.c:37: `WEOF' undeclared (first use in this function) > btowc.c:37: (Each undeclared identifier is reported only once > btowc.c:37: for each function it appears in.) > btowc.c:38: warning: control reaches end of

Re: Zile build breaks in lib/btow.c on NetBSD 1.5

2010-04-04 Thread Bruno Haible
Hi, Hauke Fath wrote: > misses #including for the definition of mbtowc() alike to the > BSD/OS case, > > > btowc.c: In function `btowc': > btowc.c:34: warning: implicit declaration of function `mbtowc' To fix this warning, you need a #include in btowc.c. I don't see a reason to include it in