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.
This commit is contained in:
Victor Stinner 2014-10-09 13:52:31 +02:00
parent 13d3aa502d
commit 484df0075a
1 changed files with 21 additions and 21 deletions

View File

@ -4684,54 +4684,54 @@ typedef struct {
} utime_t; } 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" * they also intentionally leak the declaration of a pointer named "time"
*/ */
#define UTIME_TO_TIMESPEC \ #define UTIME_TO_TIMESPEC \
struct timespec ts[2]; \ struct timespec ts[2]; \
struct timespec *time; \ struct timespec *time; \
if (utime->now) \ if (ut->now) \
time = NULL; \ time = NULL; \
else { \ else { \
ts[0].tv_sec = utime->atime_s; \ ts[0].tv_sec = ut->atime_s; \
ts[0].tv_nsec = utime->atime_ns; \ ts[0].tv_nsec = ut->atime_ns; \
ts[1].tv_sec = utime->mtime_s; \ ts[1].tv_sec = ut->mtime_s; \
ts[1].tv_nsec = utime->mtime_ns; \ ts[1].tv_nsec = ut->mtime_ns; \
time = ts; \ time = ts; \
} \ } \
#define UTIME_TO_TIMEVAL \ #define UTIME_TO_TIMEVAL \
struct timeval tv[2]; \ struct timeval tv[2]; \
struct timeval *time; \ struct timeval *time; \
if (utime->now) \ if (ut->now) \
time = NULL; \ time = NULL; \
else { \ else { \
tv[0].tv_sec = utime->atime_s; \ tv[0].tv_sec = ut->atime_s; \
tv[0].tv_usec = utime->atime_ns / 1000; \ tv[0].tv_usec = ut->atime_ns / 1000; \
tv[1].tv_sec = utime->mtime_s; \ tv[1].tv_sec = ut->mtime_s; \
tv[1].tv_usec = utime->mtime_ns / 1000; \ tv[1].tv_usec = ut->mtime_ns / 1000; \
time = tv; \ time = tv; \
} \ } \
#define UTIME_TO_UTIMBUF \ #define UTIME_TO_UTIMBUF \
struct utimbuf u[2]; \ struct utimbuf u[2]; \
struct utimbuf *time; \ struct utimbuf *time; \
if (utime->now) \ if (ut->now) \
time = NULL; \ time = NULL; \
else { \ else { \
u.actime = utime->atime_s; \ u[0].actime = ut->atime_s; \
u.modtime = utime->mtime_s; \ u[0].modtime = ut->mtime_s; \
time = u; \ time = u; \
} }
#define UTIME_TO_TIME_T \ #define UTIME_TO_TIME_T \
time_t timet[2]; \ time_t timet[2]; \
struct timet time; \ struct timet time; \
if (utime->now) \ if (ut->now) \
time = NULL; \ time = NULL; \
else { \ else { \
timet[0] = utime->atime_s; \ timet[0] = ut->atime_s; \
timet[1] = utime->mtime_s; \ timet[1] = ut->mtime_s; \
time = &timet; \ time = &timet; \
} \ } \
@ -4741,7 +4741,7 @@ typedef struct {
#if UTIME_HAVE_DIR_FD #if UTIME_HAVE_DIR_FD
static int 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 #ifdef HAVE_UTIMENSAT
int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW; int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
@ -4766,7 +4766,7 @@ utime_dir_fd(utime_t *utime, int dir_fd, char *path, int follow_symlinks)
#if UTIME_HAVE_FD #if UTIME_HAVE_FD
static int static int
utime_fd(utime_t *utime, int fd) utime_fd(utime_t *ut, int fd)
{ {
#ifdef HAVE_FUTIMENS #ifdef HAVE_FUTIMENS
UTIME_TO_TIMESPEC; UTIME_TO_TIMESPEC;
@ -4786,7 +4786,7 @@ utime_fd(utime_t *utime, int fd)
#if UTIME_HAVE_NOFOLLOW_SYMLINKS #if UTIME_HAVE_NOFOLLOW_SYMLINKS
static int static int
utime_nofollow_symlinks(utime_t *utime, char *path) utime_nofollow_symlinks(utime_t *ut, char *path)
{ {
#ifdef HAVE_UTIMENSAT #ifdef HAVE_UTIMENSAT
UTIME_TO_TIMESPEC; UTIME_TO_TIMESPEC;
@ -4802,7 +4802,7 @@ utime_nofollow_symlinks(utime_t *utime, char *path)
#ifndef MS_WINDOWS #ifndef MS_WINDOWS
static int static int
utime_default(utime_t *utime, char *path) utime_default(utime_t *ut, char *path)
{ {
#ifdef HAVE_UTIMENSAT #ifdef HAVE_UTIMENSAT
UTIME_TO_TIMESPEC; UTIME_TO_TIMESPEC;