aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sys_stat.in.h
diff options
context:
space:
mode:
authorPaul Eggert2021-01-01 01:51:18 -0800
committerPaul Eggert2021-01-01 01:52:03 -0800
commit1b59478f4cf442f5201500b0a9c66f4332fce640 (patch)
tree02787d99a0476a28836390ee9e2ff332445381a1 /lib/sys_stat.in.h
parent50f3949119cd5bb2f058b90d14b2940a3a8a7a0e (diff)
downloademacs-1b59478f4cf442f5201500b0a9c66f4332fce640.tar.gz
emacs-1b59478f4cf442f5201500b0a9c66f4332fce640.zip
Update from Gnulib by running admin/merge-gnulib.
Diffstat (limited to 'lib/sys_stat.in.h')
-rw-r--r--lib/sys_stat.in.h81
1 files changed, 56 insertions, 25 deletions
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 4e7b212a611..ccdb5cbd143 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -391,20 +391,22 @@ struct stat
391#endif 391#endif
392 392
393 393
394#if @GNULIB_MDA_CHMOD@
394/* On native Windows, map 'chmod' to '_chmod', so that -loldnames is not 395/* On native Windows, map 'chmod' to '_chmod', so that -loldnames is not
395 required. In C++ with GNULIB_NAMESPACE, avoid differences between 396 required. In C++ with GNULIB_NAMESPACE, avoid differences between
396 platforms by defining GNULIB_NAMESPACE::chmod always. */ 397 platforms by defining GNULIB_NAMESPACE::chmod always. */
397#if defined _WIN32 && !defined __CYGWIN__ 398# if defined _WIN32 && !defined __CYGWIN__
398# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 399# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
399# undef chmod 400# undef chmod
400# define chmod _chmod 401# define chmod _chmod
401# endif 402# endif
402/* Need to cast, because in mingw the last argument is 'int mode'. */ 403/* Need to cast, because in mingw the last argument is 'int mode'. */
403_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode)); 404_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode));
404#else 405# else
405_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode)); 406_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode));
406#endif 407# endif
407_GL_CXXALIASWARN (chmod); 408_GL_CXXALIASWARN (chmod);
409#endif
408 410
409 411
410#if @GNULIB_FCHMODAT@ 412#if @GNULIB_FCHMODAT@
@@ -606,21 +608,20 @@ _GL_WARN_ON_USE (lstat, "lstat is unportable - "
606#endif 608#endif
607 609
608 610
609#if @REPLACE_MKDIR@ 611#if @GNULIB_MKDIR@
610# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 612# if @REPLACE_MKDIR@
611# undef mkdir 613# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
612# define mkdir rpl_mkdir 614# undef mkdir
613# endif 615# define mkdir rpl_mkdir
616# endif
614_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode) 617_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
615 _GL_ARG_NONNULL ((1))); 618 _GL_ARG_NONNULL ((1)));
616_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); 619_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
617#else 620# elif defined _WIN32 && !defined __CYGWIN__
618/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. 621/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
619 Additionally, it declares _mkdir (and depending on compile flags, an 622 Additionally, it declares _mkdir (and depending on compile flags, an
620 alias mkdir), only in the nonstandard includes <direct.h> and <io.h>, 623 alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
621 which are included above. */ 624 which are included above. */
622# if defined _WIN32 && ! defined __CYGWIN__
623
624# if !GNULIB_defined_rpl_mkdir 625# if !GNULIB_defined_rpl_mkdir
625static int 626static int
626rpl_mkdir (char const *name, mode_t mode) 627rpl_mkdir (char const *name, mode_t mode)
@@ -629,16 +630,44 @@ rpl_mkdir (char const *name, mode_t mode)
629} 630}
630# define GNULIB_defined_rpl_mkdir 1 631# define GNULIB_defined_rpl_mkdir 1
631# endif 632# endif
632
633# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 633# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
634# undef mkdir
635# define mkdir rpl_mkdir
636# endif
637_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
638# else
639_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
640# endif
641_GL_CXXALIASWARN (mkdir);
642#elif defined GNULIB_POSIXCHECK
643# undef mkdir
644# if HAVE_RAW_DECL_MKDIR
645_GL_WARN_ON_USE (mkdir, "mkdir does not always support two parameters - "
646 "use gnulib module mkdir for portability");
647# endif
648#elif @GNULIB_MDA_MKDIR@
649/* On native Windows, map 'mkdir' to '_mkdir', so that -loldnames is not
650 required. In C++ with GNULIB_NAMESPACE, avoid differences between
651 platforms by defining GNULIB_NAMESPACE::mkdir always. */
652# if defined _WIN32 && !defined __CYGWIN__
653# if !GNULIB_defined_rpl_mkdir
654static int
655rpl_mkdir (char const *name, mode_t mode)
656{
657 return _mkdir (name);
658}
659# define GNULIB_defined_rpl_mkdir 1
660# endif
661# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
662# undef mkdir
634# define mkdir rpl_mkdir 663# define mkdir rpl_mkdir
635# endif 664# endif
636_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); 665_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
637# else 666# else
638_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode)); 667_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
639# endif 668# endif
640#endif
641_GL_CXXALIASWARN (mkdir); 669_GL_CXXALIASWARN (mkdir);
670#endif
642 671
643 672
644#if @GNULIB_MKDIRAT@ 673#if @GNULIB_MKDIRAT@
@@ -818,20 +847,22 @@ _GL_WARN_ON_USE (stat, "stat is unportable - "
818#endif 847#endif
819 848
820 849
850#if @GNULIB_MDA_UMASK@
821/* On native Windows, map 'umask' to '_umask', so that -loldnames is not 851/* On native Windows, map 'umask' to '_umask', so that -loldnames is not
822 required. In C++ with GNULIB_NAMESPACE, avoid differences between 852 required. In C++ with GNULIB_NAMESPACE, avoid differences between
823 platforms by defining GNULIB_NAMESPACE::umask always. */ 853 platforms by defining GNULIB_NAMESPACE::umask always. */
824#if defined _WIN32 && !defined __CYGWIN__ 854# if defined _WIN32 && !defined __CYGWIN__
825# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 855# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
826# undef umask 856# undef umask
827# define umask _umask 857# define umask _umask
828# endif 858# endif
829/* Need to cast, because in mingw the last argument is 'int mode'. */ 859/* Need to cast, because in mingw the last argument is 'int mode'. */
830_GL_CXXALIAS_MDA_CAST (umask, mode_t, (mode_t mask)); 860_GL_CXXALIAS_MDA_CAST (umask, mode_t, (mode_t mask));
831#else 861# else
832_GL_CXXALIAS_SYS (umask, mode_t, (mode_t mask)); 862_GL_CXXALIAS_SYS (umask, mode_t, (mode_t mask));
833#endif 863# endif
834_GL_CXXALIASWARN (umask); 864_GL_CXXALIASWARN (umask);
865#endif
835 866
836 867
837#if @GNULIB_UTIMENSAT@ 868#if @GNULIB_UTIMENSAT@