• 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

Revision16281c42c1f0351fb4cdd2c14307894d1e106fa1 (tree)
Time2013-06-18 02:33:54
AuthorEarnie Boyd <earnie@user...>
CommiterEarnie Boyd

Log Message

Further corrections for _wfindfirst* and _wfindnext*. Work around issue for CRT_MAYBE_INLINE when NO_INLINE defined.

Change Summary

Incremental Difference

--- a/ChangeLog
+++ b/ChangeLog
@@ -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+
111 2013-06-16 Earnie Boyd <earnie@users.sourceforge.net>
212
313 * NEWS: Add text for MSVCRT_VERSION and for the _CRTALIAS 32bit time_t
--- a/include/_mingw.h
+++ b/include/_mingw.h
@@ -210,7 +210,7 @@
210210 #ifndef __NO_INLINE__
211211 #define __CRT_MAYBE_INLINE __CRT_INLINE
212212 #else /* def __NO_INLINE__ */
213-#define __CRT_MAYBE_INLINE
213+#define __CRT_MAYBE_INLINE _CRTALIAS /* We need to inline to stop auto-export */
214214 #endif /* ndef __NO_INLINE__ */
215215
216216 #ifdef __cplusplus
--- a/include/io.h
+++ b/include/io.h
@@ -428,9 +428,8 @@ _CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct _wfinddata64_t
428428 int __cdecl __MINGW_NOTHROW _wfindnext32i64 (intptr_t, struct _wfinddata32i64_t*);
429429 int __cdecl __MINGW_NOTHROW _wfindnext64i32 (intptr_t, struct _wfinddata64i32_t*);
430430
431-#ifndef __NO_INLINE__
432431 #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) {
434433 struct _wfinddata64_t fd;
435434 intptr_t ret = _wfindfirst64(_filename, &fd);
436435 if (ret == -1) {
@@ -446,7 +445,7 @@ __CRT_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst32i64(const wchar_t* _f
446445 return ret;
447446 }
448447
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) {
450449 struct _wfinddata32_t fd;
451450 intptr_t ret = _wfindfirst32(_filename, &fd);
452451 if (ret == -1) {
@@ -462,7 +461,7 @@ __CRT_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst64i32(const wchar_t* _f
462461 return ret;
463462 }
464463
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) {
466465 struct _wfinddata64_t fd;
467466 int ret = _wfindnext64(_fp,&fd);
468467 if (ret == -1) {
@@ -478,7 +477,7 @@ __CRT_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext32i64(intptr_t _fp, stru
478477 return ret;
479478 }
480479
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) {
482481 struct _wfinddata32_t fd;
483482 int ret = _wfindnext32(_fp, &fd);
484483 if (ret == -1) {
@@ -494,22 +493,6 @@ __CRT_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext64i32(intptr_t _fp, stru
494493 return ret;
495494 }
496495
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-
513496 #endif /* _WIO_DEFINED */
514497
515498 #ifndef _NO_OLDNAMES
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -489,25 +489,90 @@ _CRTIMP int __cdecl __MINGW_NOTHROW _wunlink (const wchar_t*);
489489 _CRTIMP int __cdecl __MINGW_NOTHROW _wopen (const wchar_t*, int, ...);
490490 _CRTIMP int __cdecl __MINGW_NOTHROW _wsopen (const wchar_t*, int, int, ...);
491491 _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*);
493494 _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*);
498500 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct _wfinddata64_t*);
499501 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct _wfinddata64_t*);
500502
501503 /* _wfindfirst32 and _wfindnext32 do not exist in MSVCRT.DLL */
502504 _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*);
504505 return _wfindfirst(_v1, _v2);
505506 }
506507 _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*);
508508 return _wfindnext(_v1, _v2);
509509 }
510510
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+
511576 #if defined(_USE_32BIT_TIME_T)
512577 #define _wfinddata_t _wfinddata32_t
513578 #define _wfinddatai64_t _wfinddata32i64_t