b2281beb9ab3bc69d45b947ffd97ea9eb84f3661
[tinycc.git] / win32 / include / sys / timeb.h
blobb2281beb9ab3bc69d45b947ffd97ea9eb84f3661
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_
9 #include <_mingw.h>
11 #ifndef _WIN32
12 #error Only Win32 target is supported!
13 #endif
15 #pragma pack(push,_CRT_PACKING)
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
21 #ifndef _CRTIMP
22 #define _CRTIMP __declspec(dllimport)
23 #endif
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
37 #ifndef _TIME32_T_DEFINED
38 typedef long __time32_t;
39 #define _TIME32_T_DEFINED
40 #endif
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
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
58 #ifndef _TIMEB_DEFINED
59 #define _TIMEB_DEFINED
61 struct __timeb32 {
62 __time32_t time;
63 unsigned short millitm;
64 short timezone;
65 short dstflag;
68 #ifndef NO_OLDNAMES
69 struct timeb {
70 time_t time;
71 unsigned short millitm;
72 short timezone;
73 short dstflag;
75 #endif
77 #if _INTEGRAL_MAX_BITS >= 64
78 struct __timeb64 {
79 __time64_t time;
80 unsigned short millitm;
81 short timezone;
82 short dstflag;
84 #endif
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
96 _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time);
97 #if _INTEGRAL_MAX_BITS >= 64
98 _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time);
99 #endif
101 #ifndef _TIMESPEC_DEFINED
102 #define _TIMESPEC_DEFINED
103 struct timespec {
104 time_t tv_sec; /* Seconds */
105 long tv_nsec; /* Nanoseconds */
108 struct itimerspec {
109 struct timespec it_interval; /* Timer period */
110 struct timespec it_value; /* Timer expiration */
112 #endif
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);
119 #else
120 __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
121 _ftime64((struct __timeb64 *)_Tmb);
123 #endif
124 #endif
126 #ifdef __cplusplus
128 #endif
130 #pragma pack(pop)
132 #include <sec_api/sys/timeb_s.h>
133 #endif