aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert2017-05-14 12:39:26 -0700
committerPaul Eggert2017-05-14 12:40:03 -0700
commit10037e4be2358597125a05db93f6fee551131d83 (patch)
tree530267b3b43f51075373af50bab6e994ce8f0764 /lib
parent792ffa022380e05d49437e47823cfdf82337a253 (diff)
downloademacs-10037e4be2358597125a05db93f6fee551131d83.tar.gz
emacs-10037e4be2358597125a05db93f6fee551131d83.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnulib.mk.in2
-rw-r--r--lib/stat-time.h4
-rw-r--r--lib/sys_types.in.h42
3 files changed, 48 insertions, 0 deletions
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@
838WIDGET_OBJ = @WIDGET_OBJ@ 838WIDGET_OBJ = @WIDGET_OBJ@
839WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ 839WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
840WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ 840WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
841WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
841WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ 842WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
842WINDOW_SYSTEM_OBJ = @WINDOW_SYSTEM_OBJ@ 843WINDOW_SYSTEM_OBJ = @WINDOW_SYSTEM_OBJ@
843WINDRES = @WINDRES@ 844WINDRES = @WINDRES@
@@ -2693,6 +2694,7 @@ sys/types.h: sys_types.in.h $(top_builddir)/config.status
2693 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ 2694 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
2694 -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ 2695 -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
2695 -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ 2696 -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
2697 -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \
2696 < $(srcdir)/sys_types.in.h; \ 2698 < $(srcdir)/sys_types.in.h; \
2697 } > $@-t && \ 2699 } > $@-t && \
2698 mv $@-t $@ 2700 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)
170 /* Native Windows platforms (but not Cygwin) put the "file creation 170 /* Native Windows platforms (but not Cygwin) put the "file creation
171 time" in st_ctime (!). See 171 time" in st_ctime (!). See
172 <https://msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx>. */ 172 <https://msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx>. */
173# if _GL_WINDOWS_STAT_TIMESPEC
174 t = st->st_ctim;
175# else
173 t.tv_sec = st->st_ctime; 176 t.tv_sec = st->st_ctime;
174 t.tv_nsec = 0; 177 t.tv_nsec = 0;
178# endif
175#else 179#else
176 /* Birth time is not supported. */ 180 /* Birth time is not supported. */
177 t.tv_sec = -1; 181 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 @@
42# define _GL_WINDOWS_64_BIT_OFF_T 1 42# define _GL_WINDOWS_64_BIT_OFF_T 1
43#endif 43#endif
44 44
45/* Override dev_t and ino_t if distinguishable inodes support is requested
46 on native Windows. */
47#if @WINDOWS_STAT_INODES@
48
49# if @WINDOWS_STAT_INODES@ == 2
50/* Experimental, not useful in Windows 10. */
51
52/* Define dev_t to a 64-bit type. */
53# if !defined GNULIB_defined_dev_t
54typedef unsigned long long int rpl_dev_t;
55# undef dev_t
56# define dev_t rpl_dev_t
57# define GNULIB_defined_dev_t 1
58# endif
59
60/* Define ino_t to a 128-bit type. */
61# if !defined GNULIB_defined_ino_t
62/* MSVC does not have a 128-bit integer type.
63 GCC has a 128-bit integer type __int128, but only on 64-bit targets. */
64typedef struct { unsigned long long int _gl_ino[2]; } rpl_ino_t;
65# undef ino_t
66# define ino_t rpl_ino_t
67# define GNULIB_defined_ino_t 1
68# endif
69
70# else /* @WINDOWS_STAT_INODES@ == 1 */
71
72/* Define ino_t to a 64-bit type. */
73# if !defined GNULIB_defined_ino_t
74typedef unsigned long long int rpl_ino_t;
75# undef ino_t
76# define ino_t rpl_ino_t
77# define GNULIB_defined_ino_t 1
78# endif
79
80# endif
81
82/* Indicator, for gnulib internal purposes. */
83# define _GL_WINDOWS_STAT_INODES @WINDOWS_STAT_INODES@
84
85#endif
86
45/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */ 87/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */
46/* But avoid namespace pollution on glibc systems. */ 88/* But avoid namespace pollution on glibc systems. */
47#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ 89#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \