The MinGW.org Windows System Libraries
Revisão | aba8deb8b99df5cd66497e292856e63b66aada61 (tree) |
---|---|
Hora | 2013-06-08 08:06:19 |
Autor | Earnie Boyd <earnie@user...> |
Commiter | Earnie Boyd |
Miscellaneous changes toward finalizing the _USE_32BIT_TIME_T debacle.
@@ -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 | + | |
1 | 16 | 2013-06-07 Jan Nijtmans <nijtmans@users.sourceforge.net> |
2 | 17 | |
3 | 18 | * include/time.h: Correct typos. Add MSVCRT_VERSION >= 800 guard for |
@@ -195,8 +195,22 @@ | ||
195 | 195 | # endif |
196 | 196 | #endif |
197 | 197 | |
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 | + */ | |
198 | 202 | #define _CRTALIAS __CRT_INLINE __attribute__ ((__always_inline__)) |
199 | 203 | |
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 | + | |
200 | 214 | #ifdef __cplusplus |
201 | 215 | # define BEGIN_C_DECLS extern "C" { |
202 | 216 | # define __UNUSED_PARAM(x) |
@@ -193,98 +193,90 @@ _CRTALIAS int __cdecl __MINGW_NOTHROW _fstat32 (int _v1, struct _stat32* _v2) { | ||
193 | 193 | _CRTIMP int __cdecl __MINGW_NOTHROW _fstat64 (int, struct _stat64*); |
194 | 194 | int __cdecl __MINGW_NOTHROW _fstat32i64 (int, struct _stat32i64*); |
195 | 195 | int __cdecl __MINGW_NOTHROW _fstat64i32 (int, struct _stat64i32*); |
196 | -#ifndef __NO_INLINE__ | |
197 | 196 | #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; | |
218 | 203 | } |
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; | |
239 | 224 | } |
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; | |
260 | 245 | } |
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; | |
281 | 266 | } |
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 | +} | |
288 | 280 | |
289 | 281 | #define __stat64 _stat64 |
290 | 282 | #if defined(_USE_32BIT_TIME_T) |
@@ -292,13 +284,16 @@ int __cdecl __MINGW_NOTHROW _fstat64i32 (int, struct _stat64i32*); | ||
292 | 284 | #define _fstati64 _fstat32i64 |
293 | 285 | #define _stat _stat32 |
294 | 286 | #define _stati64 _stat32i64 |
287 | + | |
295 | 288 | #else /* !_USE_32BIT_TIME_T */ |
296 | 289 | #define _fstat _fstat64i32 |
297 | 290 | #define _fstati64 _fstat64 |
298 | 291 | #define _stat _stat64i32 |
299 | 292 | #define _stati64 _stat64 |
293 | + | |
300 | 294 | #endif /* _USE_32BIT_TIME_T */ |
301 | 295 | #define _STAT_DEFINED |
296 | + | |
302 | 297 | #endif /* _STAT_DEFINED */ |
303 | 298 | |
304 | 299 | #if !defined(_NO_OLDNAMES) && !defined(__STRICT_ANSI__) |
@@ -316,62 +311,58 @@ _CRTALIAS int __cdecl __MINGW_NOTHROW _wstat32 (const wchar_t* _v1, struct _stat | ||
316 | 311 | _CRTIMP int __cdecl __MINGW_NOTHROW _wstat64 (const wchar_t*, struct _stat64*); |
317 | 312 | _CRTIMP int __cdecl __MINGW_NOTHROW _wstat32i64 (const wchar_t*, struct _stat32i64*); |
318 | 313 | int __cdecl __MINGW_NOTHROW _wstat64i32 (const wchar_t*, struct _stat64i32*); |
319 | -#ifndef __NO_INLINE__ | |
320 | 314 | #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; | |
341 | 322 | } |
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; | |
362 | 343 | } |
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 | +} | |
367 | 357 | |
368 | 358 | #if defined(_USE_32BIT_TIME_T) |
369 | 359 | #define _wstat _wstat32 |
370 | 360 | #define _wstati64 _wstat32i64 |
371 | -#else /* !_USE_32BIT_TIME_T */ | |
372 | 361 | |
362 | +#else /* !_USE_32BIT_TIME_T */ | |
373 | 363 | #define _wstat _wstat64i32 |
374 | 364 | #define _wstati64 _wstat64 |
365 | + | |
375 | 366 | #endif /* _USE_32BIT_TIME_T */ |
376 | 367 | |
377 | 368 | #define _WSTAT_DEFINED |
@@ -8,11 +8,11 @@ | ||
8 | 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
9 | 9 | * and/or sell copies of the Software, and to permit persons to whom the |
10 | 10 | * Software is furnished to do so, subject to the following conditions: |
11 | - * | |
11 | + * | |
12 | 12 | * The above copyright notice and this permission notice (including the next |
13 | 13 | * paragraph) shall be included in all copies or substantial portions of the |
14 | 14 | * Software. |
15 | - * | |
15 | + * | |
16 | 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 | 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 | 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
@@ -36,6 +36,7 @@ | ||
36 | 36 | /* |
37 | 37 | * Structure used by _utime function. |
38 | 38 | */ |
39 | +#ifndef _UTIMBUF_DEFINED | |
39 | 40 | struct _utimbuf |
40 | 41 | { |
41 | 42 | time_t actime; /* Access time */ |
@@ -46,6 +47,11 @@ struct __utimbuf32 | ||
46 | 47 | __time32_t actime; |
47 | 48 | __time32_t modtime; |
48 | 49 | }; |
50 | +struct __utimbuf64 | |
51 | +{ | |
52 | + __time64_t actime; | |
53 | + __time64_t modtime; | |
54 | +}; | |
49 | 55 | |
50 | 56 | |
51 | 57 | #ifndef _NO_OLDNAMES |
@@ -55,54 +61,99 @@ struct utimbuf | ||
55 | 61 | time_t actime; |
56 | 62 | time_t modtime; |
57 | 63 | }; |
64 | +struct utimbuf32 | |
65 | +{ | |
66 | + __time32_t actime; | |
67 | + __time32_t modtime; | |
68 | +}; | |
58 | 69 | #endif /* Not _NO_OLDNAMES */ |
70 | +#define _UTIMBUF_DEFINED | |
71 | +#endif /* ndef _UTIMBUF_DEFINED */ | |
59 | 72 | |
60 | 73 | #ifdef __cplusplus |
61 | 74 | extern "C" { |
62 | 75 | #endif |
63 | 76 | |
64 | -_CRTIMP int __cdecl __MINGW_NOTHROW _utime (const char*, struct _utimbuf*); | |
65 | - | |
66 | 77 | #ifndef _NO_OLDNAMES |
78 | +#ifdef _USE_32BIT_TIME_T | |
67 | 79 | _CRTIMP int __cdecl __MINGW_NOTHROW utime (const char*, struct utimbuf*); |
80 | +#else | |
81 | +#define utime _utime | |
82 | +#endif | |
68 | 83 | #endif /* Not _NO_OLDNAMES */ |
69 | 84 | |
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 | - | |
83 | 85 | _CRTIMP int __cdecl __MINGW_NOTHROW _utime64 (const char*, struct __utimbuf64*); |
84 | -_CRTIMP int __cdecl __MINGW_NOTHROW _wutime64 (const wchar_t*, struct __utimbuf64*); | |
85 | 86 | _CRTIMP int __cdecl __MINGW_NOTHROW _futime64 (int, struct __utimbuf64*); |
86 | 87 | |
88 | +#if MSVCRT_VERSION >= 800 | |
87 | 89 | _CRTIMP int __cdecl __MINGW_NOTHROW _utime32 (const char*, struct __utimbuf32*); |
88 | -_CRTIMP int __cdecl __MINGW_NOTHROW _wutime32 (const wchar_t*, struct __utimbuf32*); | |
89 | 90 | _CRTIMP int __cdecl __MINGW_NOTHROW _futime32 (int, struct __utimbuf32*); |
90 | 91 | |
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)); } | |
95 | 92 | #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 | +} | |
96 | 102 | |
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)); } | |
100 | 103 | #endif |
101 | 104 | |
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 | + | |
102 | 153 | #ifdef __cplusplus |
103 | 154 | } |
104 | 155 | #endif |
105 | 156 | |
106 | 157 | #endif /* Not RC_INVOKED */ |
107 | 158 | |
108 | -#endif /* Not _UTIME_H_ */ | |
159 | +#endif /* Not _UTIME_H_ */ | |
\ No newline at end of file |
@@ -98,6 +98,43 @@ struct tm { | ||
98 | 98 | #define _TM_DEFINED |
99 | 99 | #endif |
100 | 100 | |
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 | + | |
101 | 138 | #ifndef _WSTDIO_DEFINED |
102 | 139 | /* Also in stdio.h - keep in sync */ |
103 | 140 | _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(_ | ||
226 | 263 | #endif /* __STRICT_ANSI__ */ |
227 | 264 | |
228 | 265 | _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 | + | |
229 | 295 | #define _WTIME_DEFINED |
230 | 296 | #endif /* _WTIME_DEFINED */ |
231 | 297 |