mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Changes made in Rochester. See ChangeLog
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1650 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7170d35e46
commit
fe624212e5
55 changed files with 935 additions and 342 deletions
|
@ -31,8 +31,10 @@
|
|||
#endif
|
||||
|
||||
#if HAVE_TIMES
|
||||
#ifndef __WIN32__
|
||||
#include <sys/times.h>
|
||||
#endif
|
||||
#endif /* !__WIN32__ */
|
||||
#endif /* HAVE_TIMES */
|
||||
|
||||
/* There are several places where I need to deal with tz more intelligently */
|
||||
/* I should allow customization of a strftime() format string for printing. */
|
||||
|
@ -64,6 +66,37 @@ int gettimeofday(tvp, tzp)
|
|||
}
|
||||
#endif /* _SEQUENT_ */
|
||||
|
||||
#ifdef __WIN32__
|
||||
/* Win32 does not provide gettimeofday() */
|
||||
int gettimeofday(tvp, tzp)
|
||||
struct timeval *tvp;
|
||||
struct timezone *tzp;
|
||||
{
|
||||
TIME_ZONE_INFORMATION sys_time_zone;
|
||||
SYSTEMTIME sys_time;
|
||||
|
||||
// Get the time zone information
|
||||
GetTimeZoneInformation(&sys_time_zone);
|
||||
|
||||
// Get the local time
|
||||
GetLocalTime(&sys_time);
|
||||
|
||||
tvp->tv_usec = sys_time.wMilliseconds;
|
||||
tvp->tv_sec = sys_time.wSecond;
|
||||
tvp->tv_sec = tvp->tv_sec + (sys_time.wMinute * 60);
|
||||
tvp->tv_sec = tvp->tv_sec + (sys_time.wHour * 60 * 60);
|
||||
tvp->tv_sec = tvp->tv_sec + (sys_time.wDay * 60 * 60 * 24);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Win32 does not provide times() */
|
||||
int times(struct tms *atms)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* __WIN32__ */
|
||||
|
||||
/* tmp for passing to gettimeofday() */
|
||||
static struct timeval _Time_tv;
|
||||
static struct timezone _Time_tz;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue