emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 10037e4: Merge from gnulib


From: Paul Eggert
Subject: [Emacs-diffs] master 10037e4: Merge from gnulib
Date: Sun, 14 May 2017 15:40:09 -0400 (EDT)

branch: master
commit 10037e4be2358597125a05db93f6fee551131d83
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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.
---
 lib/gnulib.mk.in   |  2 ++
 lib/stat-time.h    |  4 ++++
 lib/sys_types.in.h | 42 ++++++++++++++++++++++++++++++++++++++++++
 m4/sys_types_h.m4  | 10 +++++++++-
 4 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index d4afafb..6d85dc5 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; \
        } > address@hidden && \
        mv address@hidden $@
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 88dcc7f..9e45e85 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
      <https://msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx>.  */
+# 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 30ebfbd..3cea448 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 <stddef.h>, not in <sys/types.h>.  */
 /* 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 2eb4e9e..e590670 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],



reply via email to

[Prev in Thread] Current Thread [Next in Thread]