#pragma once
#ifndef _INC_TIME // include guard for 3rd party interop
#define _INC_TIME
#include <corecrt.h>
#include <corecrt_wtime.h>
_CRT_BEGIN_C_HEADER
__pragma
(pack(push,
8
))
extern
"C"
{
typedef
long
;
struct
{
;
long
;
};
struct
{
;
long
;
};
#ifndef _CRT_NO_TIME_T
struct
{
;
long
;
};
#endif
#define CLOCKS_PER_SEC ((clock_t)1000)
#define TIME_UTC 1
_Check_return_ _CRT_INSECURE_DEPRECATE_GLOBALS(_get_daylight)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"_get_daylight"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
_ACRTIMP int* __cdecl __daylight(void);
__declspec
(dllimport)
int
*
__cdecl
(
void
);
#define _daylight (*__daylight())
_Check_return_ _CRT_INSECURE_DEPRECATE_GLOBALS(_get_dstbias)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"_get_dstbias"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
_ACRTIMP long* __cdecl __dstbias(void);
__declspec
(dllimport)
long
*
__cdecl
(
void
);
#define _dstbias (*__dstbias())
_Check_return_ _CRT_INSECURE_DEPRECATE_GLOBALS(_get_timezone)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"_get_timezone"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
_ACRTIMP long* __cdecl __timezone(void);
__declspec
(dllimport)
long
*
__cdecl
(
void
);
#define _timezone (*__timezone())
_Check_return_ _Deref_ret_z_ _CRT_INSECURE_DEPRECATE_GLOBALS(_get_tzname)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"_get_tzname"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
_ACRTIMP char** __cdecl __tzname(void);
__declspec
(dllimport)
char
**
__cdecl
(
void
);
#define _tzname (__tzname())
_Success_(_Daylight != 0)
_ACRTIMP errno_t __cdecl _get_daylight(
__declspec
(dllimport)
__cdecl
(
);
_Success_(_DaylightSavingsBias != 0)
_ACRTIMP errno_t __cdecl _get_dstbias(
__declspec
(dllimport)
__cdecl
(
_Out_ long* _DaylightSavingsBias
);
_Success_(_TimeZone != 0)
_ACRTIMP errno_t __cdecl _get_timezone(
__declspec
(dllimport)
__cdecl
(
);
_Success_(return == 0)
_ACRTIMP errno_t __cdecl _get_tzname(
__declspec
(dllimport)
__cdecl
(
_Out_ size_t* _ReturnValue,
_Out_writes_z_(_SizeInBytes) char* _Buffer,
_In_ size_t _SizeInBytes,
);
_Success_(return != 0)
_Ret_writes_z_(26)
_Check_return_ _CRT_INSECURE_DEPRECATE(asctime_s)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"asctime_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
_ACRTIMP char* __cdecl asctime(
__declspec
(dllimport)
char
*
__cdecl
(
_In_ struct tm const* _Tm
);
#if __STDC_WANT_SECURE_LIB__
_Success_(return == 0)
_Check_return_wat_
_ACRTIMP errno_t __cdecl asctime_s(
__declspec
(dllimport)
__cdecl
(
_Out_writes_(_SizeInBytes) _Post_readable_size_(26) char* _Buffer,
_In_range_(>=,26) size_t _SizeInBytes,
_In_ struct tm const* _Tm
);
#endif
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(
errno_t, asctime_s,
_Post_readable_size_(26) char, _Buffer,
_In_ struct tm const*, _Time
)
extern
"C++"
{
template
<
>
inline
__cdecl
(
char
(&
)[
],
struct
const
*
)
throw
() {
return
(
,
,
); } }
_Check_return_
_ACRTIMP clock_t __cdecl clock(void);
__declspec
(dllimport)
__cdecl
(
void
);
_Ret_z_
_Success_(return != 0)
_Check_return_ _CRT_INSECURE_DEPRECATE(_ctime32_s)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"_ctime32_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
_ACRTIMP char* __cdecl _ctime32(
__declspec
(dllimport)
char
*
__cdecl
(
_In_ __time32_t const* _Time
);
_Check_return_wat_
_ACRTIMP errno_t __cdecl _ctime32_s(
__declspec
(dllimport)
__cdecl
(
_Out_writes_(_SizeInBytes) _Post_readable_size_(26) char* _Buffer,
_In_range_(>=,26) size_t _SizeInBytes,
_In_ __time32_t const* _Time
);
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(
errno_t, _ctime32_s,
_Post_readable_size_(26) char, _Buffer,
_In_ __time32_t const*, _Time
)
extern
"C++"
{
template
<
>
inline
__cdecl
(
char
(&
)[
],
const
*
)
throw
() {
return
(
,
,
); } }
_Ret_z_
_Success_(return != 0)
_Check_return_ _CRT_INSECURE_DEPRECATE(_ctime64_s)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"_ctime64_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
_ACRTIMP char* __cdecl _ctime64(
__declspec
(dllimport)
char
*
__cdecl
(
_In_ __time64_t const* _Time
);
_Check_return_wat_
_ACRTIMP errno_t __cdecl _ctime64_s(
__declspec
(dllimport)
__cdecl
(
_Out_writes_z_(_SizeInBytes) _Post_readable_size_(26) char* _Buffer,
_In_range_(>=,26) size_t _SizeInBytes,
_In_ __time64_t const* _Time
);
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(
errno_t, _ctime64_s,
_Post_readable_size_(26) char, _Buffer,
_In_ __time64_t const*, _Time
)
extern
"C++"
{
template
<
>
inline
__cdecl
(
char
(&
)[
],
const
*
)
throw
() {
return
(
,
,
); } }
_Check_return_
_ACRTIMP double __cdecl _difftime32(
__declspec
(dllimport)
double
__cdecl
(
);
_Check_return_
_ACRTIMP double __cdecl _difftime64(
__declspec
(dllimport)
double
__cdecl
(
);
_Success_(return != 0)
_Check_return_ _CRT_INSECURE_DEPRECATE(_gmtime32_s)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"_gmtime32_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
_ACRTIMP struct tm* __cdecl _gmtime32(
__declspec
(dllimport)
struct
*
__cdecl
(
_In_ __time32_t const* _Time
);
_Check_return_wat_
_ACRTIMP errno_t __cdecl _gmtime32_s(
__declspec
(dllimport)
__cdecl
(
_In_ __time32_t const* _Time
);
_Success_(return != 0)
_Check_return_ _CRT_INSECURE_DEPRECATE(_gmtime64_s)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"_gmtime64_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
_ACRTIMP struct tm* __cdecl _gmtime64(
__declspec
(dllimport)
struct
*
__cdecl
(
_In_ __time64_t const* _Time
);
_Check_return_wat_
_ACRTIMP errno_t __cdecl _gmtime64_s(
__declspec
(dllimport)
__cdecl
(
_In_ __time64_t const* _Time
);
_Success_(return != 0)
_Check_return_ _CRT_INSECURE_DEPRECATE(_localtime32_s)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"_localtime32_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
_ACRTIMP struct tm* __cdecl _localtime32(
__declspec
(dllimport)
struct
*
__cdecl
(
_In_ __time32_t const* _Time
);
_Check_return_wat_
_ACRTIMP errno_t __cdecl _localtime32_s(
__declspec
(dllimport)
__cdecl
(
_In_ __time32_t const* _Time
);
_Success_(return != 0)
_Check_return_ _CRT_INSECURE_DEPRECATE(_localtime64_s)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"_localtime64_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
_ACRTIMP struct tm* __cdecl _localtime64(
__declspec
(dllimport)
struct
*
__cdecl
(
_In_ __time64_t const* _Time
);
_Check_return_wat_
_ACRTIMP errno_t __cdecl _localtime64_s(
__declspec
(dllimport)
__cdecl
(
_In_ __time64_t const* _Time
);
_Check_return_
_ACRTIMP __time32_t __cdecl _mkgmtime32(
__declspec
(dllimport)
__cdecl
(
);
_Check_return_
_ACRTIMP __time64_t __cdecl _mkgmtime64(
__declspec
(dllimport)
__cdecl
(
);
_Check_return_opt_
_ACRTIMP __time32_t __cdecl _mktime32(
__declspec
(dllimport)
__cdecl
(
);
_Check_return_opt_
_ACRTIMP __time64_t __cdecl _mktime64(
__declspec
(dllimport)
__cdecl
(
);
_Success_(return > 0)
_Check_return_wat_
_ACRTIMP size_t __cdecl strftime(
__declspec
(dllimport)
__cdecl
(
_Out_writes_z_(_SizeInBytes) char* _Buffer,
_In_ size_t _SizeInBytes,
_In_z_ _Printf_format_string_ char const* _Format,
_In_ struct tm const* _Tm
);
_Success_(return > 0)
_Check_return_wat_
_ACRTIMP size_t __cdecl _strftime_l(
__declspec
(dllimport)
__cdecl
(
_Out_writes_z_(_MaxSize) char* _Buffer,
_In_z_ _Printf_format_string_ char const* _Format,
_In_ struct tm const* _Tm,
_In_opt_ _locale_t _Locale
);
_Check_return_wat_
_ACRTIMP errno_t __cdecl _strdate_s(
__declspec
(dllimport)
__cdecl
(
_Out_writes_(_SizeInBytes) _When_(_SizeInBytes >=9, _Post_readable_size_(9)) char* _Buffer,
);
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(
errno_t, _strdate_s,
_Post_readable_size_(9) char, _Buffer
)
extern
"C++"
{
template
<
>
inline
__cdecl
(
char
(&
)[
])
throw
() {
return
(
,
); } }
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0(
_Success_(return != 0) char*, __RETURN_POLICY_DST, _ACRTIMP, _strdate,
_Out_writes_z_(9), char, _Buffer
)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"_strdate_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
__declspec
(dllimport)
char
*
__cdecl
(
char
*
);
_Check_return_wat_
_ACRTIMP errno_t __cdecl _strtime_s(
__declspec
(dllimport)
__cdecl
(
_Out_writes_(_SizeInBytes) _When_(_SizeInBytes >=9, _Post_readable_size_(9)) char* _Buffer,
);
__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(
errno_t, _strtime_s,
_Post_readable_size_(9) char, _Buffer
)
extern
"C++"
{
template
<
>
inline
__cdecl
(
char
(&
)[
])
throw
() {
return
(
,
); } }
__DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0(
char*, __RETURN_POLICY_DST, _ACRTIMP, _strtime,
_Out_writes_z_(9), char, _Buffer
)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"_strtime_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
__declspec
(dllimport)
char
*
__cdecl
(
char
*
);
_ACRTIMP __time32_t __cdecl _time32(
__declspec
(dllimport)
__cdecl
(
_Out_opt_ __time32_t* _Time
);
_ACRTIMP __time64_t __cdecl _time64(
__declspec
(dllimport)
__cdecl
(
_Out_opt_ __time64_t* _Time
);
_Success_(return != 0)
_Check_return_
_ACRTIMP int __cdecl _timespec32_get(
__declspec
(dllimport)
int
__cdecl
(
_Out_ struct _timespec32* _Ts,
);
_Success_(return != 0)
_Check_return_
_ACRTIMP int __cdecl _timespec64_get(
__declspec
(dllimport)
int
__cdecl
(
_Out_ struct _timespec64* _Ts,
);
#ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
_ACRTIMP void __cdecl _tzset(void);
__declspec
(dllimport)
void
__cdecl
(
void
);
_CRT_OBSOLETE(GetLocalTime)
__declspec
(deprecated(
"This function or variable has been superceded by newer library "
"or operating system functionality. Consider using "
"GetLocalTime"
" "
"instead. See online help for details."
))
_DCRTIMP unsigned __cdecl _getsystime(
__declspec
(dllimport)
unsigned
__cdecl
(
);
_CRT_OBSOLETE(SetLocalTime)
__declspec
(deprecated(
"This function or variable has been superceded by newer library "
"or operating system functionality. Consider using "
"SetLocalTime"
" "
"instead. See online help for details."
))
_DCRTIMP unsigned __cdecl _setsystime(
__declspec
(dllimport)
unsigned
__cdecl
(
_In_ unsigned _Milliseconds
);
#endif
#if !defined RC_INVOKED && !defined __midl && !defined _INC_TIME_INL && !defined _CRT_NO_TIME_T
#ifdef _USE_32BIT_TIME_T
_Check_return_ _CRT_INSECURE_DEPRECATE(ctime_s)
static __inline char* __CRTDECL ctime(
_In_ time_t const* const _Time
)
{
#pragma warning(push)
#pragma warning(disable: 4996)
return _ctime32(_Time);
#pragma warning(pop)
}
_Check_return_
static __inline double __CRTDECL difftime(
_In_ time_t const _Time1,
_In_ time_t const _Time2
)
{
return _difftime32(_Time1, _Time2);
}
_Check_return_ _CRT_INSECURE_DEPRECATE(gmtime_s)
static __inline struct tm* __CRTDECL gmtime(
_In_ time_t const* const _Time
)
{
#pragma warning(push)
#pragma warning(disable: 4996)
return _gmtime32(_Time);
#pragma warning(pop)
}
_Check_return_ _CRT_INSECURE_DEPRECATE(localtime_s)
static __inline struct tm* __CRTDECL localtime(
_In_ time_t const* const _Time
)
{
#pragma warning(push)
#pragma warning(disable: 4996)
return _localtime32(_Time);
#pragma warning(pop)
}
_Check_return_
static __inline time_t __CRTDECL _mkgmtime(
_Inout_ struct tm* const _Tm
)
{
return _mkgmtime32(_Tm);
}
_Check_return_opt_
static __inline time_t __CRTDECL mktime(
_Inout_ struct tm* const _Tm
)
{
return _mktime32(_Tm);
}
static __inline time_t __CRTDECL time(
_Out_opt_ time_t* const _Time
)
{
return _time32(_Time);
}
_Check_return_
static __inline int __CRTDECL timespec_get(
_Out_ struct timespec* const _Ts,
_In_ int const _Base
)
{
return _timespec32_get((struct _timespec32*)_Ts, _Base);
}
#if __STDC_WANT_SECURE_LIB__
_Check_return_wat_
static __inline errno_t __CRTDECL ctime_s(
_Out_writes_(_SizeInBytes) _Post_readable_size_(26) char* const _Buffer,
_In_range_(>=,26) size_t const _SizeInBytes,
_In_ time_t const* const _Time
)
{
return _ctime32_s(_Buffer, _SizeInBytes, _Time);
}
_Check_return_wat_
static __inline errno_t __CRTDECL gmtime_s(
_Out_ struct tm* const _Tm,
_In_ time_t const* const _Time
)
{
return _gmtime32_s(_Tm, _Time);
}
_Check_return_wat_
static __inline errno_t __CRTDECL localtime_s(
_Out_ struct tm* const _Tm,
_In_ time_t const* const _Time
)
{
return _localtime32_s(_Tm, _Time);
}
#endif
#else // ^^^ _USE_32BIT_TIME_T ^^^ // vvv !_USE_32BIT_TIME_T vvv
_Check_return_ _CRT_INSECURE_DEPRECATE(ctime_s)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"ctime_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
static __inline char* __CRTDECL ctime(
static
__inline
char
*
__cdecl
(
_In_ time_t const* const _Time
)
{
#pragma warning(push)
#pragma warning(push)
#pragma warning(disable: 4996)
#pragma warning(disable:
4996
)
return
(
);
#pragma warning(pop)
#pragma warning(pop)
}
_Check_return_
static __inline double __CRTDECL difftime(
static
__inline
double
__cdecl
(
_In_ time_t const _Time1,
)
{
return
(
,
);
}
_Check_return_ _CRT_INSECURE_DEPRECATE(gmtime_s)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"gmtime_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
static __inline struct tm* __CRTDECL gmtime(
static
__inline
struct
*
__cdecl
(
_In_ time_t const* const _Time)
{
#pragma warning(push)
#pragma warning(push)
#pragma warning(disable: 4996)
#pragma warning(disable:
4996
)
return
(
);
#pragma warning(pop)
#pragma warning(pop)
}
_CRT_INSECURE_DEPRECATE(localtime_s)
__declspec
(deprecated(
"This function or variable may be unsafe. Consider using "
"localtime_s"
" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "
"See online help for details."
))
static __inline struct tm* __CRTDECL localtime(
static
__inline
struct
*
__cdecl
(
_In_ time_t const* const _Time
)
{
#pragma warning(push)
#pragma warning(push)
#pragma warning(disable: 4996)
#pragma warning(disable:
4996
)
return
(
);
#pragma warning(pop)
#pragma warning(pop)
}
_Check_return_
static __inline time_t __CRTDECL _mkgmtime(
static
__inline
__cdecl
(
_Inout_ struct tm* const _Tm
)
{
return
(
);
}
_Check_return_opt_
static __inline time_t __CRTDECL mktime(
static
__inline
__cdecl
(
_Inout_ struct tm* const _Tm
)
{
return
(
);
}
static __inline time_t __CRTDECL time(
static
__inline
__cdecl
(
_Out_opt_ time_t* const _Time
)
{
return
(
);
}
_Check_return_
static __inline int __CRTDECL timespec_get(
static
__inline
int
__cdecl
(
_Out_ struct timespec* const _Ts,
)
{
return
((
struct
*)
,
);
}
#if __STDC_WANT_SECURE_LIB__
_Check_return_wat_
static __inline errno_t __CRTDECL ctime_s(
static
__inline
__cdecl
(
_Out_writes_(_SizeInBytes) _Post_readable_size_(26) char* const _Buffer,
_In_range_(>=,26) size_t const _SizeInBytes,
_In_ time_t const* const _Time
)
{
return
(
,
,
);
}
_Check_return_wat_
static __inline errno_t __CRTDECL gmtime_s(
static
__inline
__cdecl
(
_Out_ struct tm* const _Tm,
_In_ time_t const* const _Time
)
{
return
(
,
);
}
_Check_return_wat_
static __inline errno_t __CRTDECL localtime_s(
static
__inline
__cdecl
(
_Out_ struct tm* const _Tm,
_In_ time_t const* const _Time
)
{
return
(
,
);
}
#endif
#endif // !_USE_32BIT_TIME_T
#endif
#if _CRT_INTERNAL_NONSTDC_NAMES
#define CLK_TCK CLOCKS_PER_SEC
#ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
_CRT_NONSTDC_DEPRECATE(_tzset) _ACRTIMP void __cdecl tzset(void);
#endif
__declspec
(deprecated(
"The POSIX name for this item is deprecated. Instead, use the ISO C "
"and C++ conformant name: "
"_tzset"
". See online help for details."
))
__declspec
(dllimport)
void
__cdecl
(
void
);
#endif // _CRT_INTERNAL_NONSTDC_NAMES
_CRT_END_C_HEADER
#endif // _INC_TIME