OSDN Git Service

Correct _wfinddata64_t vs. __wfinddata64_t typo.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Thu, 30 Jan 2014 09:58:09 +0000 (09:58 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Thu, 30 Jan 2014 09:58:09 +0000 (09:58 +0000)
ChangeLog
include/io.h
include/tchar.h
include/wchar.h

index 040c186..d476472 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2014-01-30  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Correct _wfinddata64_t vs. __wfinddata64_t typo.
+
+       * include/io.h include/wchar.h (_wfinddata64_t): All MSDN data type
+       documentation denies the existence of this structure type, yet their
+       prototypes for the _wfindfirst64() and _wfindnext64() functions refer
+       to in in their argument lists; redefine it as an alias for...
+       (__wfinddata64_t): ...this formally documented structure type; update
+       all former references to use it.
+
+       * include/tchar.h (_tfinddata64_t): Map it to...
+       (__wfinddata64_t): ...this, in place of former mapping to...
+       (_wfinddata64_t): ...this.
+
 2014-01-27  Thorsten Otto  <thotto@users.sourceforge.net>
 
        Remove superfluous objects from libmingwex.a; (cf. issue #2177)
index 271d928..0b3e367 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * @file io.h
- * Copyright 2012, 2013 MinGW.org project
+ * Copyright 2012-2014 MinGW.org Project
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -123,7 +123,16 @@ struct _wfinddata32_t {
        wchar_t         name[FILENAME_MAX];
 };
 
-struct _wfinddata64_t {
+/* MSDN data type documentation refers to the 64-bit variant of the
+ * preceding structure as "__wfinddata64_t", but _wfindfirst64() and
+ * _wfindnext64() function prototypes then use "_wfinddata64_t" when
+ * declaring their arguments; assume that the former is correct for
+ * the structure declaration, but preserve an alias for the less
+ * trusted MSDN function prototype usage.
+ */
+#define _wfinddata64_t __wfinddata64_t
+
+struct __wfinddata64_t {
         unsigned    attrib;
         __time64_t  time_create;
         __time64_t  time_access;
@@ -173,7 +182,7 @@ intptr_t _findfirst64i32 (const char *filespec,struct _finddata64i32_t *fileinfo
 
 intptr_t _wfindfirst     (const wchar_t *filespec,struct _wfinddata_t *fileinfo);
 intptr_t _wfindfirst32   (const wchar_t *filespec,struct _wfinddata32_t *fileinfo);
-intptr_t _wfindfirst64   (const wchar_t *filespec, struct _wfinddata64_t   *fileinfo);
+intptr_t _wfindfirst64   (const wchar_t *filespec, struct __wfinddata64_t   *fileinfo);
 intptr_t _wfindfirsti64  (const wchar_t *filespec, struct _wfinddatai64_t   *fileinfo);
 intptr_t _wfindfirst32i64(const wchar_t *filespec, struct _wfinddata32i64_t *fileinfo);
 intptr_t _wfindfirst64i32(const wchar_t *filespec, struct _wfinddata64i32_t *fileinfo);
@@ -414,19 +423,19 @@ _CRTIMP int __cdecl __MINGW_NOTHROW _wunlink(const wchar_t*);
 _CRTIMP int __cdecl __MINGW_NOTHROW _wopen(const wchar_t*, int, ...);
 _CRTIMP int __cdecl __MINGW_NOTHROW _wsopen(const wchar_t*, int, int, ...);
 _CRTIMP wchar_t * __cdecl __MINGW_NOTHROW _wmktemp(wchar_t*);
-_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct _wfinddata64_t*);
+_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct __wfinddata64_t*);
 intptr_t __cdecl __MINGW_NOTHROW _wfindfirst32i64 (const wchar_t*, struct _wfinddata32i64_t*);
 intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64i32 (const wchar_t*, struct _wfinddata64i32_t*);
-_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct _wfinddata64_t*);
+_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct __wfinddata64_t*);
 int  __cdecl __MINGW_NOTHROW   _wfindnext32i64 (intptr_t, struct _wfinddata32i64_t*);
 int  __cdecl __MINGW_NOTHROW   _wfindnext64i32 (intptr_t, struct _wfinddata64i32_t*);
 
 #include <string.h>
 __CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst32i64(const wchar_t* _filename, struct _wfinddata32i64_t* _fdata) {
-    struct _wfinddata64_t fd;
+    struct __wfinddata64_t fd;
     intptr_t ret = _wfindfirst64(_filename, &fd);
     if (ret == -1) {
-        memset(_fdata, 0, sizeof(struct _wfinddata64_t));
+        memset(_fdata, 0, sizeof(struct __wfinddata64_t));
         return ret;
     }
     _fdata->attrib = fd.attrib;
@@ -455,7 +464,7 @@ __CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst64i32(const wchar
 }
 
 __CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext32i64(intptr_t _fp, struct _wfinddata32i64_t* _fdata) {
-    struct _wfinddata64_t fd;
+    struct __wfinddata64_t fd;
     int ret = _wfindnext64(_fp,&fd);
     if (ret == -1) {
       memset(_fdata, 0, sizeof(struct _wfinddata32i64_t));
@@ -565,7 +574,7 @@ wchar_t *   wmktemp(wchar_t *);
 #define _findfirsti64 _findfirst64
 #define _findnexti64 _findnext64
 #define _wfinddata_t _wfinddata64i32_t
-#define _wfinddatai64_t _wfinddata64_t
+#define _wfinddatai64_t __wfinddata64_t
 #define _wfindfirst _wfindfirst64i32
 #define _wfindnext _wfindnext64i32
 #define _wfindfirsti64 _wfindfirst64
index 1c0a8e1..1b694e9 100644 (file)
@@ -228,7 +228,7 @@ typedef wchar_t _TCHAR;
 #define _tfindfirsti64  _wfindfirsti64
 #define _tfindnexti64   _wfindnexti64
 #define _tfinddatai64_t _wfinddatai64_t
-#define _tfinddata64_t    _wfinddata64_t
+#define _tfinddata64_t    __wfinddata64_t
 #define _tfinddata32_t    _wfinddata32_t
 #define _tfinddata32i64_t _wfinddata32i64_t
 #define _tfinddata64i32_t _wfinddata64i32_t
index 87b8d84..e77225a 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * @file wchar.h
- * Copyright 2012, 2013 MinGW.org project
+ * Copyright 2012-2014 MinGW.org Project
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -435,7 +435,15 @@ struct _wfinddatai64_t {
        __int64     size;
        wchar_t     name[FILENAME_MAX];
 };
-struct _wfinddata64_t {
+/* MSDN data type documentation refers to the 64-bit variant of the
+ * following structure as "__wfinddata64_t", but _wfindfirst64() and
+ * _wfindnext64() function prototypes then use "_wfinddata64_t" when
+ * declaring their arguments; assume that the former is correct for
+ * the structure declaration, but preserve an alias for the less
+ * trusted MSDN function prototype usage.
+ */
+#define _wfinddata64_t __wfinddata64_t
+struct __wfinddata64_t {
         unsigned    attrib;
         __time64_t  time_create;
         __time64_t  time_access;
@@ -492,8 +500,8 @@ intptr_t __cdecl __MINGW_NOTHROW    _wfindfirst64i32 (const wchar_t*, struct _wfind
 _CRTIMP int  __cdecl __MINGW_NOTHROW _wfindnext (intptr_t, struct _wfinddata32_t*);
 int  __cdecl __MINGW_NOTHROW   _wfindnext32i64 (intptr_t, struct _wfinddata32i64_t*);
 int  __cdecl __MINGW_NOTHROW   _wfindnext64i32 (intptr_t, struct _wfinddata64i32_t*);
-_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct _wfinddata64_t*);
-_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct _wfinddata64_t*);
+_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct __wfinddata64_t*);
+_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct __wfinddata64_t*);
 
 /* _wfindfirst32 and _wfindnext32 do not exist in MSVCRT.DLL */
 _CRTALIAS intptr_t __cdecl __MINGW_NOTHROW _wfindfirst32 (const wchar_t* _v1, struct _wfinddata32_t* _v2) {
@@ -505,10 +513,10 @@ _CRTALIAS int  __cdecl __MINGW_NOTHROW    _wfindnext32 (intptr_t _v1, struct _wfind
 
 #include <string.h>
 __CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst32i64(const wchar_t* _filename, struct _wfinddata32i64_t* _fdata) {
-    struct _wfinddata64_t fd;
+    struct __wfinddata64_t fd;
     intptr_t ret = _wfindfirst64(_filename, &fd);
     if (ret == -1) {
-        memset(_fdata, 0, sizeof(struct _wfinddata64_t));
+        memset(_fdata, 0, sizeof(struct __wfinddata64_t));
         return ret;
     }
     _fdata->attrib = fd.attrib;
@@ -537,7 +545,7 @@ __CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindfirst64i32(const wchar
 }
 
 __CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext32i64(intptr_t _fp, struct _wfinddata32i64_t* _fdata) {
-    struct _wfinddata64_t fd;
+    struct __wfinddata64_t fd;
     int ret = _wfindnext64(_fp,&fd);
     if (ret == -1) {
       memset(_fdata, 0, sizeof(struct _wfinddata32i64_t));
@@ -578,7 +586,7 @@ __CRT_MAYBE_INLINE __cdecl __MINGW_NOTHROW intptr_t _wfindnext64i32(intptr_t _fp
 
 #else /* !defined(_USE_32BIT_TIME_T) */
 #define _wfinddata_t _wfinddata64i32_t
-#define _wfinddatai64_t _wfinddata64_t
+#define _wfinddatai64_t __wfinddata64_t
 #define _wfindfirst _wfindfirst64i32
 #define _wfindnext _wfindnext64i32
 #define _wfindfirsti64 _wfindfirst64