? unix/Common/1.txt ? unix/Common/2.txt Index: m3core.h =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/m3core.h,v retrieving revision 1.26 diff -u -r1.26 m3core.h --- m3core.h 15 Apr 2010 13:58:40 -0000 1.26 +++ m3core.h 15 Apr 2010 14:36:04 -0000 @@ -283,37 +283,11 @@ typedef INT64 m3_time_t; #endif -typedef struct { -/* verified to exactly match struct timezone in UnixC.c */ - int minuteswest; - int dsttime; -} m3_timezone_t; - -typedef struct { -/* somewhat idealized, but ideally we'd use INT64 here */ - INTEGER sec; - INTEGER usec; /* microsec */ -} m3_timeval_t; - -#ifndef _WIN32 -m3_time_t __cdecl Utime__get_timezone(void); -m3_time_t __cdecl Utime__get_altzone(void); -#endif -int __cdecl Utime__get_daylight(void); -const char* __cdecl Utime__get_tzname(unsigned a); -int __cdecl Utime__gettimeofday(m3_timeval_t* m3t); #ifndef _WIN32 m3_time_t __cdecl Utime__time(m3_time_t* tloc); -m3_time_t __cdecl Utime__mktime(struct tm* tm); char* __cdecl Utime__ctime(const m3_time_t* m); -struct tm* __cdecl Utime__localtime(const m3_time_t* m); -struct tm* __cdecl Utime__gmtime(const m3_time_t* m); -struct tm* __cdecl Utime__localtime_r(const m3_time_t* clock, struct tm* result); -struct tm* __cdecl Utime__gmtime_r(const m3_time_t* clock, struct tm* result); #endif void __cdecl Utime__tzset(void); -int __cdecl Unix__utimes(const char* file, const m3_timeval_t* tvp); -int __cdecl Unix__select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, m3_timeval_t* timeout); /* Some compilers don't like this, will adjust as needed. */ @@ -330,7 +304,6 @@ void __cdecl Unix__Assertions(void); void __cdecl Usocket__Assertions(void); -void __cdecl Utime__Assertions(void); int __cdecl Unix__open(const char* path, int flags, m3_mode_t mode); Index: time/POSIX/DatePosixC.c =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/time/POSIX/DatePosixC.c,v retrieving revision 1.12 diff -u -r1.12 DatePosixC.c --- time/POSIX/DatePosixC.c 15 Apr 2010 13:58:41 -0000 1.12 +++ time/POSIX/DatePosixC.c 15 Apr 2010 14:36:04 -0000 @@ -14,6 +14,14 @@ extern "C" { #endif +#ifdef __CYGWIN__ +#define M3_TIMEZONE _timezone +#define M3_DAYLIGHT _daylight +#else +#define M3_TIMEZONE timezone +#define M3_DAYLIGHT daylight +#endif + #if defined(__CYGWIN__) || defined(__hpux) || defined(__sun) || defined(__INTERIX) #define DATE_POSIX #else @@ -57,17 +65,17 @@ { if (tm->tm_isdst == 0) { - date->offset = Utime__get_timezone(); - date->zone = M3toC__CopyStoT(Utime__get_tzname(0)); + date->offset = M3_TIMEZONE; + date->zone = M3toC__CopyStoT(tzname[0]); } - else if (tm->tm_isdst > 0 && Utime__get_daylight()) + else if (tm->tm_isdst > 0 && M3_DAYLIGHT) { #ifdef __sun - date->offset = Utime__get_altzone(); + date->offset = altzone; #else - date->offset = Utime__get_timezone() - 3600; + date->offset = M3_TIMEZONE - 3600; #endif - date->zone = M3toC__CopyStoT(Utime__get_tzname(1)); + date->zone = M3toC__CopyStoT(tzname[1]); } else { Index: unix/Common/UnixC.c =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/unix/Common/UnixC.c,v retrieving revision 1.53 diff -u -r1.53 UnixC.c --- unix/Common/UnixC.c 11 Apr 2010 05:31:13 -0000 1.53 +++ unix/Common/UnixC.c 15 Apr 2010 14:36:04 -0000 @@ -89,7 +89,6 @@ M3_STATIC_ASSERT(IS_TYPE_SIGNED(pid_t)); #endif - Utime__Assertions(); Usocket__Assertions(); } Index: unix/Common/UtimeC.c =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/unix/Common/UtimeC.c,v retrieving revision 1.55 diff -u -r1.55 UtimeC.c --- unix/Common/UtimeC.c 15 Apr 2010 11:44:28 -0000 1.55 +++ unix/Common/UtimeC.c 15 Apr 2010 14:36:04 -0000 @@ -10,72 +10,9 @@ #ifdef __cplusplus extern "C" { #endif - -void -__cdecl -Utime__Assertions(void) -{ - /* We won't ever be truncating. */ - M3_STATIC_ASSERT(sizeof(time_t) <= sizeof(INT64)); -} - -#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) -#define M3BSD -#endif - -/* -wrap up global variables in functions until something else is done -*/ - -#if !defined(M3BSD) && !defined(_WIN32) - -m3_time_t -__cdecl -Utime__get_timezone(void) -{ -#ifdef __CYGWIN__ - return _timezone; -#else - return timezone; -#endif -} - -#if defined(__CYGWIN__) || defined(__sun) || defined(__hpux) || defined(__INTERIX) - -m3_time_t -__cdecl -Utime__get_altzone(void) -{ -#ifdef __sun - return altzone; -#else - /* based on Python's timemodule */ - return Utime__get_timezone() - 3600; -#endif -} - -#endif /* cygwin | sun | hpux | interix */ - -int -__cdecl -Utime__get_daylight(void) -{ -#ifdef __CYGWIN__ - return _daylight; -#else - return daylight; -#endif -} - -const char* -__cdecl -Utime__get_tzname(unsigned a) -{ - assert((a == 0) || (a == 1)); - return tzname[a & 1]; -} - -#endif /* M3BSD, WIN32 */ + +/* We won't ever be truncating. */ +M3_STATIC_ASSERT(sizeof(time_t) <= sizeof(m3_time_t)); m3_time_t __cdecl