timeb.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 _TIMEB_H_
  7. #define _TIMEB_H_
  8. #include <_mingw.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. #ifndef __TINYC__ /* gr */
  20. #ifdef _USE_32BIT_TIME_T
  21. #ifdef _WIN64
  22. #undef _USE_32BIT_TIME_T
  23. #endif
  24. #else
  25. #if _INTEGRAL_MAX_BITS < 64
  26. #define _USE_32BIT_TIME_T
  27. #endif
  28. #endif
  29. #endif
  30. #ifndef _TIME32_T_DEFINED
  31. typedef long __time32_t;
  32. #define _TIME32_T_DEFINED
  33. #endif
  34. #ifndef _TIME64_T_DEFINED
  35. #if _INTEGRAL_MAX_BITS >= 64
  36. typedef __int64 __time64_t;
  37. #endif
  38. #define _TIME64_T_DEFINED
  39. #endif
  40. #ifndef _TIME_T_DEFINED
  41. #ifdef _USE_32BIT_TIME_T
  42. typedef __time32_t time_t;
  43. #else
  44. typedef __time64_t time_t;
  45. #endif
  46. #define _TIME_T_DEFINED
  47. #endif
  48. #ifndef _TIMEB_DEFINED
  49. #define _TIMEB_DEFINED
  50. struct __timeb32 {
  51. __time32_t time;
  52. unsigned short millitm;
  53. short timezone;
  54. short dstflag;
  55. };
  56. #ifndef NO_OLDNAMES
  57. struct timeb {
  58. time_t time;
  59. unsigned short millitm;
  60. short timezone;
  61. short dstflag;
  62. };
  63. #endif
  64. #if _INTEGRAL_MAX_BITS >= 64
  65. struct __timeb64 {
  66. __time64_t time;
  67. unsigned short millitm;
  68. short timezone;
  69. short dstflag;
  70. };
  71. #endif
  72. #ifdef _USE_32BIT_TIME_T
  73. #define _timeb __timeb32
  74. //gr #define _ftime _ftime32
  75. #define _ftime32 _ftime
  76. #else
  77. #define _timeb __timeb64
  78. #define _ftime _ftime64
  79. #endif
  80. #endif
  81. _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time);
  82. #if _INTEGRAL_MAX_BITS >= 64
  83. _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time);
  84. #endif
  85. #ifndef _TIMESPEC_DEFINED
  86. #define _TIMESPEC_DEFINED
  87. struct timespec {
  88. time_t tv_sec; /* Seconds */
  89. long tv_nsec; /* Nanoseconds */
  90. };
  91. struct itimerspec {
  92. struct timespec it_interval; /* Timer period */
  93. struct timespec it_value; /* Timer expiration */
  94. };
  95. #endif
  96. #if !defined (RC_INVOKED) && !defined (NO_OLDNAMES)
  97. #ifdef _USE_32BIT_TIME_T
  98. __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
  99. _ftime32((struct __timeb32 *)_Tmb);
  100. }
  101. #else
  102. __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
  103. _ftime64((struct __timeb64 *)_Tmb);
  104. }
  105. #endif
  106. #endif
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110. #pragma pack(pop)
  111. #include <sec_api/sys/timeb_s.h>
  112. #endif