timeb.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _TIMEB_H_
  7. #define _TIMEB_H_
  8. #include <crtdefs.h>
  9. #ifndef _WIN32
  10. #error Only Win32 target is supported!
  11. #endif
  12. #pragma pack(push,_CRT_PACKING)
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #ifndef _CRTIMP
  17. #define _CRTIMP __declspec(dllimport)
  18. #endif
  19. #ifdef _USE_32BIT_TIME_T
  20. #ifdef _WIN64
  21. #undef _USE_32BIT_TIME_T
  22. #endif
  23. #endif
  24. #ifndef _TIME32_T_DEFINED
  25. typedef long __time32_t;
  26. #define _TIME32_T_DEFINED
  27. #endif
  28. #ifndef _TIME64_T_DEFINED
  29. __MINGW_EXTENSION typedef __int64 __time64_t;
  30. #define _TIME64_T_DEFINED
  31. #endif
  32. #ifndef _TIME_T_DEFINED
  33. #ifdef _USE_32BIT_TIME_T
  34. typedef __time32_t time_t;
  35. #else
  36. typedef __time64_t time_t;
  37. #endif
  38. #define _TIME_T_DEFINED
  39. #endif
  40. #ifndef _TIMEB_DEFINED
  41. #define _TIMEB_DEFINED
  42. struct __timeb32 {
  43. __time32_t time;
  44. unsigned short millitm;
  45. short timezone;
  46. short dstflag;
  47. };
  48. #ifndef NO_OLDNAMES
  49. struct timeb {
  50. time_t time;
  51. unsigned short millitm;
  52. short timezone;
  53. short dstflag;
  54. };
  55. #endif
  56. struct __timeb64 {
  57. __time64_t time;
  58. unsigned short millitm;
  59. short timezone;
  60. short dstflag;
  61. };
  62. #endif
  63. _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time);
  64. _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time);
  65. #ifndef _USE_32BIT_TIME_T
  66. #define _timeb __timeb64
  67. #define _ftime _ftime64
  68. #else
  69. #define _timeb __timeb32
  70. #define _ftime _ftime32
  71. #endif
  72. struct _timespec32 {
  73. __time32_t tv_sec;
  74. long tv_nsec;
  75. };
  76. struct _timespec64 {
  77. __time64_t tv_sec;
  78. long tv_nsec;
  79. };
  80. #ifndef _TIMESPEC_DEFINED
  81. #define _TIMESPEC_DEFINED
  82. struct timespec {
  83. time_t tv_sec; /* Seconds */
  84. long tv_nsec; /* Nanoseconds */
  85. };
  86. struct itimerspec {
  87. struct timespec it_interval; /* Timer period */
  88. struct timespec it_value; /* Timer expiration */
  89. };
  90. #endif
  91. #if !defined (RC_INVOKED) && !defined (NO_OLDNAMES)
  92. void __cdecl ftime (struct timeb *);
  93. #ifndef __CRT__NO_INLINE
  94. /* TODO: Avoid structure cast here !!!! */
  95. #ifndef _USE_32BIT_TIME_T
  96. __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
  97. _ftime64((struct __timeb64 *)_Tmb);
  98. }
  99. #else
  100. __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
  101. _ftime32((struct __timeb32 *)_Tmb);
  102. }
  103. #endif /* _USE_32BIT_TIME_T */
  104. #endif /* !__CRT__NO_INLINE */
  105. #endif
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109. #pragma pack(pop)
  110. #include <sec_api/sys/timeb_s.h>
  111. #endif