• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

The MinGW.org Windows System Libraries


Commit MetaInfo

Revisãoaba8deb8b99df5cd66497e292856e63b66aada61 (tree)
Hora2013-06-08 08:06:19
AutorEarnie Boyd <earnie@user...>
CommiterEarnie Boyd

Mensagem de Log

Miscellaneous changes toward finalizing the _USE_32BIT_TIME_T debacle.

Mudança Sumário

Diff

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
1+2013-06-07 Earnie Boyd <earnie@users.sourceforge.net>
2+
3+ * include/_mingw.h (_CRTALIAS): Add comments explaining its purpose.
4+ (__CRT_MAYBE_INLINE): New macro that may be defined as __CRT_INLINE or
5+ empty depending on __NO_INLINE__.
6+ * include/stat.h (_fstat64i32(), _fstat32i64(), _stat64i32(),
7+ _stat32i64(), _wstat64i32(), _wstat32i64()): Use __CRT_MAYBE_INLINE
8+ instead of guarding with __NO_INLINE__ since the functions need to be
9+ always created.
10+ * include/wchar.h (_utimbuf, _utimbuf32, _utimbuf64, _wutime(),
11+ _wutime32(), _wutime64()): MSDN declares these can be declared/defined
12+ by including wchar.h.
13+ * include/utime.h: Care for _USE_32BIT_TIME_T in same fashion as time.h.
14+
15+
116 2013-06-07 Jan Nijtmans <nijtmans@users.sourceforge.net>
217
318 * include/time.h: Correct typos. Add MSVCRT_VERSION >= 800 guard for
--- a/include/_mingw.h
+++ b/include/_mingw.h
@@ -195,8 +195,22 @@
195195 # endif
196196 #endif
197197
198+/* _CRTALIAS will be used when we have a function whose purpose is to return
199+ * the value of a similar function. This alias function will contain one line
200+ * of code.
201+ */
198202 #define _CRTALIAS __CRT_INLINE __attribute__ ((__always_inline__))
199203
204+/* __CRT_MAYBE_INLINE is to be used when we provide functions in the headers
205+ * to provide compatibility between differing versions of MSVCRT.DLL for
206+ * differing OS versions. See stat.h for examples.
207+ */
208+#ifndef __NO_INLINE__
209+#define __CRT_MAYBE_INLINE __CRT_INLINE
210+#else /* def __NO_INLINE__ */
211+#define __CRT_MAYBE_INLINE
212+#endif /* ndef __NO_INLINE__ */
213+
200214 #ifdef __cplusplus
201215 # define BEGIN_C_DECLS extern "C" {
202216 # define __UNUSED_PARAM(x)
--- a/include/sys/stat.h
+++ b/include/sys/stat.h
@@ -193,98 +193,90 @@ _CRTALIAS int __cdecl __MINGW_NOTHROW _fstat32 (int _v1, struct _stat32* _v2) {
193193 _CRTIMP int __cdecl __MINGW_NOTHROW _fstat64 (int, struct _stat64*);
194194 int __cdecl __MINGW_NOTHROW _fstat32i64 (int, struct _stat32i64*);
195195 int __cdecl __MINGW_NOTHROW _fstat64i32 (int, struct _stat64i32*);
196-#ifndef __NO_INLINE__
197196 #include <string.h> /* Need memset declaration */
198- __CRT_INLINE int __cdecl _fstat64i32(int desc, struct _stat64i32 *_stat)
199- {
200- struct _stat64 st;
201- int ret = _fstat64(desc, &st);
202- if (ret == -1) {
203- memset(_stat, 0, sizeof(struct _stat64i32));
204- return -1;
205- }
206- _stat->st_dev = st.st_dev;
207- _stat->st_ino = st.st_ino;
208- _stat->st_mode = st.st_mode;
209- _stat->st_nlink = st.st_nlink;
210- _stat->st_uid = st.st_uid;
211- _stat->st_gid = st.st_gid;
212- _stat->st_rdev = st.st_rdev;
213- _stat->st_size = (_off_t) st.st_size;
214- _stat->st_atime = st.st_atime;
215- _stat->st_mtime = st.st_mtime;
216- _stat->st_ctime = st.st_ctime;
217- return ret;
197+__CRT_MAYBE_INLINE int __cdecl _fstat64i32(int desc, struct _stat64i32 *_stat) {
198+ struct _stat64 st;
199+ int ret = _fstat64(desc, &st);
200+ if (ret == -1) {
201+ memset(_stat, 0, sizeof(struct _stat64i32));
202+ return -1;
218203 }
219- __CRT_INLINE int __cdecl _fstat32i64(int desc, struct _stat32i64 *_stat)
220- {
221- struct _stat32 st;
222- int ret = _fstat32(desc, &st);
223- if (ret == -1) {
224- memset(_stat, 0, sizeof(struct _stat32i64));
225- return -1;
226- }
227- _stat->st_dev = st.st_dev;
228- _stat->st_ino = st.st_ino;
229- _stat->st_mode = st.st_mode;
230- _stat->st_nlink = st.st_nlink;
231- _stat->st_uid = st.st_uid;
232- _stat->st_gid = st.st_gid;
233- _stat->st_rdev = st.st_rdev;
234- _stat->st_size = (_off_t) st.st_size;
235- _stat->st_atime = st.st_atime;
236- _stat->st_mtime = st.st_mtime;
237- _stat->st_ctime = st.st_ctime;
238- return ret;
204+ _stat->st_dev = st.st_dev;
205+ _stat->st_ino = st.st_ino;
206+ _stat->st_mode = st.st_mode;
207+ _stat->st_nlink = st.st_nlink;
208+ _stat->st_uid = st.st_uid;
209+ _stat->st_gid = st.st_gid;
210+ _stat->st_rdev = st.st_rdev;
211+ _stat->st_size = (_off_t) st.st_size;
212+ _stat->st_atime = st.st_atime;
213+ _stat->st_mtime = st.st_mtime;
214+ _stat->st_ctime = st.st_ctime;
215+ return ret;
216+}
217+__CRT_MAYBE_INLINE int __cdecl _fstat32i64(int desc, struct _stat32i64 *_stat)
218+{
219+ struct _stat32 st;
220+ int ret = _fstat32(desc, &st);
221+ if (ret == -1) {
222+ memset(_stat, 0, sizeof(struct _stat32i64));
223+ return -1;
239224 }
240- __CRT_INLINE int __cdecl _stat64i32(const char *fname, struct _stat64i32 *_stat)
241- {
242- struct _stat64 st;
243- int ret = _stat64(fname, &st);
244- if (ret == -1) {
245- memset(_stat, 0, sizeof(struct _stat64i32));
246- return -1;
247- }
248- _stat->st_dev = st.st_dev;
249- _stat->st_ino = st.st_ino;
250- _stat->st_mode = st.st_mode;
251- _stat->st_nlink = st.st_nlink;
252- _stat->st_uid = st.st_uid;
253- _stat->st_gid = st.st_gid;
254- _stat->st_rdev = st.st_rdev;
255- _stat->st_size = (_off_t) st.st_size;
256- _stat->st_atime = st.st_atime;
257- _stat->st_mtime = st.st_mtime;
258- _stat->st_ctime = st.st_ctime;
259- return ret;
225+ _stat->st_dev = st.st_dev;
226+ _stat->st_ino = st.st_ino;
227+ _stat->st_mode = st.st_mode;
228+ _stat->st_nlink = st.st_nlink;
229+ _stat->st_uid = st.st_uid;
230+ _stat->st_gid = st.st_gid;
231+ _stat->st_rdev = st.st_rdev;
232+ _stat->st_size = (_off_t) st.st_size;
233+ _stat->st_atime = st.st_atime;
234+ _stat->st_mtime = st.st_mtime;
235+ _stat->st_ctime = st.st_ctime;
236+ return ret;
237+}
238+__CRT_MAYBE_INLINE int __cdecl _stat64i32(const char *fname, struct _stat64i32 *_stat)
239+{
240+ struct _stat64 st;
241+ int ret = _stat64(fname, &st);
242+ if (ret == -1) {
243+ memset(_stat, 0, sizeof(struct _stat64i32));
244+ return -1;
260245 }
261- __CRT_INLINE int __cdecl _stat32i64(const char *fname, struct _stat32i64 *_stat)
262- {
263- struct _stat32 st;
264- int ret = _stat32(fname, &st);
265- if (ret == -1) {
266- memset(_stat, 0, sizeof(struct _stat32i64));
267- return -1;
268- }
269- _stat->st_dev = st.st_dev;
270- _stat->st_ino = st.st_ino;
271- _stat->st_mode = st.st_mode;
272- _stat->st_nlink = st.st_nlink;
273- _stat->st_uid = st.st_uid;
274- _stat->st_gid = st.st_gid;
275- _stat->st_rdev = st.st_rdev;
276- _stat->st_size = (_off_t) st.st_size;
277- _stat->st_atime = st.st_atime;
278- _stat->st_mtime = st.st_mtime;
279- _stat->st_ctime = st.st_ctime;
280- return ret;
246+ _stat->st_dev = st.st_dev;
247+ _stat->st_ino = st.st_ino;
248+ _stat->st_mode = st.st_mode;
249+ _stat->st_nlink = st.st_nlink;
250+ _stat->st_uid = st.st_uid;
251+ _stat->st_gid = st.st_gid;
252+ _stat->st_rdev = st.st_rdev;
253+ _stat->st_size = (_off_t) st.st_size;
254+ _stat->st_atime = st.st_atime;
255+ _stat->st_mtime = st.st_mtime;
256+ _stat->st_ctime = st.st_ctime;
257+ return ret;
258+}
259+__CRT_MAYBE_INLINE int __cdecl _stat32i64(const char *fname, struct _stat32i64 *_stat)
260+{
261+ struct _stat32 st;
262+ int ret = _stat32(fname, &st);
263+ if (ret == -1) {
264+ memset(_stat, 0, sizeof(struct _stat32i64));
265+ return -1;
281266 }
282-#else
283-#define _stat32i64 _stat32
284-#define _fstat32i64 _fstat32
285-#define _stat64i32 _stat64
286-#define _fstat64i32 _fstat64
287-#endif
267+ _stat->st_dev = st.st_dev;
268+ _stat->st_ino = st.st_ino;
269+ _stat->st_mode = st.st_mode;
270+ _stat->st_nlink = st.st_nlink;
271+ _stat->st_uid = st.st_uid;
272+ _stat->st_gid = st.st_gid;
273+ _stat->st_rdev = st.st_rdev;
274+ _stat->st_size = (_off_t) st.st_size;
275+ _stat->st_atime = st.st_atime;
276+ _stat->st_mtime = st.st_mtime;
277+ _stat->st_ctime = st.st_ctime;
278+ return ret;
279+}
288280
289281 #define __stat64 _stat64
290282 #if defined(_USE_32BIT_TIME_T)
@@ -292,13 +284,16 @@ int __cdecl __MINGW_NOTHROW _fstat64i32 (int, struct _stat64i32*);
292284 #define _fstati64 _fstat32i64
293285 #define _stat _stat32
294286 #define _stati64 _stat32i64
287+
295288 #else /* !_USE_32BIT_TIME_T */
296289 #define _fstat _fstat64i32
297290 #define _fstati64 _fstat64
298291 #define _stat _stat64i32
299292 #define _stati64 _stat64
293+
300294 #endif /* _USE_32BIT_TIME_T */
301295 #define _STAT_DEFINED
296+
302297 #endif /* _STAT_DEFINED */
303298
304299 #if !defined(_NO_OLDNAMES) && !defined(__STRICT_ANSI__)
@@ -316,62 +311,58 @@ _CRTALIAS int __cdecl __MINGW_NOTHROW _wstat32 (const wchar_t* _v1, struct _stat
316311 _CRTIMP int __cdecl __MINGW_NOTHROW _wstat64 (const wchar_t*, struct _stat64*);
317312 _CRTIMP int __cdecl __MINGW_NOTHROW _wstat32i64 (const wchar_t*, struct _stat32i64*);
318313 int __cdecl __MINGW_NOTHROW _wstat64i32 (const wchar_t*, struct _stat64i32*);
319-#ifndef __NO_INLINE__
320314 #include <string.h> /* Need memset declaration */
321- __CRT_INLINE int __cdecl _wstat64i32(const wchar_t *fname, struct _stat64i32 *_stat)
322- {
323- struct _stat64 st;
324- int ret = _wstat64(fname, &st);
325- if (ret == -1) {
326- memset(_stat, 0, sizeof(struct _stat64i32));
327- return -1;
328- }
329- _stat->st_dev = st.st_dev;
330- _stat->st_ino = st.st_ino;
331- _stat->st_mode = st.st_mode;
332- _stat->st_nlink = st.st_nlink;
333- _stat->st_uid = st.st_uid;
334- _stat->st_gid = st.st_gid;
335- _stat->st_rdev = st.st_rdev;
336- _stat->st_size = (_off_t) st.st_size;
337- _stat->st_atime = st.st_atime;
338- _stat->st_mtime = st.st_mtime;
339- _stat->st_ctime = st.st_ctime;
340- return ret;
315+__CRT_MAYBE_INLINE int __cdecl _wstat64i32(const wchar_t *fname, struct _stat64i32 *_stat)
316+{
317+ struct _stat64 st;
318+ int ret = _wstat64(fname, &st);
319+ if (ret == -1) {
320+ memset(_stat, 0, sizeof(struct _stat64i32));
321+ return -1;
341322 }
342- __CRT_INLINE int __cdecl _wstat32i64(const wchar_t *fname, struct _stat32i64 *_stat)
343- {
344- struct _stat32 st;
345- int ret = _wstat32(fname, &st);
346- if (ret == -1) {
347- memset(_stat, 0, sizeof(struct _stat32i64));
348- return -1;
349- }
350- _stat->st_dev = st.st_dev;
351- _stat->st_ino = st.st_ino;
352- _stat->st_mode = st.st_mode;
353- _stat->st_nlink = st.st_nlink;
354- _stat->st_uid = st.st_uid;
355- _stat->st_gid = st.st_gid;
356- _stat->st_rdev = st.st_rdev;
357- _stat->st_size = (_off_t) st.st_size;
358- _stat->st_atime = st.st_atime;
359- _stat->st_mtime = st.st_mtime;
360- _stat->st_ctime = st.st_ctime;
361- return ret;
323+ _stat->st_dev = st.st_dev;
324+ _stat->st_ino = st.st_ino;
325+ _stat->st_mode = st.st_mode;
326+ _stat->st_nlink = st.st_nlink;
327+ _stat->st_uid = st.st_uid;
328+ _stat->st_gid = st.st_gid;
329+ _stat->st_rdev = st.st_rdev;
330+ _stat->st_size = (_off_t) st.st_size;
331+ _stat->st_atime = st.st_atime;
332+ _stat->st_mtime = st.st_mtime;
333+ _stat->st_ctime = st.st_ctime;
334+ return ret;
335+}
336+__CRT_MAYBE_INLINE int __cdecl _wstat32i64(const wchar_t *fname, struct _stat32i64 *_stat)
337+{
338+ struct _stat32 st;
339+ int ret = _wstat32(fname, &st);
340+ if (ret == -1) {
341+ memset(_stat, 0, sizeof(struct _stat32i64));
342+ return -1;
362343 }
363-#else
364-#define _wstat32i64 _wstat32
365-#define _wstat64i32 _wstat64
366-#endif
344+ _stat->st_dev = st.st_dev;
345+ _stat->st_ino = st.st_ino;
346+ _stat->st_mode = st.st_mode;
347+ _stat->st_nlink = st.st_nlink;
348+ _stat->st_uid = st.st_uid;
349+ _stat->st_gid = st.st_gid;
350+ _stat->st_rdev = st.st_rdev;
351+ _stat->st_size = (_off_t) st.st_size;
352+ _stat->st_atime = st.st_atime;
353+ _stat->st_mtime = st.st_mtime;
354+ _stat->st_ctime = st.st_ctime;
355+ return ret;
356+}
367357
368358 #if defined(_USE_32BIT_TIME_T)
369359 #define _wstat _wstat32
370360 #define _wstati64 _wstat32i64
371-#else /* !_USE_32BIT_TIME_T */
372361
362+#else /* !_USE_32BIT_TIME_T */
373363 #define _wstat _wstat64i32
374364 #define _wstati64 _wstat64
365+
375366 #endif /* _USE_32BIT_TIME_T */
376367
377368 #define _WSTAT_DEFINED
--- a/include/sys/utime.h
+++ b/include/sys/utime.h
@@ -8,11 +8,11 @@
88 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
99 * and/or sell copies of the Software, and to permit persons to whom the
1010 * Software is furnished to do so, subject to the following conditions:
11- *
11+ *
1212 * The above copyright notice and this permission notice (including the next
1313 * paragraph) shall be included in all copies or substantial portions of the
1414 * Software.
15- *
15+ *
1616 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1717 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1818 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -36,6 +36,7 @@
3636 /*
3737 * Structure used by _utime function.
3838 */
39+#ifndef _UTIMBUF_DEFINED
3940 struct _utimbuf
4041 {
4142 time_t actime; /* Access time */
@@ -46,6 +47,11 @@ struct __utimbuf32
4647 __time32_t actime;
4748 __time32_t modtime;
4849 };
50+struct __utimbuf64
51+{
52+ __time64_t actime;
53+ __time64_t modtime;
54+};
4955
5056
5157 #ifndef _NO_OLDNAMES
@@ -55,54 +61,99 @@ struct utimbuf
5561 time_t actime;
5662 time_t modtime;
5763 };
64+struct utimbuf32
65+{
66+ __time32_t actime;
67+ __time32_t modtime;
68+};
5869 #endif /* Not _NO_OLDNAMES */
70+#define _UTIMBUF_DEFINED
71+#endif /* ndef _UTIMBUF_DEFINED */
5972
6073 #ifdef __cplusplus
6174 extern "C" {
6275 #endif
6376
64-_CRTIMP int __cdecl __MINGW_NOTHROW _utime (const char*, struct _utimbuf*);
65-
6677 #ifndef _NO_OLDNAMES
78+#ifdef _USE_32BIT_TIME_T
6779 _CRTIMP int __cdecl __MINGW_NOTHROW utime (const char*, struct utimbuf*);
80+#else
81+#define utime _utime
82+#endif
6883 #endif /* Not _NO_OLDNAMES */
6984
70-_CRTIMP int __cdecl __MINGW_NOTHROW _futime (int, struct _utimbuf*);
71-
72-/* The wide character version, only available for MSVCRT versions of the
73- * C runtime library. */
74-_CRTIMP int __cdecl __MINGW_NOTHROW _wutime (const wchar_t*, struct _utimbuf*);
75-
76-/* These require newer versions of msvcrt.dll (6.10 or higher). */
77-struct __utimbuf64
78-{
79- __time64_t actime;
80- __time64_t modtime;
81-};
82-
8385 _CRTIMP int __cdecl __MINGW_NOTHROW _utime64 (const char*, struct __utimbuf64*);
84-_CRTIMP int __cdecl __MINGW_NOTHROW _wutime64 (const wchar_t*, struct __utimbuf64*);
8586 _CRTIMP int __cdecl __MINGW_NOTHROW _futime64 (int, struct __utimbuf64*);
8687
88+#if MSVCRT_VERSION >= 800
8789 _CRTIMP int __cdecl __MINGW_NOTHROW _utime32 (const char*, struct __utimbuf32*);
88-_CRTIMP int __cdecl __MINGW_NOTHROW _wutime32 (const wchar_t*, struct __utimbuf32*);
8990 _CRTIMP int __cdecl __MINGW_NOTHROW _futime32 (int, struct __utimbuf32*);
9091
91-#ifndef _USE_32BIT_TIME_T
92-_CRTALIAS int __cdecl __MINGW_NOTHROW _utime (const char* _v1, struct _utimbuf* _v2) { return(_utime64 (_v1,(struct __utimbuf64*)_v2)); }
93-_CRTALIAS int __cdecl __MINGW_NOTHROW _wutime (const wchar_t* _v1, struct _utimbuf* _v2) { return(_wutime64 (_v1,(struct __utimbuf64*)_v2)); }
94-_CRTALIAS int __cdecl __MINGW_NOTHROW _futime (int _v1, struct _utimbuf* _v2) { return(_futime64 (_v1,(struct __utimbuf64*)_v2)); }
9592 #else
93+_CRTIMP int __cdecl __MINGW_NOTHROW _utime (const char*, struct _utimbuf*);
94+_CRTALIAS int __cdecl __MINGW_NOTHROW _utime32 (const char* _v1, struct __utimbuf32* _v2) {
95+ return _utime(_v1, _v2);
96+}
97+
98+_CRTIMP int __cdecl __MINGW_NOTHROW _futime (int, struct _utimbuf*);
99+_CRTALIAS int __cdecl __MINGW_NOTHROW _futime32 (int _v1, struct __utimbuf32* _v2) {
100+ return _futime(_v1, _v2);
101+}
96102
97-_CRTALIAS int __cdecl __MINGW_NOTHROW _utime (const char* _v1, struct _utimbuf* _v2) { return(_utime32 (_v1,(struct __utimbuf32*)_v2)); }
98-_CRTALIAS int __cdecl __MINGW_NOTHROW _wutime (const wchar_t* _v1, struct _utimbuf* _v2) { return(_wutime32 (_v1,(struct __utimbuf32*)_v2)); }
99-_CRTALIAS int __cdecl __MINGW_NOTHROW _futime (int _v1, struct _utimbuf* _v2) { return(_futime32 (_v1,(struct __utimbuf32*)_v2)); }
100103 #endif
101104
105+#ifndef _USE_32BIT_TIME_T
106+_CRTALIAS int __cdecl __MINGW_NOTHROW _utime (const char* _v1, struct _utimbuf* _v2) {
107+ return(_utime64 (_v1,(struct __utimbuf64*)_v2));
108+}
109+_CRTALIAS int __cdecl __MINGW_NOTHROW _futime (int _v1, struct _utimbuf* _v2) {
110+ return(_futime64 (_v1,(struct __utimbuf64*)_v2));
111+}
112+
113+#else /* def _USE_32BIT_TIME_T */
114+#if MSVCRT_VERSION >= 800
115+_CRTALIAS int __cdecl __MINGW_NOTHROW _utime (const char* _v1, struct _utimbuf* _v2) {
116+ return(_utime32 (_v1,(struct __utimbuf32*)_v2));
117+}
118+_CRTALIAS int __cdecl __MINGW_NOTHROW _futime (int _v1, struct _utimbuf* _v2) {
119+ return(_futime32 (_v1,(struct __utimbuf32*)_v2));
120+}
121+#endif /* MSVCRT_VERSION >= 800 */
122+
123+#endif /* ndef _USE_32BIT_TIME_T */
124+
125+#ifndef _WUTIME_DEFINED
126+_CRTIMP int __cdecl __MINGW_NOTHROW _wutime64 (const wchar_t*, struct __utimbuf64*);
127+#if MSVCRT_VERSION >= 800
128+_CRTIMP int __cdecl __MINGW_NOTHROW _wutime32 (const wchar_t*, struct __utimbuf32*);
129+
130+#else /* MSVCRT_VERSION < 800 */
131+_CRTIMP int __cdecl __MINGW_NOTHROW _wutime (const wchar_t*, struct _utimbuf*);
132+_CRTALIAS int __cdecl __MINGW_NOTHROW _wutime32 (const wchar_t* _v1, struct __utimbuf32* _v2) {
133+ return _wutime(_v1, _v2);
134+}
135+
136+#endif /* MSVCRT_VERSION >= 800 */
137+#ifdef _USE_32BIT_TIME_T
138+#if MSVCRT_VERSION >= 800
139+_CRTALIAS int __cdecl __MINGW_NOTHROW _wutime (const wchar_t* _v1, struct _utimbuf* _v2) {
140+ return(_wutime32 (_v1,(struct __utimbuf32*)_v2));
141+}
142+#endif /* MSVCRT_VERSION >= 800 */
143+
144+#else /* ndef _USE_32BIT_TIME_T */
145+_CRTALIAS int __cdecl __MINGW_NOTHROW _wutime (const wchar_t* _v1, struct _utimbuf* _v2) {
146+ return(_wutime64 (_v1,(struct __utimbuf64*)_v2));
147+}
148+
149+#endif /* def _USE_32BIT_TIME_T */
150+#define _WUTIME_DEFINED
151+#endif /* ndef _WUTIME_DEFINED */
152+
102153 #ifdef __cplusplus
103154 }
104155 #endif
105156
106157 #endif /* Not RC_INVOKED */
107158
108-#endif /* Not _UTIME_H_ */
159+#endif /* Not _UTIME_H_ */
\ No newline at end of file
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -98,6 +98,43 @@ struct tm {
9898 #define _TM_DEFINED
9999 #endif
100100
101+/*
102+ * Structure used by _utime function.
103+ */
104+#ifndef _UTIMBUF_DEFINED
105+struct _utimbuf
106+{
107+ time_t actime; /* Access time */
108+ time_t modtime; /* Modification time */
109+};
110+struct __utimbuf32
111+{
112+ __time32_t actime;
113+ __time32_t modtime;
114+};
115+struct __utimbuf64
116+{
117+ __time64_t actime;
118+ __time64_t modtime;
119+};
120+
121+
122+#ifndef _NO_OLDNAMES
123+/* NOTE: Must be the same as _utimbuf above. */
124+struct utimbuf
125+{
126+ time_t actime;
127+ time_t modtime;
128+};
129+struct utimbuf32
130+{
131+ __time32_t actime;
132+ __time32_t modtime;
133+};
134+#endif /* Not _NO_OLDNAMES */
135+#define _UTIMBUF_DEFINED
136+#endif /* ndef _UTIMBUF_DEFINED */
137+
101138 #ifndef _WSTDIO_DEFINED
102139 /* Also in stdio.h - keep in sync */
103140 _CRTIMP int __cdecl __MINGW_NOTHROW fwprintf (FILE*, const wchar_t*, ...);
@@ -226,6 +263,35 @@ _CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t* _v) { return(_
226263 #endif /* __STRICT_ANSI__ */
227264
228265 _CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
266+
267+#ifndef _WUTIME_DEFINED
268+_CRTIMP int __cdecl __MINGW_NOTHROW _wutime64 (const wchar_t*, struct __utimbuf64*);
269+#if MSVCRT_VERSION >= 800
270+_CRTIMP int __cdecl __MINGW_NOTHROW _wutime32 (const wchar_t*, struct __utimbuf32*);
271+
272+#else /* MSVCRT_VERSION < 800 */
273+_CRTIMP int __cdecl __MINGW_NOTHROW _wutime (const wchar_t*, struct _utimbuf*);
274+_CRTALIAS int __cdecl __MINGW_NOTHROW _wutime32 (const wchar_t* _v1, struct __utimbuf32* _v2) {
275+ return _wutime(_v1, _v2);
276+}
277+
278+#endif /* MSVCRT_VERSION >= 800 */
279+#ifdef _USE_32BIT_TIME_T
280+#if MSVCRT_VERSION >= 800
281+_CRTALIAS int __cdecl __MINGW_NOTHROW _wutime (const wchar_t* _v1, struct _utimbuf* _v2) {
282+ return(_wutime32 (_v1,(struct __utimbuf32*)_v2));
283+}
284+#endif /* MSVCRT_VERSION >= 800 */
285+
286+#else /* ndef _USE_32BIT_TIME_T */
287+_CRTALIAS int __cdecl __MINGW_NOTHROW _wutime (const wchar_t* _v1, struct _utimbuf* _v2) {
288+ return(_wutime64 (_v1,(struct __utimbuf64*)_v2));
289+}
290+
291+#endif /* def _USE_32BIT_TIME_T */
292+#define _WUTIME_DEFINED
293+#endif /* ndef _WUTIME_DEFINED */
294+
229295 #define _WTIME_DEFINED
230296 #endif /* _WTIME_DEFINED */
231297