]> Savannah Git Hosting - gnulib.git/commitdiff
utimens: port to Emacs + MS-Windows
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 2 May 2017 07:40:41 +0000 (00:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 2 May 2017 07:46:00 +0000 (00:46 -0700)
Skip the new MS-Windows-specific code if Emacs.
* lib/utimens.c [EMACS_CONFIGUATION]:
Avoid new MS-Windows-specific code.
(USE_SETFILETIME): New macro.
(fdutimens): Use it.

ChangeLog
lib/utimens.c

index ad44003eadd30679d384f0c11311c80923fd1c6a..8c91b23e9c039f35c9cd8aa9b136137bb7c9857c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-05-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       utimens: port to Emacs + MS-Windows
+       Skip the new MS-Windows-specific code if Emacs.
+       * lib/utimens.c [EMACS_CONFIGUATION]:
+       Avoid new MS-Windows-specific code.
+       (USE_SETFILETIME): New macro.
+       (fdutimens): Use it.
+
 2017-05-01  Paul Eggert  <eggert@cs.ucla.edu>
 
        tzset: update doc for TZ problems on MS-Windows
index 0b3b8e2f3afeb336c05b08226a31f5cb3fb73dd9..5f3a846ea2f6edd24b0b0aa1952df754524ed6e6 100644 (file)
 #include "stat-time.h"
 #include "timespec.h"
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* On native Windows, use SetFileTime; but avoid this when compiling
+   GNU Emacs, which arranges for this in some other way and which
+   defines WIN32_LEAN_AND_MEAN itself.  */
+
+#if ((defined _WIN32 || defined __WIN32__) \
+     && ! defined __CYGWIN__ && ! defined EMACS_CONFIGURATION)
+# define USE_SETFILETIME
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 # include "msvc-nothrow.h"
@@ -277,7 +283,7 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
   lutimensat_works_really = -1;
 #endif /* HAVE_UTIMENSAT || HAVE_FUTIMENS */
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#ifdef USE_SETFILETIME
   /* On native Windows, use SetFileTime(). See
      <https://msdn.microsoft.com/en-us/library/ms724933.aspx>
      <https://msdn.microsoft.com/en-us/library/ms724284.aspx>  */