changeset 40106:a15f73f2ba12

sys_stat: Fix 'implicit declaration of function' warning on OS/2 kLIBC. * lib/sys_stat.in.h [kLIBC]: Include <unistd.h>.
author KO Myung-Hun <komh78@gmail.com>
date Thu, 17 Jan 2019 19:40:26 +0100
parents ed6a8b3113de
children 367366e0baa0
files ChangeLog lib/sys_stat.in.h
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jan 17 19:32:20 2019 +0100
+++ b/ChangeLog	Thu Jan 17 19:40:26 2019 +0100
@@ -1,3 +1,8 @@
+2019-01-17  KO Myung-Hun  <komh78@gmail.com>
+
+	sys_stat: Fix 'implicit declaration of function' warning on OS/2 kLIBC.
+	* lib/sys_stat.in.h [kLIBC]: Include <unistd.h>.
+
 2019-01-17  KO Myung-Hun  <komh78@gmail.com>
 
 	fcntl: Fix syntax error (regression from 2018-10-05).
--- a/lib/sys_stat.in.h	Thu Jan 17 19:32:20 2019 +0100
+++ b/lib/sys_stat.in.h	Thu Jan 17 19:40:26 2019 +0100
@@ -54,9 +54,16 @@
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
+/* Before doing "#define mknod rpl_mknod" below, we need to include all
+   headers that may declare mknod().  OS/2 kLIBC declares mknod() in
+   <unistd.h>, not in <sys/stat.h>.  */
+#ifdef __KLIBC__
+# include <unistd.h>
+#endif
+
 /* Before doing "#define mkdir rpl_mkdir" below, we need to include all
    headers that may declare mkdir().  Native Windows platforms declare mkdir
-   in <io.h> and/or <direct.h>, not in <unistd.h>.  */
+   in <io.h> and/or <direct.h>, not in <sys/stat.h>.  */
 #if defined _WIN32 && ! defined __CYGWIN__
 # include <io.h>     /* mingw32, mingw64 */
 # include <direct.h> /* mingw64, MSVC 9 */