mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
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.
This commit is contained in:
parent
3af6909f32
commit
792ffa0223
3 changed files with 0 additions and 71 deletions
|
|
@ -50,8 +50,6 @@ struct timezone
|
|||
};
|
||||
#endif
|
||||
|
||||
void gettimeofday (struct timeval *, struct timezone *);
|
||||
|
||||
#define MAXPATHLEN _MAX_PATH
|
||||
|
||||
/* Emulate sleep...we could have done this with a define, but that
|
||||
|
|
@ -229,29 +227,6 @@ getpass (const char * prompt)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* This is needed because lib/gettime.c calls gettimeofday, which MSVC
|
||||
doesn't have. Copied from w32.c. */
|
||||
void
|
||||
gettimeofday (struct timeval *tv, struct timezone *tz)
|
||||
{
|
||||
struct _timeb tb;
|
||||
_ftime (&tb);
|
||||
|
||||
tv->tv_sec = tb.time;
|
||||
tv->tv_usec = tb.millitm * 1000L;
|
||||
/* Implementation note: _ftime sometimes doesn't update the dstflag
|
||||
according to the new timezone when the system timezone is
|
||||
changed. We could fix that by using GetSystemTime and
|
||||
GetTimeZoneInformation, but that doesn't seem necessary, since
|
||||
Emacs always calls gettimeofday with the 2nd argument NULL (see
|
||||
current_emacs_time). */
|
||||
if (tz)
|
||||
{
|
||||
tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */
|
||||
tz->tz_dsttime = tb.dstflag; /* type of dst correction */
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
fchown (int fd, unsigned uid, unsigned gid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,25 +25,6 @@ struct timeval
|
|||
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
|
||||
#endif /* _TIMEVAL_DEFINED */
|
||||
|
||||
#ifndef _TIMEZONE_DEFINED
|
||||
#define _TIMEZONE_DEFINED
|
||||
struct timezone
|
||||
{
|
||||
int tz_minuteswest; /* minutes west of Greenwich */
|
||||
int tz_dsttime; /* type of dst correction */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
/* This needs to be compatible with Posix signature, in order to pass
|
||||
the configure test for the type of the second argument; see
|
||||
m4/gettimeofday.m4. We use '__restrict' here, rather than
|
||||
'restrict', for the benefit of the old nt/configure.bat build,
|
||||
which does not force the use of -std= switch to GCC, and that
|
||||
causes compilation errors with 'restrict', which is a C99
|
||||
extension. */
|
||||
int gettimeofday (struct timeval *__restrict, void *__restrict);
|
||||
|
||||
#define ITIMER_REAL 0
|
||||
#define ITIMER_PROF 1
|
||||
|
||||
|
|
|
|||
27
src/w32.c
27
src/w32.c
|
|
@ -2978,33 +2978,6 @@ emacs_root_dir (void)
|
|||
return root_dir;
|
||||
}
|
||||
|
||||
#include <sys/timeb.h>
|
||||
|
||||
/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */
|
||||
int
|
||||
gettimeofday (struct timeval *__restrict tv, void *__restrict tzv)
|
||||
{
|
||||
struct _timeb tb;
|
||||
_ftime (&tb);
|
||||
|
||||
tv->tv_sec = tb.time;
|
||||
tv->tv_usec = tb.millitm * 1000L;
|
||||
/* Implementation note: _ftime sometimes doesn't update the dstflag
|
||||
according to the new timezone when the system timezone is
|
||||
changed. We could fix that by using GetSystemTime and
|
||||
GetTimeZoneInformation, but that doesn't seem necessary, since
|
||||
Emacs always calls gettimeofday with the 2nd argument NULL (see
|
||||
current_emacs_time). */
|
||||
if (tzv)
|
||||
{
|
||||
struct timezone *tz = (struct timezone *)tzv;
|
||||
|
||||
tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */
|
||||
tz->tz_dsttime = tb.dstflag; /* type of dst correction */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Emulate fdutimens. */
|
||||
|
||||
/* Set the access and modification time stamps of FD (a.k.a. FILE) to be
|
||||
|
|
|
|||
Loading…
Reference in a new issue