• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
9 #include <crtdefs.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 #ifdef _USE_32BIT_TIME_T
26 #ifdef _WIN64
27 #undef _USE_32BIT_TIME_T
28 #endif
29 #endif
30 
31 #ifndef _TIME32_T_DEFINED
32   typedef long __time32_t;
33 #define _TIME32_T_DEFINED
34 #endif
35 
36 #ifndef _TIME64_T_DEFINED
37   __MINGW_EXTENSION typedef __int64 __time64_t;
38 #define _TIME64_T_DEFINED
39 #endif
40 
41 #ifndef _TIME_T_DEFINED
42 #ifdef _USE_32BIT_TIME_T
43   typedef __time32_t time_t;
44 #else
45   typedef __time64_t time_t;
46 #endif
47 #define _TIME_T_DEFINED
48 #endif
49 
50 #ifndef _TIMEB_DEFINED
51 #define _TIMEB_DEFINED
52 
53   struct __timeb32 {
54     __time32_t time;
55     unsigned short millitm;
56     short timezone;
57     short dstflag;
58   };
59 
60 #ifndef	NO_OLDNAMES
61   struct timeb {
62     time_t time;
63     unsigned short millitm;
64     short timezone;
65     short dstflag;
66   };
67 #endif
68 
69   struct __timeb64 {
70     __time64_t time;
71     unsigned short millitm;
72     short timezone;
73     short dstflag;
74   };
75 
76 #endif
77 
78   _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time);
79   _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time);
80 
81 #ifndef _USE_32BIT_TIME_T
82 #define _timeb __timeb64
83 #define _ftime _ftime64
84 #else
85 #define _timeb __timeb32
86 #define _ftime _ftime32
87 #endif
88 
89 #ifndef _TIMESPEC_DEFINED
90 #define _TIMESPEC_DEFINED
91 struct timespec {
92   time_t  tv_sec;   /* Seconds */
93   long    tv_nsec;  /* Nanoseconds */
94 };
95 
96 struct itimerspec {
97   struct timespec  it_interval;  /* Timer period */
98   struct timespec  it_value;     /* Timer expiration */
99 };
100 #endif
101 
102 #if !defined (RC_INVOKED) && !defined (NO_OLDNAMES)
103   void __cdecl ftime (struct timeb *);
104 
105 #ifndef __CRT__NO_INLINE
106   /* TODO: Avoid structure cast here !!!! */
107 #ifndef _USE_32BIT_TIME_T
ftime(struct timeb * _Tmb)108   __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
109     _ftime64((struct __timeb64 *)_Tmb);
110   }
111 #else
ftime(struct timeb * _Tmb)112   __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
113     _ftime32((struct __timeb32 *)_Tmb);
114   }
115 #endif /* _USE_32BIT_TIME_T */
116 #endif /* !__CRT__NO_INLINE */
117 #endif
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #pragma pack(pop)
124 
125 #include <sec_api/sys/timeb_s.h>
126 #endif
127