fnmatch: rely on more gnulib modules

2020-05-29 Thread Bruno Haible
The 'fnmatch' module currently tests for wmemcpy() differently than wmemcpy.m4 does. It also lacks the workarounds from the 'btowc' and 'iswctype' modules. Therefore here is a proposed patch to let this module use more from gnulib. Accordingly, the code becomes simpler. Paul, is this OK from the

wmemchr, wmemcmp, wmemcpy, wmemmove, wmemset: Fix autoconf test

2020-05-29 Thread Bruno Haible
On IRIX 6.5, with cc, I'm seeing a compilation error: cc -n32 -DHAVE_CONFIG_H -I. -I.. -DGNULIB_STRICT_CHECKING=1 -I/u/guest/bruno/prefix-n32-cc/include -g -c -o wcsdup.o wcsdup.c cc-1119 cc: ERROR File = wcsdup-impl.h, Line = 24 The "return" expression type differs from the function return

Re: [PATCH] gettimeofday: do not use LoadLibrary when built for Windows Store apps

2020-05-29 Thread Bruno Haible
Daiki Ueno wrote: > this change seems to > break MinGW cross build, because GetFinalPathNameByHandleFunc is defined > only if !(_WIN32_WINNT >= _WIN32_WINNT_VISTA), but referred to from > _gl_convert_FILETIME_to_timespec without the guard: Oops, indeed. With the appropriate _WIN32_WINNT setting,

Re: [PATCH] gettimeofday: do not use LoadLibrary when built for Windows Store apps

2020-05-29 Thread Steve Lhomme
On 2020-05-29 2:04, Bruno Haible wrote: Hi, Steve Lhomme wrote: LoadLibrary is forbidden in such apps (can only load DLLs from within the app package). The API entries are available to all apps linking with the Windows API as found here:

Re: portability of fopen and 'e' (O_CLOEXEC) flag

2020-05-29 Thread Bruno Haible
Daiki Ueno wrote: > Afterwards, I realized a > compilation error in the test code on FreeBSD, so I've added the > follow-up patch attached. Indeed, octal and hexadecimal escape sequences are not limited to 3 or 2 digits. ISO C 11 section 6.4.4.4 says: "The hexadecimal digits that follow the

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-29 Thread Bruno Haible
Hi Daiki, > On a different note, it was suggested to disable stdio buffering if > RF_SENSITIVE is set. I am attaching a patch for this. Reading from a regular file in an unbuffered way can be terribly slow. But here, fread_file reads in large chunks, therefore it's OK. Also, in the

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-29 Thread Daiki Ueno
Bruno Haible writes: >> On a different note, it was suggested to disable stdio buffering if >> RF_SENSITIVE is set. I am attaching a patch for this. > > Reading from a regular file in an unbuffered way can be terribly slow. > But here, fread_file reads in large chunks, therefore it's OK. > >

Re: fnmatch: rely on more gnulib modules

2020-05-29 Thread Bruno Haible
> > Paul, is this OK from the perspective of a future merge with glibc? > > Yes, it's an improvement in that department; thanks. OK. I've pushed it. Bruno

do not use GetModuleHandle when built for Windows Store apps

2020-05-29 Thread Bruno Haible
GetModuleHandle is like LoadLibrary: it is used for dynamic lookup of Windows API functions. And Windows Store apps can't use it. This patch fixes some of the issues. The other ones, in poll.c and select.c, are harder to fix, because it's not easy to link directly against ntdll.dll [1]. [1]

gnulib-tool: Fix link errors with a particular set of modules on mingw

2020-05-29 Thread Bruno Haible
A testdir created by this command: ./gnulib-tool --create-testdir --dir=../testdir --single-configure clean-temp crypto/gc getaddrinfo getlogin getlogin_r gettimeofday isatty link localename opendir physmem poll putenv read readdir relocatable-prog rename rewinddir select sethostname socket

Re: fnmatch: rely on more gnulib modules

2020-05-29 Thread Paul Eggert
On 5/29/20 5:02 AM, Bruno Haible wrote: > Paul, is this OK from the perspective of a future merge with glibc? Yes, it's an improvement in that department; thanks.