--- mstools/h/time.h 2018/08/09 18:20:28 1.1.1.2 +++ mstools/h/time.h 2018/08/09 18:21:05 1.1.1.3 @@ -18,10 +18,35 @@ extern "C" { #endif -#ifndef MIPS -#if (_MSC_VER <= 600) -#define __cdecl _cdecl -#endif +/* + * Conditional macro definition for function calling type and variable type + * qualifiers. + */ +#if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) ) + +/* + * Definitions for MS C8-32 (386/486) compiler + */ +#define _CRTAPI1 __cdecl +#define _CRTAPI2 __cdecl + +#elif ( _MSC_VER == 600 ) + +/* + * Definitions for old MS C6-386 compiler + */ +#define _CRTAPI1 _cdecl +#define _CRTAPI2 _cdecl +#define _M_IX86 300 + +#else + +/* + * Other compilers (e.g., MIPS) + */ +#define _CRTAPI1 +#define _CRTAPI2 + #endif /* define the implementation defined time type */ @@ -107,32 +132,38 @@ extern long _timezone; /* standard/daylight savings time zone names */ #ifdef _POSIX_ -#define tzname _tzname +#include +#ifndef TZNAME_MAX +#define TZNAME_MAX 10 #endif +#define tzname _tzname +extern char _tzname[2][TZNAME_MAX + 1]; +#else extern char * _tzname[2]; +#endif #endif /* function prototypes */ -char * asctime(const struct tm *); -char * ctime(const time_t *); -clock_t clock(void); -double difftime(time_t, time_t); -struct tm * gmtime(const time_t *); -struct tm * localtime(const time_t *); -time_t mktime(struct tm *); -size_t strftime(char *, size_t, const char *, const struct tm *); -char * _strdate(char *); -char * _strtime(char *); -time_t time(time_t *); +char * _CRTAPI1 asctime(const struct tm *); +char * _CRTAPI1 ctime(const time_t *); +clock_t _CRTAPI1 clock(void); +double _CRTAPI1 difftime(time_t, time_t); +struct tm * _CRTAPI1 gmtime(const time_t *); +struct tm * _CRTAPI1 localtime(const time_t *); +time_t _CRTAPI1 mktime(struct tm *); +size_t _CRTAPI1 strftime(char *, size_t, const char *, const struct tm *); +char * _CRTAPI1 _strdate(char *); +char * _CRTAPI1 _strtime(char *); +time_t _CRTAPI1 time(time_t *); #ifdef _POSIX_ -void tzset(void); +void _CRTAPI1 tzset(void); #else -void _tzset(void); +void _CRTAPI1 _tzset(void); #endif -unsigned _getsystime(struct tm *); -unsigned _setsystime(struct tm *, unsigned); +unsigned _CRTAPI1 _getsystime(struct tm *); +unsigned _CRTAPI1 _setsystime(struct tm *, unsigned); #if !__STDC__ || defined(_POSIX_)