summaryrefslogtreecommitdiff
path: root/lib/sys_stat.in.h
diff options
context:
space:
mode:
authorYuuki Harano <masm+github@masm11.me>2020-12-27 03:13:00 +0900
committerYuuki Harano <masm+github@masm11.me>2020-12-27 03:13:00 +0900
commitb64089c37b4305a511e5ddbf02746862c7c7575e (patch)
treec6978d471e4b0b061b7cc9c46147968379aec94f /lib/sys_stat.in.h
parent565d8f57d349c19d9bbb5d5d5fdacf3c70b85d42 (diff)
parent4b2ca6bfc079c66cfcf39f2f36dc139012787535 (diff)
downloademacs-b64089c37b4305a511e5ddbf02746862c7c7575e.tar.gz
emacs-b64089c37b4305a511e5ddbf02746862c7c7575e.tar.bz2
emacs-b64089c37b4305a511e5ddbf02746862c7c7575e.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'lib/sys_stat.in.h')
-rw-r--r--lib/sys_stat.in.h32
1 files changed, 26 insertions, 6 deletions
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 3e0e4b27b7e..3ce2a0dcf15 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -375,11 +375,11 @@ struct stat
# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
#endif
-/* S_IXUGO is a common extension to POSIX. */
+/* Although S_IXUGO and S_IRWXUGO are not specified by POSIX and are
+ not implemented in GNU/Linux, some Gnulib-using apps use the macros. */
#if !S_IXUGO
# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
#endif
-
#ifndef S_IRWXUGO
# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
#endif
@@ -391,10 +391,20 @@ struct stat
#endif
+/* On native Windows, map 'chmod' to '_chmod', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::chmod always. */
#if defined _WIN32 && !defined __CYGWIN__
-# undef chmod
-# define chmod _chmod
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chmod
+# define chmod _chmod
+# endif
+/* Need to cast, because in mingw the last argument is 'int mode'. */
+_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode));
+#else
+_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode));
#endif
+_GL_CXXALIASWARN (chmod);
#if @GNULIB_FCHMODAT@
@@ -808,10 +818,20 @@ _GL_WARN_ON_USE (stat, "stat is unportable - "
#endif
+/* On native Windows, map 'umask' to '_umask', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::umask always. */
#if defined _WIN32 && !defined __CYGWIN__
-# undef umask
-# define umask _umask
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef umask
+# define umask _umask
+# endif
+/* Need to cast, because in mingw the last argument is 'int mode'. */
+_GL_CXXALIAS_MDA_CAST (umask, mode_t, (mode_t mask));
+#else
+_GL_CXXALIAS_SYS (umask, mode_t, (mode_t mask));
#endif
+_GL_CXXALIASWARN (umask);
#if @GNULIB_UTIMENSAT@