[Python-checkins] cpython (merge 3.4 -> default): (Merge 3.4) Issue #22568: Fix compilation of posixmodule.c with Open Watcom:

victor.stinner python-checkins at python.org
Thu Oct 9 13:54:35 CEST 2014


https://hg.python.org/cpython/rev/588657f910ac
changeset:   92892:588657f910ac
parent:      92889:335d16d864e1
parent:      92891:58601c36a357
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Oct 09 13:53:45 2014 +0200
summary:
  (Merge 3.4) Issue #22568: Fix compilation of posixmodule.c with Open Watcom:
rename "utime" variable to "ut" to avoid conflict with the C utime() function.
Patch written by Jeffrey Armstrong.

files:
  Modules/posixmodule.c |  42 +++++++++++++++---------------
  1 files changed, 21 insertions(+), 21 deletions(-)


diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -6023,54 +6023,54 @@
 } utime_t;
 
 /*
- * these macros assume that "utime" is a pointer to a utime_t
+ * these macros assume that "ut" is a pointer to a utime_t
  * they also intentionally leak the declaration of a pointer named "time"
  */
 #define UTIME_TO_TIMESPEC \
     struct timespec ts[2]; \
     struct timespec *time; \
-    if (utime->now) \
+    if (ut->now) \
         time = NULL; \
     else { \
-        ts[0].tv_sec = utime->atime_s; \
-        ts[0].tv_nsec = utime->atime_ns; \
-        ts[1].tv_sec = utime->mtime_s; \
-        ts[1].tv_nsec = utime->mtime_ns; \
+        ts[0].tv_sec = ut->atime_s; \
+        ts[0].tv_nsec = ut->atime_ns; \
+        ts[1].tv_sec = ut->mtime_s; \
+        ts[1].tv_nsec = ut->mtime_ns; \
         time = ts; \
     } \
 
 #define UTIME_TO_TIMEVAL \
     struct timeval tv[2]; \
     struct timeval *time; \
-    if (utime->now) \
+    if (ut->now) \
         time = NULL; \
     else { \
-        tv[0].tv_sec = utime->atime_s; \
-        tv[0].tv_usec = utime->atime_ns / 1000; \
-        tv[1].tv_sec = utime->mtime_s; \
-        tv[1].tv_usec = utime->mtime_ns / 1000; \
+        tv[0].tv_sec = ut->atime_s; \
+        tv[0].tv_usec = ut->atime_ns / 1000; \
+        tv[1].tv_sec = ut->mtime_s; \
+        tv[1].tv_usec = ut->mtime_ns / 1000; \
         time = tv; \
     } \
 
 #define UTIME_TO_UTIMBUF \
     struct utimbuf u[2]; \
     struct utimbuf *time; \
-    if (utime->now) \
+    if (ut->now) \
         time = NULL; \
     else { \
-        u.actime = utime->atime_s; \
-        u.modtime = utime->mtime_s; \
+        u[0].actime = ut->atime_s; \
+        u[0].modtime = ut->mtime_s; \
         time = u; \
     }
 
 #define UTIME_TO_TIME_T \
     time_t timet[2]; \
     struct timet time; \
-    if (utime->now) \
+    if (ut->now) \
         time = NULL; \
     else { \
-        timet[0] = utime->atime_s; \
-        timet[1] = utime->mtime_s; \
+        timet[0] = ut->atime_s; \
+        timet[1] = ut->mtime_s; \
         time = &timet; \
     } \
 
@@ -6080,7 +6080,7 @@
 #if UTIME_HAVE_DIR_FD
 
 static int
-utime_dir_fd(utime_t *utime, int dir_fd, char *path, int follow_symlinks)
+utime_dir_fd(utime_t *ut, int dir_fd, char *path, int follow_symlinks)
 {
 #ifdef HAVE_UTIMENSAT
     int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
@@ -6108,7 +6108,7 @@
 #if UTIME_HAVE_FD
 
 static int
-utime_fd(utime_t *utime, int fd)
+utime_fd(utime_t *ut, int fd)
 {
 #ifdef HAVE_FUTIMENS
     UTIME_TO_TIMESPEC;
@@ -6131,7 +6131,7 @@
 #if UTIME_HAVE_NOFOLLOW_SYMLINKS
 
 static int
-utime_nofollow_symlinks(utime_t *utime, char *path)
+utime_nofollow_symlinks(utime_t *ut, char *path)
 {
 #ifdef HAVE_UTIMENSAT
     UTIME_TO_TIMESPEC;
@@ -6147,7 +6147,7 @@
 #ifndef MS_WINDOWS
 
 static int
-utime_default(utime_t *utime, char *path)
+utime_default(utime_t *ut, char *path)
 {
 #ifdef HAVE_UTIMENSAT
     UTIME_TO_TIMESPEC;

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list