Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  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.  
  9. #include <_mingw.h>
  10.  
  11. #ifndef _WIN32
  12. #error Only Win32 target is supported!
  13. #endif
  14.  
  15. #pragma pack(push,_CRT_PACKING)
  16.  
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20.  
  21. #ifndef _CRTIMP
  22. #define _CRTIMP __declspec(dllimport)
  23. #endif
  24.  
  25. #ifndef __TINYC__ /* gr */
  26. #ifdef _USE_32BIT_TIME_T
  27. #ifdef _WIN64
  28. #undef _USE_32BIT_TIME_T
  29. #endif
  30. #else
  31. #if _INTEGRAL_MAX_BITS < 64
  32. #define _USE_32BIT_TIME_T
  33. #endif
  34. #endif
  35. #endif
  36.  
  37. #ifndef _TIME32_T_DEFINED
  38.   typedef long __time32_t;
  39. #define _TIME32_T_DEFINED
  40. #endif
  41.  
  42. #ifndef _TIME64_T_DEFINED
  43. #if _INTEGRAL_MAX_BITS >= 64
  44.   typedef __int64 __time64_t;
  45. #endif
  46. #define _TIME64_T_DEFINED
  47. #endif
  48.  
  49. #ifndef _TIME_T_DEFINED
  50. #ifdef _USE_32BIT_TIME_T
  51.   typedef __time32_t time_t;
  52. #else
  53.   typedef __time64_t time_t;
  54. #endif
  55. #define _TIME_T_DEFINED
  56. #endif
  57.  
  58. #ifndef _TIMEB_DEFINED
  59. #define _TIMEB_DEFINED
  60.  
  61.   struct __timeb32 {
  62.     __time32_t time;
  63.     unsigned short millitm;
  64.     short timezone;
  65.     short dstflag;
  66.   };
  67.  
  68. #ifndef NO_OLDNAMES
  69.   struct timeb {
  70.     time_t time;
  71.     unsigned short millitm;
  72.     short timezone;
  73.     short dstflag;
  74.   };
  75. #endif
  76.  
  77. #if _INTEGRAL_MAX_BITS >= 64
  78.   struct __timeb64 {
  79.     __time64_t time;
  80.     unsigned short millitm;
  81.     short timezone;
  82.     short dstflag;
  83.   };
  84. #endif
  85.  
  86. #ifdef _USE_32BIT_TIME_T
  87. #define _timeb __timeb32
  88. //gr #define _ftime _ftime32
  89. #define _ftime32 _ftime
  90. #else
  91. #define _timeb __timeb64
  92. #define _ftime _ftime64
  93. #endif
  94. #endif
  95.  
  96.   _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time);
  97. #if _INTEGRAL_MAX_BITS >= 64
  98.   _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time);
  99. #endif
  100.  
  101. #ifndef _TIMESPEC_DEFINED
  102. #define _TIMESPEC_DEFINED
  103. struct timespec {
  104.   time_t  tv_sec;   /* Seconds */
  105.   long    tv_nsec;  /* Nanoseconds */
  106. };
  107.  
  108. struct itimerspec {
  109.   struct timespec  it_interval;  /* Timer period */
  110.   struct timespec  it_value;     /* Timer expiration */
  111. };
  112. #endif
  113.  
  114. #if !defined (RC_INVOKED) && !defined (NO_OLDNAMES)
  115. #ifdef _USE_32BIT_TIME_T
  116. __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
  117.   _ftime32((struct __timeb32 *)_Tmb);
  118. }
  119. #else
  120. __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
  121.   _ftime64((struct __timeb64 *)_Tmb);
  122. }
  123. #endif
  124. #endif
  125.  
  126. #ifdef __cplusplus
  127. }
  128. #endif
  129.  
  130. #pragma pack(pop)
  131.  
  132. #include <sec_api/sys/timeb_s.h>
  133. #endif
  134.