From a46ff88c19dc4a65db82b31c46eb9ae1e8e1f6d8 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 18 Oct 2020 13:42:41 +0200 Subject: [PATCH] Fix "warning: implicit declaration of function 'open'/'read'/'close'". * gettext-runtime/intl/loadmsgcat.c: Include . (open, read, close): New macros on native Windows. --- gettext-runtime/intl/loadmsgcat.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gettext-runtime/intl/loadmsgcat.c b/gettext-runtime/intl/loadmsgcat.c index 016fe575e..d5a5fe171 100644 --- a/gettext-runtime/intl/loadmsgcat.c +++ b/gettext-runtime/intl/loadmsgcat.c @@ -60,6 +60,8 @@ char *alloca (); #if defined HAVE_UNISTD_H || defined _LIBC # include +#elif defined _WIN32 && !defined __CYGWIN__ +# include #endif #ifdef _LIBC @@ -386,6 +388,11 @@ char *alloca (); # define mmap(addr, len, prot, flags, fd, offset) \ __mmap (addr, len, prot, flags, fd, offset) # define munmap(addr, len) __munmap (addr, len) +#elif defined _WIN32 && !defined __CYGWIN__ +/* On native Windows, don't require linking with '-loldnames'. */ +# define open _open +# define read _read +# define close _close #endif /* For those losing systems which don't have `alloca' we have to add -- 2.47.3