]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix "warning: implicit declaration of function 'open'/'read'/'close'".
authorBruno Haible <bruno@clisp.org>
Sun, 18 Oct 2020 11:42:41 +0000 (13:42 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 9 Oct 2022 07:30:42 +0000 (09:30 +0200)
* gettext-runtime/intl/loadmsgcat.c: Include <io.h>.
(open, read, close): New macros on native Windows.

gettext-runtime/intl/loadmsgcat.c

index 016fe575ea51447154953b7f852e4e964dd6f70d..d5a5fe171e739f02f6309ef918c052d70be2ee52 100644 (file)
@@ -60,6 +60,8 @@ char *alloca ();
 
 #if defined HAVE_UNISTD_H || defined _LIBC
 # include <unistd.h>
+#elif defined _WIN32 && !defined __CYGWIN__
+# include <io.h>
 #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