The MinGW.org Windows System Libraries
Revision | 16281c42c1f0351fb4cdd2c14307894d1e106fa1 (tree) |
---|---|
Time | 2013-06-18 02:33:54 |
Author | Earnie Boyd <earnie@user...> |
Commiter | Earnie Boyd |
Further corrections for _wfindfirst* and _wfindnext*. Work around issue for CRT_MAYBE_INLINE when NO_INLINE defined.
@@ -1,3 +1,13 @@ | ||
1 | +2013-06-17 Earnie Boyd <earnie@users.sourceforge.net> | |
2 | + | |
3 | + * include/_mingw.h (__CRT_MAYBE_INLINE): When __NO_INLINE__ defined we | |
4 | + need to make it _CRTALIAS to avoid auto export issues. | |
5 | + * include/io.h (_wfindfirst*, _wfindnext*): Remove the __NO_INLINE__ | |
6 | + filter and use __CRT_MAYBE_INLINE definitions. | |
7 | + * include/wchar.h (_wfindfirst*, _wfindnext*): Correct the declarations. | |
8 | + (_wfindfirst32i64, _wfindfirst64i32, _wfindnext32i64, _wfindnext64i32): | |
9 | + Define as __CRT_MAYBE_INLINE. | |
10 | + | |
1 | 11 | 2013-06-16 Earnie Boyd <earnie@users.sourceforge.net> |
2 | 12 | |
3 | 13 | * NEWS: Add text for MSVCRT_VERSION and for the _CRTALIAS 32bit time_t |
@@ -210,7 +210,7 @@ | ||
210 | 210 | #ifndef __NO_INLINE__ |
211 | 211 | #define __CRT_MAYBE_INLINE __CRT_INLINE |
212 | 212 | #else /* def __NO_INLINE__ */ |
213 | -#define __CRT_MAYBE_INLINE | |
213 | +#define __CRT_MAYBE_INLINE _CRTALIAS /* We need to inline to stop auto-export */ | |
214 | 214 | #endif /* ndef __NO_INLINE__ */ |
215 | 215 | |
216 | 216 | #ifdef __cplusplus |
@@ -428,9 +428,8 @@ _CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct _wfinddata64_t | ||
428 | 428 | int __cdecl __MINGW_NOTHROW _wfindnext32i64 (intptr_t, struct _wfinddata32i64_t*); |
429 | 429 | int __cdecl __MINGW_NOTHROW _wfindnext64i32 (intptr_t, struct _wfinddata64i32_t*); |
430 | 430 | |
431 | -#ifndef __NO_INLINE__ | |
432 | 431 | #include <string.h> |
433 | -__CRT_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst32i64(const wchar_t* _filename, struct _wfinddata32i64_t* _fdata) { | |
432 | +__CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst32i64(const wchar_t* _filename, struct _wfinddata32i64_t* _fdata) { | |
434 | 433 | struct _wfinddata64_t fd; |
435 | 434 | intptr_t ret = _wfindfirst64(_filename, &fd); |
436 | 435 | if (ret == -1) { |
@@ -446,7 +445,7 @@ __CRT_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst32i64(const wchar_t* _f | ||
446 | 445 | return ret; |
447 | 446 | } |
448 | 447 | |
449 | -__CRT_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst64i32(const wchar_t* _filename, struct _wfinddata64i32_t* _fdata) { | |
448 | +__CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst64i32(const wchar_t* _filename, struct _wfinddata64i32_t* _fdata) { | |
450 | 449 | struct _wfinddata32_t fd; |
451 | 450 | intptr_t ret = _wfindfirst32(_filename, &fd); |
452 | 451 | if (ret == -1) { |
@@ -462,7 +461,7 @@ __CRT_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst64i32(const wchar_t* _f | ||
462 | 461 | return ret; |
463 | 462 | } |
464 | 463 | |
465 | -__CRT_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext32i64(intptr_t _fp, struct _wfinddata32i64_t* _fdata) { | |
464 | +__CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext32i64(intptr_t _fp, struct _wfinddata32i64_t* _fdata) { | |
466 | 465 | struct _wfinddata64_t fd; |
467 | 466 | int ret = _wfindnext64(_fp,&fd); |
468 | 467 | if (ret == -1) { |
@@ -478,7 +477,7 @@ __CRT_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext32i64(intptr_t _fp, stru | ||
478 | 477 | return ret; |
479 | 478 | } |
480 | 479 | |
481 | -__CRT_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext64i32(intptr_t _fp, struct _wfinddata64i32_t* _fdata) { | |
480 | +__CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext64i32(intptr_t _fp, struct _wfinddata64i32_t* _fdata) { | |
482 | 481 | struct _wfinddata32_t fd; |
483 | 482 | int ret = _wfindnext32(_fp, &fd); |
484 | 483 | if (ret == -1) { |
@@ -494,22 +493,6 @@ __CRT_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext64i32(intptr_t _fp, stru | ||
494 | 493 | return ret; |
495 | 494 | } |
496 | 495 | |
497 | -#else /* def __NO_INLINE__ */ | |
498 | -#define _findfirst64i32 _findfirst64 | |
499 | -#define _finddata64i32_t __finddata64_t | |
500 | -#define _findfirst32i64 _findfirst32 | |
501 | -#define _finddata32i64_t _finddata32_t | |
502 | -#define _findnext64i32 _findnext64 | |
503 | -#define _findnext32i64 _findnext32 | |
504 | - | |
505 | -#define _wfindfirst64i32 _wfindfirst64 | |
506 | -#define _wfindnext64i32 _wfindnext64 | |
507 | -#define _wfinddata64i32_t _wfinddata64_t | |
508 | -#define _wfindfirst32i64 _wfindfirst32 | |
509 | -#define _wfindnext32i64 _wfindnext32 | |
510 | -#define _wfinddata32i64_t _wfinddata32_t | |
511 | -#endif /* ndef __NO_INLINE__ */ | |
512 | - | |
513 | 496 | #endif /* _WIO_DEFINED */ |
514 | 497 | |
515 | 498 | #ifndef _NO_OLDNAMES |
@@ -489,25 +489,90 @@ _CRTIMP int __cdecl __MINGW_NOTHROW _wunlink (const wchar_t*); | ||
489 | 489 | _CRTIMP int __cdecl __MINGW_NOTHROW _wopen (const wchar_t*, int, ...); |
490 | 490 | _CRTIMP int __cdecl __MINGW_NOTHROW _wsopen (const wchar_t*, int, int, ...); |
491 | 491 | _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wmktemp (wchar_t*); |
492 | -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*); | |
492 | +_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t*, struct _wfinddata32_t*); | |
493 | +_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*); | |
493 | 494 | _CRTIMP int __cdecl __MINGW_NOTHROW _wfindnexti64 (long, struct _wfinddatai64_t*); |
494 | -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirst32i64 (const wchar_t*, struct _wfinddata32i64_t*); | |
495 | -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirst64i32 (const wchar_t*, struct _wfinddata64i32_t*); | |
496 | -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext32i64 (long, struct _wfinddata32i64_t*); | |
497 | -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext64i32 (long, struct _wfinddata64i32_t*); | |
495 | +intptr_t __cdecl __MINGW_NOTHROW _wfindfirst32i64 (const wchar_t*, struct _wfinddata32i64_t*); | |
496 | +intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64i32 (const wchar_t*, struct _wfinddata64i32_t*); | |
497 | +_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext (intptr_t, struct _wfinddata32_t*); | |
498 | +int __cdecl __MINGW_NOTHROW _wfindnext32i64 (intptr_t, struct _wfinddata32i64_t*); | |
499 | +int __cdecl __MINGW_NOTHROW _wfindnext64i32 (intptr_t, struct _wfinddata64i32_t*); | |
498 | 500 | _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct _wfinddata64_t*); |
499 | 501 | _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct _wfinddata64_t*); |
500 | 502 | |
501 | 503 | /* _wfindfirst32 and _wfindnext32 do not exist in MSVCRT.DLL */ |
502 | 504 | _CRTALIAS intptr_t __cdecl __MINGW_NOTHROW _wfindfirst32 (const wchar_t* _v1, struct _wfinddata32_t* _v2) { |
503 | - _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t*, struct _wfinddata32_t*); | |
504 | 505 | return _wfindfirst(_v1, _v2); |
505 | 506 | } |
506 | 507 | _CRTALIAS int __cdecl __MINGW_NOTHROW _wfindnext32 (intptr_t _v1, struct _wfinddata32_t* _v2) { |
507 | - _CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext (intptr_t, struct _wfinddata32_t*); | |
508 | 508 | return _wfindnext(_v1, _v2); |
509 | 509 | } |
510 | 510 | |
511 | +#include <string.h> | |
512 | +__CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst32i64(const wchar_t* _filename, struct _wfinddata32i64_t* _fdata) { | |
513 | + struct _wfinddata64_t fd; | |
514 | + intptr_t ret = _wfindfirst64(_filename, &fd); | |
515 | + if (ret == -1) { | |
516 | + memset(_fdata, 0, sizeof(struct _wfinddata64_t)); | |
517 | + return ret; | |
518 | + } | |
519 | + _fdata->attrib = fd.attrib; | |
520 | + _fdata->time_create = (__time32_t)fd.time_create; | |
521 | + _fdata->time_access = (__time32_t)fd.time_access; | |
522 | + _fdata->time_write = (__time32_t)fd.time_write; | |
523 | + _fdata->size = fd.size; | |
524 | + wcsncpy(_fdata->name, fd.name, FILENAME_MAX); | |
525 | + return ret; | |
526 | +} | |
527 | + | |
528 | +__CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst64i32(const wchar_t* _filename, struct _wfinddata64i32_t* _fdata) { | |
529 | + struct _wfinddata32_t fd; | |
530 | + intptr_t ret = _wfindfirst32(_filename, &fd); | |
531 | + if (ret == -1) { | |
532 | + memset(_fdata, 0, sizeof(struct _wfinddata32_t)); | |
533 | + return ret; | |
534 | + } | |
535 | + _fdata->attrib = fd.attrib; | |
536 | + _fdata->time_create = (__time64_t)fd.time_create; | |
537 | + _fdata->time_access = (__time64_t)fd.time_access; | |
538 | + _fdata->time_write = (__time64_t)fd.time_write; | |
539 | + _fdata->size = fd.size; | |
540 | + wcsncpy(_fdata->name, fd.name, FILENAME_MAX); | |
541 | + return ret; | |
542 | +} | |
543 | + | |
544 | +__CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext32i64(intptr_t _fp, struct _wfinddata32i64_t* _fdata) { | |
545 | + struct _wfinddata64_t fd; | |
546 | + int ret = _wfindnext64(_fp,&fd); | |
547 | + if (ret == -1) { | |
548 | + memset(_fdata, 0, sizeof(struct _wfinddata32i64_t)); | |
549 | + return ret; | |
550 | + } | |
551 | + _fdata->attrib = fd.attrib; | |
552 | + _fdata->time_create = (__time32_t)fd.time_create; | |
553 | + _fdata->time_access = (__time32_t)fd.time_access; | |
554 | + _fdata->time_write = (__time32_t)fd.time_write; | |
555 | + _fdata->size = fd.size; | |
556 | + wcsncpy(_fdata->name, fd.name, FILENAME_MAX); | |
557 | + return ret; | |
558 | +} | |
559 | + | |
560 | +__CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext64i32(intptr_t _fp, struct _wfinddata64i32_t* _fdata) { | |
561 | + struct _wfinddata32_t fd; | |
562 | + int ret = _wfindnext32(_fp, &fd); | |
563 | + if (ret == -1) { | |
564 | + memset(_fdata, 0, sizeof(struct _wfinddata64i32_t)); | |
565 | + return ret; | |
566 | + } | |
567 | + _fdata->attrib = fd.attrib; | |
568 | + _fdata->time_create = (__time64_t)fd.time_create; | |
569 | + _fdata->time_access = (__time64_t)fd.time_access; | |
570 | + _fdata->time_write = (__time64_t)fd.time_write; | |
571 | + _fdata->size = fd.size; | |
572 | + wcsncpy(_fdata->name, fd.name, FILENAME_MAX); | |
573 | + return ret; | |
574 | +} | |
575 | + | |
511 | 576 | #if defined(_USE_32BIT_TIME_T) |
512 | 577 | #define _wfinddata_t _wfinddata32_t |
513 | 578 | #define _wfinddatai64_t _wfinddata32i64_t |