From: Bruno Haible Date: Sun, 18 Oct 2020 11:42:41 +0000 (+0200) Subject: Fix "warning: implicit declaration of function 'open'/'read'/'close'". X-Git-Tag: v0.22~302 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a46ff88c19dc4a65db82b31c46eb9ae1e8e1f6d8;p=thirdparty%2Fgettext.git Fix "warning: implicit declaration of function 'open'/'read'/'close'". * gettext-runtime/intl/loadmsgcat.c: Include . (open, read, close): New macros on native Windows. --- 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