Update crt headers and mingw lib from mingw64. Update crt a bit. 4 msvcrt time tests...
[reactos.git] / reactos / include / crt / sys / utime.h
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 _INC_UTIME
7 #define _INC_UTIME
8
9 #ifndef _WIN32
10 #error Only Win32 target is supported!
11 #endif
12
13 #include <_mingw.h>
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 _WCHAR_T_DEFINED
26 typedef unsigned short wchar_t;
27 #define _WCHAR_T_DEFINED
28 #endif
29
30 #ifdef _USE_32BIT_TIME_T
31 #ifdef _WIN64
32 #undef _USE_32BIT_TIME_T
33 #endif
34 #else
35 #if _INTEGRAL_MAX_BITS < 64
36 #define _USE_32BIT_TIME_T
37 #endif
38 #endif
39
40 #ifndef _TIME32_T_DEFINED
41 #define _TIME32_T_DEFINED
42 typedef long __time32_t;
43 #endif
44
45 #ifndef _TIME64_T_DEFINED
46 #define _TIME64_T_DEFINED
47 #if _INTEGRAL_MAX_BITS >= 64
48 typedef __int64 __time64_t;
49 #endif
50 #endif
51
52 #ifndef _TIME_T_DEFINED
53 #define _TIME_T_DEFINED
54 #ifdef _USE_32BIT_TIME_T
55 typedef __time32_t time_t;
56 #else
57 typedef __time64_t time_t;
58 #endif
59 #endif
60
61 #ifndef _UTIMBUF_DEFINED
62 #define _UTIMBUF_DEFINED
63
64 struct _utimbuf {
65 time_t actime;
66 time_t modtime;
67 };
68
69 struct __utimbuf32 {
70 __time32_t actime;
71 __time32_t modtime;
72 };
73
74 #if _INTEGRAL_MAX_BITS >= 64
75 struct __utimbuf64 {
76 __time64_t actime;
77 __time64_t modtime;
78 };
79 #endif
80
81 #ifndef NO_OLDNAMES
82 struct utimbuf {
83 time_t actime;
84 time_t modtime;
85 };
86
87 struct utimbuf32 {
88 __time32_t actime;
89 __time32_t modtime;
90 };
91 #endif
92 #endif
93
94 _CRTIMP int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Time);
95 _CRTIMP int __cdecl _futime32(int _FileDes,struct __utimbuf32 *_Time);
96 _CRTIMP int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Time);
97 #if _INTEGRAL_MAX_BITS >= 64
98 _CRTIMP int __cdecl _utime64(const char *_Filename,struct __utimbuf64 *_Time);
99 _CRTIMP int __cdecl _futime64(int _FileDes,struct __utimbuf64 *_Time);
100 _CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time);
101 #endif
102
103 #ifndef RC_INVOKED
104 #ifdef _USE_32BIT_TIME_T
105 __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) {
106 return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
107 }
108 __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) {
109 return _futime32(_Desc,(struct __utimbuf32 *)_Utimbuf);
110 }
111 __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) {
112 return _wutime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
113 }
114 #else
115 __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) {
116 return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
117 }
118 __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) {
119 return _futime64(_Desc,(struct __utimbuf64 *)_Utimbuf);
120 }
121 __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) {
122 return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
123 }
124 #endif
125
126 #ifndef NO_OLDNAMES
127 #ifdef _USE_32BIT_TIME_T
128 __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) {
129 return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
130 }
131 #else
132 __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) {
133 return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
134 }
135 #endif
136 #endif
137 #endif
138
139 #ifdef __cplusplus
140 }
141 #endif
142
143 #pragma pack(pop)
144 #endif