From: Paul Eggert Date: Sun, 14 May 2017 19:39:26 +0000 (-0700) Subject: Merge from gnulib X-Git-Tag: emacs-26.0.90~521^2~401 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=10037e4be2358597125a05db93f6fee551131d83;p=emacs.git Merge from gnulib This incorporates: 2017-05-14 same-inode: Adapt for windows-stat-inodes 2017-05-14 windows-stat-inodes: New module 2017-05-14 stat-time: Adapt for windows-stat-timespec * lib/gnulib.mk.in: Regenerate. * lib/stat-time.h, lib/sys_types.in.h, m4/sys_types_h.m4: Copy from gnulib. --- diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index d4afafbecc9..6d85dc59585 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -838,6 +838,7 @@ WERROR_CFLAGS = @WERROR_CFLAGS@ WIDGET_OBJ = @WIDGET_OBJ@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ WINDOW_SYSTEM_OBJ = @WINDOW_SYSTEM_OBJ@ WINDRES = @WINDRES@ @@ -2693,6 +2694,7 @@ sys/types.h: sys_types.in.h $(top_builddir)/config.status -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \ < $(srcdir)/sys_types.in.h; \ } > $@-t && \ mv $@-t $@ diff --git a/lib/stat-time.h b/lib/stat-time.h index 88dcc7f3e0d..9e45e855655 100644 --- a/lib/stat-time.h +++ b/lib/stat-time.h @@ -170,8 +170,12 @@ get_stat_birthtime (struct stat const *st) /* Native Windows platforms (but not Cygwin) put the "file creation time" in st_ctime (!). See . */ +# if _GL_WINDOWS_STAT_TIMESPEC + t = st->st_ctim; +# else t.tv_sec = st->st_ctime; t.tv_nsec = 0; +# endif #else /* Birth time is not supported. */ t.tv_sec = -1; diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h index 30ebfbdd294..3cea44884e3 100644 --- a/lib/sys_types.in.h +++ b/lib/sys_types.in.h @@ -42,6 +42,48 @@ # define _GL_WINDOWS_64_BIT_OFF_T 1 #endif +/* Override dev_t and ino_t if distinguishable inodes support is requested + on native Windows. */ +#if @WINDOWS_STAT_INODES@ + +# if @WINDOWS_STAT_INODES@ == 2 +/* Experimental, not useful in Windows 10. */ + +/* Define dev_t to a 64-bit type. */ +# if !defined GNULIB_defined_dev_t +typedef unsigned long long int rpl_dev_t; +# undef dev_t +# define dev_t rpl_dev_t +# define GNULIB_defined_dev_t 1 +# endif + +/* Define ino_t to a 128-bit type. */ +# if !defined GNULIB_defined_ino_t +/* MSVC does not have a 128-bit integer type. + GCC has a 128-bit integer type __int128, but only on 64-bit targets. */ +typedef struct { unsigned long long int _gl_ino[2]; } rpl_ino_t; +# undef ino_t +# define ino_t rpl_ino_t +# define GNULIB_defined_ino_t 1 +# endif + +# else /* @WINDOWS_STAT_INODES@ == 1 */ + +/* Define ino_t to a 64-bit type. */ +# if !defined GNULIB_defined_ino_t +typedef unsigned long long int rpl_ino_t; +# undef ino_t +# define ino_t rpl_ino_t +# define GNULIB_defined_ino_t 1 +# endif + +# endif + +/* Indicator, for gnulib internal purposes. */ +# define _GL_WINDOWS_STAT_INODES @WINDOWS_STAT_INODES@ + +#endif + /* MSVC 9 defines size_t in , not in . */ /* But avoid namespace pollution on glibc systems. */ #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4 index 2eb4e9e44e2..e5906709f69 100644 --- a/m4/sys_types_h.m4 +++ b/m4/sys_types_h.m4 @@ -1,4 +1,4 @@ -# sys_types_h.m4 serial 6 +# sys_types_h.m4 serial 7 dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -17,6 +17,14 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H], dnl Whether to override the 'off_t' type. AC_REQUIRE([gl_TYPE_OFF_T]) + + dnl Whether to override the 'dev_t' and 'ino_t' types. + m4_ifdef([gl_WINDOWS_STAT_INODES], [ + AC_REQUIRE([gl_WINDOWS_STAT_INODES]) + ], [ + WINDOWS_STAT_INODES=0 + ]) + AC_SUBST([WINDOWS_STAT_INODES]) ]) AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],