diff options
| author | Eli Zaretskii | 2017-05-14 19:02:50 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-05-14 19:02:50 +0300 |
| commit | 792ffa022380e05d49437e47823cfdf82337a253 (patch) | |
| tree | d9c17fb890a9010c1c8ed8de0d52d1de160c8cd2 | |
| parent | 3af6909f3249dc8d74349f000117f7063f71adff (diff) | |
| download | emacs-792ffa022380e05d49437e47823cfdf82337a253.tar.gz emacs-792ffa022380e05d49437e47823cfdf82337a253.zip | |
Remove gettimeofday from w32 sources
* lib-src/ntlib.c (gettimeofday):
* nt/inc/sys/time.h (gettimeofday, struct timezone): Remove unused
function 'gettimeofday' and all of its supporting code.
| -rw-r--r-- | lib-src/ntlib.c | 25 | ||||
| -rw-r--r-- | nt/inc/sys/time.h | 19 | ||||
| -rw-r--r-- | src/w32.c | 27 |
3 files changed, 0 insertions, 71 deletions
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c index 4bffc612f9b..78ba9061f6b 100644 --- a/lib-src/ntlib.c +++ b/lib-src/ntlib.c | |||
| @@ -50,8 +50,6 @@ struct timezone | |||
| 50 | }; | 50 | }; |
| 51 | #endif | 51 | #endif |
| 52 | 52 | ||
| 53 | void gettimeofday (struct timeval *, struct timezone *); | ||
| 54 | |||
| 55 | #define MAXPATHLEN _MAX_PATH | 53 | #define MAXPATHLEN _MAX_PATH |
| 56 | 54 | ||
| 57 | /* Emulate sleep...we could have done this with a define, but that | 55 | /* Emulate sleep...we could have done this with a define, but that |
| @@ -229,29 +227,6 @@ getpass (const char * prompt) | |||
| 229 | return NULL; | 227 | return NULL; |
| 230 | } | 228 | } |
| 231 | 229 | ||
| 232 | /* This is needed because lib/gettime.c calls gettimeofday, which MSVC | ||
| 233 | doesn't have. Copied from w32.c. */ | ||
| 234 | void | ||
| 235 | gettimeofday (struct timeval *tv, struct timezone *tz) | ||
| 236 | { | ||
| 237 | struct _timeb tb; | ||
| 238 | _ftime (&tb); | ||
| 239 | |||
| 240 | tv->tv_sec = tb.time; | ||
| 241 | tv->tv_usec = tb.millitm * 1000L; | ||
| 242 | /* Implementation note: _ftime sometimes doesn't update the dstflag | ||
| 243 | according to the new timezone when the system timezone is | ||
| 244 | changed. We could fix that by using GetSystemTime and | ||
| 245 | GetTimeZoneInformation, but that doesn't seem necessary, since | ||
| 246 | Emacs always calls gettimeofday with the 2nd argument NULL (see | ||
| 247 | current_emacs_time). */ | ||
| 248 | if (tz) | ||
| 249 | { | ||
| 250 | tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */ | ||
| 251 | tz->tz_dsttime = tb.dstflag; /* type of dst correction */ | ||
| 252 | } | ||
| 253 | } | ||
| 254 | |||
| 255 | int | 230 | int |
| 256 | fchown (int fd, unsigned uid, unsigned gid) | 231 | fchown (int fd, unsigned uid, unsigned gid) |
| 257 | { | 232 | { |
diff --git a/nt/inc/sys/time.h b/nt/inc/sys/time.h index 88ea32bc808..de06c116ced 100644 --- a/nt/inc/sys/time.h +++ b/nt/inc/sys/time.h | |||
| @@ -25,25 +25,6 @@ struct timeval | |||
| 25 | #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 | 25 | #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 |
| 26 | #endif /* _TIMEVAL_DEFINED */ | 26 | #endif /* _TIMEVAL_DEFINED */ |
| 27 | 27 | ||
| 28 | #ifndef _TIMEZONE_DEFINED | ||
| 29 | #define _TIMEZONE_DEFINED | ||
| 30 | struct timezone | ||
| 31 | { | ||
| 32 | int tz_minuteswest; /* minutes west of Greenwich */ | ||
| 33 | int tz_dsttime; /* type of dst correction */ | ||
| 34 | }; | ||
| 35 | #endif | ||
| 36 | |||
| 37 | |||
| 38 | /* This needs to be compatible with Posix signature, in order to pass | ||
| 39 | the configure test for the type of the second argument; see | ||
| 40 | m4/gettimeofday.m4. We use '__restrict' here, rather than | ||
| 41 | 'restrict', for the benefit of the old nt/configure.bat build, | ||
| 42 | which does not force the use of -std= switch to GCC, and that | ||
| 43 | causes compilation errors with 'restrict', which is a C99 | ||
| 44 | extension. */ | ||
| 45 | int gettimeofday (struct timeval *__restrict, void *__restrict); | ||
| 46 | |||
| 47 | #define ITIMER_REAL 0 | 28 | #define ITIMER_REAL 0 |
| 48 | #define ITIMER_PROF 1 | 29 | #define ITIMER_PROF 1 |
| 49 | 30 | ||
| @@ -2978,33 +2978,6 @@ emacs_root_dir (void) | |||
| 2978 | return root_dir; | 2978 | return root_dir; |
| 2979 | } | 2979 | } |
| 2980 | 2980 | ||
| 2981 | #include <sys/timeb.h> | ||
| 2982 | |||
| 2983 | /* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */ | ||
| 2984 | int | ||
| 2985 | gettimeofday (struct timeval *__restrict tv, void *__restrict tzv) | ||
| 2986 | { | ||
| 2987 | struct _timeb tb; | ||
| 2988 | _ftime (&tb); | ||
| 2989 | |||
| 2990 | tv->tv_sec = tb.time; | ||
| 2991 | tv->tv_usec = tb.millitm * 1000L; | ||
| 2992 | /* Implementation note: _ftime sometimes doesn't update the dstflag | ||
| 2993 | according to the new timezone when the system timezone is | ||
| 2994 | changed. We could fix that by using GetSystemTime and | ||
| 2995 | GetTimeZoneInformation, but that doesn't seem necessary, since | ||
| 2996 | Emacs always calls gettimeofday with the 2nd argument NULL (see | ||
| 2997 | current_emacs_time). */ | ||
| 2998 | if (tzv) | ||
| 2999 | { | ||
| 3000 | struct timezone *tz = (struct timezone *)tzv; | ||
| 3001 | |||
| 3002 | tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */ | ||
| 3003 | tz->tz_dsttime = tb.dstflag; /* type of dst correction */ | ||
| 3004 | } | ||
| 3005 | return 0; | ||
| 3006 | } | ||
| 3007 | |||
| 3008 | /* Emulate fdutimens. */ | 2981 | /* Emulate fdutimens. */ |
| 3009 | 2982 | ||
| 3010 | /* Set the access and modification time stamps of FD (a.k.a. FILE) to be | 2983 | /* Set the access and modification time stamps of FD (a.k.a. FILE) to be |