time_s.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the w64 mingw-runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER within this package.
  5. */
  6. #ifndef _TIME_H__S
  7. #define _TIME_H__S
  8. #include <time.h>
  9. #if defined(MINGW_HAS_SECURE_API)
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. _CRTIMP errno_t __cdecl _ctime32_s(char *_Buf,size_t _SizeInBytes,const __time32_t *_Time);
  14. _CRTIMP errno_t __cdecl _gmtime32_s(struct tm *_Tm,const __time32_t *_Time);
  15. _CRTIMP errno_t __cdecl _localtime32_s(struct tm *_Tm,const __time32_t *_Time);
  16. _CRTIMP errno_t __cdecl _strdate_s(char *_Buf,size_t _SizeInBytes);
  17. _CRTIMP errno_t __cdecl _strtime_s(char *_Buf ,size_t _SizeInBytes);
  18. #if _INTEGRAL_MAX_BITS >= 64
  19. _CRTIMP errno_t __cdecl _ctime64_s(char *_Buf,size_t _SizeInBytes,const __time64_t *_Time);
  20. _CRTIMP errno_t __cdecl _gmtime64_s(struct tm *_Tm,const __time64_t *_Time);
  21. _CRTIMP errno_t __cdecl _localtime64_s(struct tm *_Tm,const __time64_t *_Time);
  22. #endif
  23. #ifndef _WTIME_S_DEFINED
  24. #define _WTIME_S_DEFINED
  25. _CRTIMP errno_t __cdecl _wasctime_s(wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm);
  26. _CRTIMP errno_t __cdecl _wctime32_s(wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time);
  27. _CRTIMP errno_t __cdecl _wstrdate_s(wchar_t *_Buf,size_t _SizeInWords);
  28. _CRTIMP errno_t __cdecl _wstrtime_s(wchar_t *_Buf,size_t _SizeInWords);
  29. #if _INTEGRAL_MAX_BITS >= 64
  30. _CRTIMP errno_t __cdecl _wctime64_s(wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time);
  31. #endif
  32. #if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL)
  33. #define _INC_WTIME_S_INL
  34. #ifdef _USE_32BIT_TIME_T
  35. __CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s(_Buffer,_SizeInWords,_Time); }
  36. #else
  37. __CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s(_Buffer,_SizeInWords,_Time); }
  38. #endif
  39. #endif
  40. #endif
  41. #ifndef RC_INVOKED
  42. #ifdef _USE_32BIT_TIME_T
  43. __CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime32_s(_Tm,_Time); }
  44. #else
  45. __CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime64_s(_Tm,_Time); }
  46. #endif
  47. #endif
  48. #ifdef __cplusplus
  49. }
  50. #endif
  51. #endif
  52. #endif