--- mstools/h/time.h 2018/08/09 18:20:01 1.1.1.1 +++ mstools/h/time.h 2018/08/09 18:21:05 1.1.1.3 @@ -1,7 +1,7 @@ /*** *time.h - definitions/declarations for time routines * -* Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved. +* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved. * *Purpose: * This file has declarations of time routines and defines @@ -18,8 +18,35 @@ extern "C" { #endif -#if (_MSC_VER <= 600) -#define __cdecl _cdecl +/* + * 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 */ @@ -76,6 +103,27 @@ struct tm { * routines. */ +#ifdef _DLL + +#define _daylight (*_daylight_dll) +#define _timezone (*_timezone_dll) + +/* non-zero if daylight savings time is used */ +extern int * _daylight_dll; + +/* difference in seconds between GMT and local time */ +extern long * _timezone_dll; + +/* standard/daylight savings time zone names */ +extern char ** _tzname; + +#else + + +#ifdef _POSIX_ +extern char * _rule; +#endif + /* non-zero if daylight savings time is used */ extern int _daylight; @@ -83,28 +131,42 @@ extern int _daylight; extern long _timezone; /* standard/daylight savings time zone names */ +#ifdef _POSIX_ +#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 *); -void _tzset(void); -unsigned _getsystime(struct tm *); -unsigned _setsystime(struct tm *, unsigned); +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 _CRTAPI1 tzset(void); +#else +void _CRTAPI1 _tzset(void); +#endif +unsigned _CRTAPI1 _getsystime(struct tm *); +unsigned _CRTAPI1 _setsystime(struct tm *, unsigned); -#if !__STDC__ +#if !__STDC__ || defined(_POSIX_) /* Non-ANSI names for compatibility */ #define CLK_TCK CLOCKS_PER_SEC