mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Changes from Scott Christley. See Oct 18 ChangeLog entry.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1887 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
db69ec3c59
commit
07466dd9e9
5 changed files with 62 additions and 6 deletions
10
ChangeLog
10
ChangeLog
|
@ -15,6 +15,16 @@ Tue Oct 15 15:29:07 1996 Adam Fedor <fedor@wave.Colorado.edu>
|
|||
* src/include/objc-load.h (objc_load_modules, objc_unload_modules):
|
||||
Use Class not Class*.
|
||||
|
||||
Fri Oct 18 10:45:10 1996 Scott Christley <scottc@net-community.com>
|
||||
|
||||
* Makefile.sed.nt: Always force gnustep/base target.
|
||||
* src/NSDate.m (+timeIntervalSinceReferenceDate): Use native
|
||||
Win32 functions to obtain current time.
|
||||
* src/Time.m (gettimeofday): Win32 implementation, not year
|
||||
2000 compliant so don't use it.
|
||||
* src/include/NSZone.h: Include preface.c so that NSZone gets
|
||||
configuration settings.
|
||||
|
||||
Wed Oct 16 10:01:23 1996 Scott Christley <scottc@net-community.com>
|
||||
|
||||
* checks/nsdate.m: New file.
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#ifndef h_zone_NS_h
|
||||
#define h_zone_NS_h
|
||||
|
||||
#include <gnustep/base/preface.h>
|
||||
|
||||
#if NeXT_runtime
|
||||
|
||||
#include <objc/zone.h>
|
||||
|
|
|
@ -137,7 +137,7 @@ install: installdirs all\
|
|||
for %i in ( ${NEXTSTEP_HEADERS} ) do \\\
|
||||
rm -f $(includedir)/%i
|
||||
/gnustep\/base:/,/ln -s $(srcdir)\/include Foundation/c\
|
||||
gnustep/base: include\/preface.h\
|
||||
gnustep/base: include\/preface.h FORCE\
|
||||
-rm -rf gnustep\
|
||||
-mkdir gnustep\
|
||||
-mkdir gnustep\\base\
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
|
||||
+ (NSTimeInterval) timeIntervalSinceReferenceDate
|
||||
{
|
||||
#ifndef __WIN32__
|
||||
volatile NSTimeInterval interval;
|
||||
struct timeval tp;
|
||||
struct timezone tzp;
|
||||
|
@ -75,6 +76,31 @@
|
|||
assert (interval < 0);
|
||||
|
||||
return interval;
|
||||
#else
|
||||
TIME_ZONE_INFORMATION sys_time_zone;
|
||||
SYSTEMTIME sys_time;
|
||||
NSCalendarDate *d;
|
||||
NSTimeInterval t;
|
||||
|
||||
// Get the time zone information
|
||||
GetTimeZoneInformation(&sys_time_zone);
|
||||
|
||||
// Get the system time
|
||||
GetLocalTime(&sys_time);
|
||||
|
||||
// Use an NSCalendar object to make it easier
|
||||
d = [NSCalendarDate alloc];
|
||||
[d initWithYear: sys_time.wYear
|
||||
month: sys_time.wMonth
|
||||
day: sys_time.wDay
|
||||
hour: sys_time.wHour
|
||||
minute: sys_time.wMinute
|
||||
second: sys_time.wSecond
|
||||
timeZone: [NSTimeZone defaultTimeZone]];
|
||||
t = [d timeIntervalSinceReferenceDate];
|
||||
[d release];
|
||||
return t;
|
||||
#endif /* __WIN32__ */
|
||||
}
|
||||
|
||||
// Allocation and initializing
|
||||
|
|
|
@ -65,6 +65,7 @@ int gettimeofday(tvp, tzp)
|
|||
#endif /* _SEQUENT_ */
|
||||
|
||||
#ifdef __WIN32__
|
||||
#include <time.h>
|
||||
/* Win32 does not provide gettimeofday() */
|
||||
int gettimeofday(tvp, tzp)
|
||||
struct timeval *tvp;
|
||||
|
@ -72,6 +73,7 @@ int gettimeofday(tvp, tzp)
|
|||
{
|
||||
TIME_ZONE_INFORMATION sys_time_zone;
|
||||
SYSTEMTIME sys_time;
|
||||
struct tm timem;
|
||||
|
||||
// Get the time zone information
|
||||
GetTimeZoneInformation(&sys_time_zone);
|
||||
|
@ -79,11 +81,27 @@ int gettimeofday(tvp, tzp)
|
|||
// 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);
|
||||
timem.tm_sec = sys_time.wSecond;
|
||||
timem.tm_min = sys_time.wMinute;
|
||||
timem.tm_hour = sys_time.wHour;
|
||||
timem.tm_yday = 0;
|
||||
timem.tm_mday = sys_time.wDay;
|
||||
timem.tm_year = sys_time.wYear - 1900;
|
||||
timem.tm_wday = sys_time.wDayOfWeek;
|
||||
timem.tm_mon = sys_time.wMonth - 1;
|
||||
|
||||
if (tvp)
|
||||
{
|
||||
tvp->tv_usec = sys_time.wMilliseconds;
|
||||
tvp->tv_sec = mktime(&timem);
|
||||
}
|
||||
|
||||
if (tzp)
|
||||
{
|
||||
tzp->tz_minuteswest = sys_time_zone.Bias;
|
||||
tzp->tz_dsttime = sys_time_zone.StandardBias != sys_time_zone.Bias;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue