[Python-checkins] cpython (3.4): Issue #22568: Fix compilation of posixmodule.c with Open Watcom: rename "utime"

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


https://hg.python.org/cpython/rev/58601c36a357
changeset: 92891:58601c36a357
branch: 3.4
parent: 92888:4aba14bb6b1e
user: Victor Stinner <victor.stinner at gmail.com>
date: Thu Oct 09 13:52:31 2014 +0200
summary:
 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
@@ -4684,54 +4684,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; \
 } \
 
@@ -4741,7 +4741,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;
@@ -4766,7 +4766,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;
@@ -4786,7 +4786,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;
@@ -4802,7 +4802,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

AltStyle によって変換されたページ (->オリジナル) /