diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-10-09 11:53:45 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-10-09 11:53:45 (GMT) |
commit | 67e2e6d600f243c748678c09f741b6f8938af452 (patch) | |
tree | 1da39623b45b9fc34afab131d3737ac9d8fe5877 | |
parent | 8786ea36d08670de706507f8639f68f0d3c762f3 (diff) | |
parent | 484df0075ab1082d154e934399c16ba3c80a6ccf (diff) | |
download | cpython-67e2e6d600f243c748678c09f741b6f8938af452.zip cpython-67e2e6d600f243c748678c09f741b6f8938af452.tar.gz cpython-67e2e6d600f243c748678c09f741b6f8938af452.tar.bz2 |
(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.
-rw-r--r-- | Modules/posixmodule.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index aa2d63a..c8d13d1 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -6023,54 +6023,54 @@ typedef struct { } 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 @@ typedef struct { #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 @@ utime_dir_fd(utime_t *utime, int dir_fd, char *path, int follow_symlinks) #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 @@ utime_fd(utime_t *utime, int fd) #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 @@ utime_nofollow_symlinks(utime_t *utime, char *path) #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; |