OSDN Git Service

Rework _USE_32BIT_TIME_T in light of MSVCRT_VERSION value.
authorEarnie Boyd <earnie@users.sourceforge.net>
Mon, 27 May 2013 19:09:51 +0000 (15:09 -0400)
committerEarnie Boyd <earnie@users.sourceforge.net>
Mon, 27 May 2013 19:09:51 +0000 (15:09 -0400)
ChangeLog
TODO
include/_mingw.h
include/sys/stat.h
include/sys/timeb.h
include/sys/types.h
include/time.h
include/wchar.h
lib/lib32/msvcrt.def.in

index b563289..a2d857b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2013-05-27  Earnie Boyd  <earnie@users.sourceforge.net>
+
+       * types.h (_USE_32BIT_TIME_T): Rework the definitions controlled by
+       _USE_32BIT_TIME_T in light of MSVCRT_VERSION being different with
+       differing OS versions.
+       * time.h (_USE_32BIT_TIME_T): Ditto.
+       * stat.h (_USE_32BIT_TIME_T): Ditto.
+       * wchar.h (_USE_32BIT_TIME_T): Ditto.
+       * _mingw.h (_USE_32BIT_TIME_T): Issue a warning when _USE_32BIT_TIME_T
+       is enabled and MSVCRT_VERSION value does not support it.
+       * msvcrt.def.in: Always define all definitions in light of MSVCRT.DLL
+       being different versions on differing OS.
+       * TODO: Add a note about needing a warning when a function is being
+       used but not defined within the MSVCRT_VERSION value.
+
 2013-05-21  Earnie Boyd  <earnie@users.sourceforge.net>
 
        * Makefile.in (clean-dist, clean-dist-mingwrt, clean-dist-w32api,
diff --git a/TODO b/TODO
index fdcb083..689c3b8 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,6 @@
+* Create a warning macro for MSVCRT_VERSION and the use of a declared function
+  when the function does not exist in the MSVCRT_VERSION value.
+
 * Review the following headers:
 ** io.h
 ** limits.h
index 821a872..4d58f57 100644 (file)
@@ -8,11 +8,11 @@
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the next
  * paragraph) shall be included in all copies or substantial portions of the
  * Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 # endif
 #endif
 
+/*
+ * We need to set a default MSVCRT_VERSION which describes the MSVCRT.DLL on
+ * the users system.  We are defaulting to XP but we recommend the user define
+ * this in his config.h or Makefile file based on the minimum supported version
+ * of OS for his program.
+ * ME = 600
+ * XP = 710
+ * VISTA = 800
+ * WIN7 = 900
+ * WIN8 = 1010
+ */
+#ifndef MSVCRT_VERSION
+#define MSVCRT_VERSION 710
+#endif
+
+#ifdef _USE_32BIT_TIME_T
+#if MSVCRT_VERSION < 800
+#warning Your MSVCRT_VERSION does not support the use of _USE_32BIT_TIME_T.
+#warning You should define MSVCRT_VERSION based on your MSVCRT.DLL version.
+#warning ME = 600, XP = 710, VISTA = 800, WIN7 = 900 and WIN8 = 1010.
+#endif /* MSVCRT_VERSION < 800 */
+#endif /* _USE_32BIT_TIME_T */
+
 struct threadlocalinfostruct;
 struct threadmbinfostruct;
 typedef struct threadlocalinfostruct *pthreadlocinfo;
index 3d7ce9a..e8b85ab 100644 (file)
@@ -8,11 +8,11 @@
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the next
  * paragraph) shall be included in all copies or substantial portions of the
  * Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -110,34 +110,38 @@ struct _stat32
        __time32_t st_ctime;    /* Creation time */
 };
 
+#ifndef __STRICT_ANSI__
+struct stat {
+       _dev_t     st_dev;      /* Equivalent to drive number 0=A 1=B ... */
+       _ino_t     st_ino;      /* Always zero ? */
+       _mode_t    st_mode;     /* See above constants */
+       short      st_nlink;    /* Number of links. */
+       short      st_uid;      /* User: Maybe significant on NT ? */
+       short      st_gid;      /* Group: Ditto */
+       _dev_t     st_rdev;     /* Seems useless (not even filled in) */
+       _off_t     st_size;     /* File size in bytes */
+       time_t     st_atime;    /* Accessed date (always 00:00 hrs local
+                                * on FAT) */
+       time_t     st_mtime;    /* Modified time */
+       time_t     st_ctime;    /* Creation time */
+};
+#endif /* __STRICT_ANSI__ */
+
 struct _stat64 {
-       dev_t   st_dev;         /* Equivalent to drive number 0=A 1=B ... */
-       ino_t   st_ino;         /* Always zero ? */
-       mode_t  st_mode;        /* See above constants */
-       short   st_nlink;       /* Number of links. */
-       short   st_uid;         /* User: Maybe significant on NT ? */
-       short   st_gid;         /* Group: Ditto */
-       dev_t   st_rdev;        /* Seems useless (not even filled in) */
-       __int64 st_size;        /* File size in bytes */
+       dev_t      st_dev;      /* Equivalent to drive number 0=A 1=B ... */
+       ino_t      st_ino;      /* Always zero ? */
+       mode_t     st_mode;     /* See above constants */
+       short      st_nlink;    /* Number of links. */
+       short      st_uid;      /* User: Maybe significant on NT ? */
+       short      st_gid;      /* Group: Ditto */
+       dev_t      st_rdev;     /* Seems useless (not even filled in) */
+       _off64_t   st_size;     /* File size in bytes */
        __time64_t st_atime;    /* Accessed date (always 00:00 hrs local
                                 * on FAT) */
        __time64_t st_mtime;    /* Modified time */
        __time64_t st_ctime;    /* Creation time */
 };
 
-struct _stati64 {
-    _dev_t st_dev;
-    _ino_t st_ino;
-    _mode_t st_mode;
-    short st_nlink;
-    short st_uid;
-    short st_gid;
-    _dev_t st_rdev;
-    __int64 st_size;
-    time_t st_atime;
-    time_t st_mtime;
-    time_t st_ctime;
-};
 struct _stat32i64 {
        _dev_t          st_dev;
        _ino_t          st_ino;
@@ -146,11 +150,12 @@ struct _stat32i64 {
        short           st_uid;
        short           st_gid;
        _dev_t          st_rdev;
-       __int64         st_size;
+       _off64_t        st_size;
        __time32_t      st_atime;
        __time32_t      st_mtime;
        __time32_t      st_ctime;
 };
+
 struct _stat64i32 {
        _dev_t          st_dev;
        _ino_t          st_ino;
@@ -159,14 +164,14 @@ struct _stat64i32 {
        short           st_uid;
        short           st_gid;
        _dev_t          st_rdev;
-       __int32         st_size;
+       _off_t          st_size;
        __time64_t      st_atime;
        __time64_t      st_mtime;
        __time64_t      st_ctime;
 };
 
 #define __stat64 _stat64
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+#if defined(_USE_32BIT_TIME_T) && MSVCRT_VERSION >= 800
 #define _fstat      _fstat32
 #define _fstati64   _fstat32i64
 #define _stat       _stat32
@@ -243,13 +248,6 @@ int __cdecl __MINGW_NOTHROW _fstat64i32 (int, struct _stat64i32*);
 #endif
 
 #if !defined(_NO_OLDNAMES) && !defined(__STRICT_ANSI__)
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
-#define stat(a,b) _stat32(a,b)
-#define fstat(a,b) _fstat32(a,b)
-#else
-#define stat(a,b) _stat64i32(a,b)
-#define fstat(a,b) _fstat64i32(a,b)
-#endif
 #define stat _stat
 #define fstat _fstat
 #endif /* !defined(_NO_OLDNAMES) && !defined(__STRICT_ANSI__) */
@@ -286,7 +284,7 @@ int __cdecl __MINGW_NOTHROW _wstat64i32 (const wchar_t*, struct _stat64i32*);
 #define _wstat64i32 _wstat64
 #endif
 
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+#if defined(_USE_32BIT_TIME_T) && MSVCRT_VERSION >= 800
 #define _wstat      _wstat32
 #define _wstati64   _wstat32i64
 #else /* !_USE_32BIT_TIME_T */
index a1c6f1e..c6e02f0 100644 (file)
@@ -8,11 +8,11 @@
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the next
  * paragraph) shall be included in all copies or substantial portions of the
  * Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -80,7 +80,7 @@ _CRTIMP void __cdecl __MINGW_NOTHROW  _ftime (struct _timeb*);
 _CRTIMP void __cdecl __MINGW_NOTHROW   ftime (struct timeb*);
 #endif /* Not _NO_OLDNAMES */
 
-/* This requires newer versions of msvcrt.dll (6.10 or higher).  */ 
+/* This requires newer versions of msvcrt.dll (6.10 or higher).  */
 struct __timeb64
 {
   __time64_t time;
@@ -93,7 +93,7 @@ _CRTIMP void __cdecl __MINGW_NOTHROW  _ftime64 (struct __timeb64*);
 
 _CRTIMP void __cdecl __MINGW_NOTHROW   _ftime32 (struct __timeb32*);
 
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+#if defined(_USE_32BIT_TIME_T) && MSVCRT_VERSION >= 800
 _CRTALIAS void __cdecl __MINGW_NOTHROW _ftime (struct _timeb* _v) { return(_ftime32 ((struct __timeb32*)_v)); }
 #else
 
index 9e12770..06ed622 100644 (file)
@@ -8,11 +8,11 @@
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the next
  * paragraph) shall be included in all copies or substantial portions of the
  * Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -48,7 +48,7 @@ typedef __int64 __time64_t;
 #ifndef _TIME_T_DEFINED
 /* FIXME __STRICT_ANSI__ ! */
 
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+#if defined(_USE_32BIT_TIME_T) && MSVCRT_VERSION >= 800
 typedef        __time32_t time_t;
 #else
 
@@ -61,9 +61,18 @@ typedef      __time64_t time_t;
 #ifndef        _OFF_T_
 #define        _OFF_T_
 typedef long _off_t;
+#ifndef __STRICT_ANSI__
 typedef _off_t off_t;
+#endif /* __STRICT_ANSI__ */
 #endif /* Not _OFF_T_ */
 
+#ifndef _OFF64_T_
+#define _OFF64_T_
+typedef __int64 _off64_t;
+#ifndef __STRICT_ANSI__
+typedef __int64 off64_t;
+#endif /* __STRICT_ANSI__ */
+#endif /* ndef _OFF64_T */
 
 #ifndef _DEV_T_
 #define        _DEV_T_
@@ -121,7 +130,7 @@ typedef int _ssize_t;
 #ifndef        _NO_OLDNAMES
 typedef _ssize_t ssize_t;
 #endif
-#endif /* Not _SSIZE_T_ */ 
+#endif /* Not _SSIZE_T_ */
 
 #ifndef _FPOS64_T_
 #define _FPOS64_T_
index 43bee23..d6c57e1 100644 (file)
@@ -8,11 +8,11 @@
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the next
  * paragraph) shall be included in all copies or substantial portions of the
  * Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -61,7 +61,7 @@ typedef __int64 __time64_t;
 #endif
 
 #ifndef _TIME_T_DEFINED
-# if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+# if defined(_USE_32BIT_TIME_T) && MSVCRT_VERSION >= 800
    typedef     __time32_t time_t;
 # else
    typedef     __time64_t time_t;
@@ -135,42 +135,67 @@ extern _CRTIMP void __cdecl __MINGW_NOTHROW       tzset (void);
 _CRTIMP char* __cdecl __MINGW_NOTHROW  _strdate(char*);
 _CRTIMP char* __cdecl __MINGW_NOTHROW  _strtime(char*);
 
-/* These require newer versions of msvcrt.dll (6.10 or higher). */ 
+/* These require newer versions of msvcrt.dll (6.10 or higher). */
 _CRTIMP __time64_t __cdecl __MINGW_NOTHROW  _time64( __time64_t*);
 _CRTIMP __time64_t __cdecl __MINGW_NOTHROW  _mktime64 (struct tm*);
 _CRTIMP char* __cdecl __MINGW_NOTHROW _ctime64 (const __time64_t*);
 _CRTIMP struct tm*  __cdecl __MINGW_NOTHROW _gmtime64 (const __time64_t*);
 _CRTIMP struct tm*  __cdecl __MINGW_NOTHROW _localtime64 (const __time64_t*);
 
-/* These require newer versions of msvcrt.dll (8.00 or higher). */ 
-_CRTIMP __time32_t __cdecl __MINGW_NOTHROW     _time32 (__time32_t*);
+/* These require newer versions of msvcrt.dll (8.00 or higher). */
+#ifdef MSVCRT_VERSION >= 800
+_CRTIMP __time32_t __cdecl __MINGW_NOTHROW     _time32     (__time32_t*);
 _CRTIMP double    __cdecl __MINGW_NOTHROW      _difftime32 (__time32_t, __time32_t);
 _CRTIMP double    __cdecl __MINGW_NOTHROW      _difftime64 (__time64_t, __time64_t);
-_CRTIMP __time32_t __cdecl __MINGW_NOTHROW     _mktime32 (struct tm*);
+_CRTIMP __time32_t __cdecl __MINGW_NOTHROW     _mktime32   (struct tm*);
 _CRTIMP __time32_t __cdecl __MINGW_NOTHROW     _mkgmtime32 (struct tm*);
 _CRTIMP __time64_t __cdecl __MINGW_NOTHROW     _mkgmtime64 (struct tm*);
-_CRTIMP char*     __cdecl __MINGW_NOTHROW      _ctime32 (const __time32_t*);
-_CRTIMP struct tm* __cdecl __MINGW_NOTHROW     _gmtime32 (const __time32_t*);
-_CRTIMP struct tm* __cdecl __MINGW_NOTHROW     _localtime32 (const __time32_t*);
-
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
-_CRTALIAS time_t          __cdecl __MINGW_NOTHROW      time (time_t* _v)                 { return(_time32 (_v)); }
-_CRTALIAS double          __cdecl __MINGW_NOTHROW      difftime (time_t _v1, time_t _v2) { return(_difftime32 (_v1,_v2)); }
-_CRTALIAS time_t          __cdecl __MINGW_NOTHROW      mktime (struct tm* _v)            { return(_mktime32 (_v)); }
-_CRTALIAS time_t          __cdecl __MINGW_NOTHROW      _mkgmtime (struct tm* _v)         { return(_mkgmtime32 (_v)); }
-_CRTALIAS char*                   __cdecl __MINGW_NOTHROW      ctime (const time_t* _v)          { return(_ctime32 (_v)); }
-_CRTALIAS struct tm*      __cdecl __MINGW_NOTHROW      gmtime (const time_t* _v)         { return(_gmtime32 (_v)); }
-_CRTALIAS struct tm*      __cdecl __MINGW_NOTHROW      localtime (const time_t* _v)      { return(_localtime32 (_v)); }
+_CRTIMP char*     __cdecl __MINGW_NOTHROW      _ctime32    (const __time32_t*);
+_CRTIMP struct tm* __cdecl __MINGW_NOTHROW     _gmtime32   (const __time32_t*);
+_CRTIMP struct tm* __cdecl __MINGW_NOTHROW     _localtime32(const __time32_t*);
+
+#if defined(_USE_32BIT_TIME_T)
+_CRTALIAS time_t          __cdecl __MINGW_NOTHROW      time (time_t* _v)
+    { return(_time32 (_v)); }
+_CRTALIAS double          __cdecl __MINGW_NOTHROW      difftime(time_t _v1, time_t _v2)
+    { return(_difftime32 (_v1,_v2)); }
+_CRTALIAS time_t          __cdecl __MINGW_NOTHROW      mktime (struct tm* _v)
+    { return(_mktime32 (_v)); }
+_CRTALIAS time_t          __cdecl __MINGW_NOTHROW      _mkgmtime (struct tm* _v)
+    { return(_mkgmtime32 (_v)); }
+_CRTALIAS char*                   __cdecl __MINGW_NOTHROW      ctime (const time_t* _v)
+    { return(_ctime32 (_v)); }
+_CRTALIAS struct tm*   __cdecl __MINGW_NOTHROW gmtime (const time_t* _v)
+    { return(_gmtime32 (_v)); }
+_CRTALIAS struct tm*   __cdecl __MINGW_NOTHROW localtime (const time_t* _v)
+    { return(_localtime32 (_v)); }
+
 #else
-_CRTALIAS time_t          __cdecl __MINGW_NOTHROW      time (time_t* _v)                 { return(_time64 (_v)); }
-_CRTALIAS double          __cdecl __MINGW_NOTHROW      difftime (time_t _v1, time_t _v2) { return(_difftime64 (_v1,_v2)); }
-_CRTALIAS time_t          __cdecl __MINGW_NOTHROW      mktime (struct tm* _v)            { return(_mktime64 (_v)); }
-_CRTALIAS time_t          __cdecl __MINGW_NOTHROW      _mkgmtime (struct tm* _v)         { return(_mkgmtime64 (_v)); }
-_CRTALIAS char*                   __cdecl __MINGW_NOTHROW      ctime (const time_t* _v)          { return(_ctime64 (_v)); }
-_CRTALIAS struct tm*      __cdecl __MINGW_NOTHROW      gmtime (const time_t* _v)         { return(_gmtime64 (_v)); }
-_CRTALIAS struct tm*      __cdecl __MINGW_NOTHROW      localtime (const time_t* _v)      { return(_localtime64 (_v)); }
+_CRTALIAS time_t          __cdecl __MINGW_NOTHROW      time (time_t* _v)
+    { return(_time64 (_v)); }
+_CRTALIAS double          __cdecl __MINGW_NOTHROW      difftime(time_t _v1, time_t _v2)
+    { return(_difftime64 (_v1,_v2)); }
+_CRTALIAS time_t          __cdecl __MINGW_NOTHROW      mktime (struct tm* _v)
+    { return(_mktime64 (_v)); }
+_CRTALIAS time_t          __cdecl __MINGW_NOTHROW      _mkgmtime (struct tm* _v)
+    { return(_mkgmtime64 (_v)); }
+_CRTALIAS char*                   __cdecl __MINGW_NOTHROW      ctime (const time_t* _v)
+    { return(_ctime64 (_v)); }
+_CRTALIAS struct tm*   __cdecl __MINGW_NOTHROW gmtime (const time_t* _v)
+    { return(_gmtime64 (_v)); }
+_CRTALIAS struct tm*   __cdecl __MINGW_NOTHROW localtime (const time_t* _v)
+    { return(_localtime64 (_v)); }
 #endif /* _USE_32BIT_TIME_T */
 
+#else /* MSVCRT_VERSION < 800 */
+_CRTIMP time_t     __cdecl __MINGW32_NOTHROW time       (time_t*);
+_CRTIMP double     __cdecl __MINGW32_NOTHROW difftime   (time_t, time_t);
+_CRTIMP time_t     __cdecl __MINGW32_NOTHROW mktime     (struct tm*);
+_CRTIMP char*      __cdecl __MINGW32_NOTRHOW ctime      (const time_t*);
+_CRTIMP struct tm* __cdecl __MINGW32_NOTHROW gmtime     (const time_t*);
+_CRTIMP struct tm* __cdecl __MINGW32_NOTHROW localtime  (const time_t*);
+#endif /* MSVCRT_VERSION >= 800 */
+
 /*
  * _daylight: non zero if daylight savings time is used.
  * _timezone: difference in seconds between GMT and local time.
@@ -205,19 +230,21 @@ _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW  _wctime(const time_t*);
 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW       _wstrdate(wchar_t*);
 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW       _wstrtime(wchar_t*);
 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW       _wctime64 (const __time64_t*);
+#ifdef MSVCRT_VERSION >= 800
 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW       _wctime32 (const __time32_t*);
+#endif
 
-#ifndef _USE_32BIT_TIME_T
-_CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW     _wctime (const time_t* _v) { return(_wctime64 (_v)); }
-#else
+#ifdef _USE_32BIT_TIME_T && MSVCRT_VERSION >= 800
 _CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW     _wctime (const time_t* _v) { return(_wctime32 (_v)); }
+#else
+_CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW     _wctime (const time_t* _v) { return(_wctime64 (_v)); }
 #endif
 
 #endif /* __STRICT_ANSI__ */
 
 _CRTIMP size_t __cdecl __MINGW_NOTHROW         wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
 #define _WTIME_DEFINED
-#endif /* _WTIME_DEFINED */ 
+#endif /* _WTIME_DEFINED */
 
 #ifdef __cplusplus
 }
index e84bf05..38224e4 100644 (file)
@@ -8,11 +8,11 @@
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the next
  * paragraph) shall be included in all copies or substantial portions of the
  * Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  * not.
  */
 #include <wctype.h>
-
-#ifndef        __STRICT_ANSI__
-/* This is necessary to support the the non-ANSI wchar declarations
-   here. */
 #include <sys/types.h>
-#endif /* __STRICT_ANSI__ */
 
 #define WCHAR_MIN      0
 #define WCHAR_MAX      0xffff
@@ -201,7 +196,7 @@ _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW    _wstrtime (wchar_t*);
 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW       _wctime64 (const __time64_t*);
 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW       _wctime32 (const __time32_t*);
 
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+#if defined(_USE_32BIT_TIME_T) && MSVCRT_VERSION >= 800
 _CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW     _wctime (const time_t* _v)      { return(_wctime32 (_v)); }
 #else
 
@@ -413,12 +408,12 @@ _CRTIMP long __cdecl __MINGW_NOTHROW      _wfindfirst32i64 (const wchar_t*, struct _w
 _CRTIMP long __cdecl __MINGW_NOTHROW   _wfindfirst64i32 (const wchar_t*, struct _wfinddata64i32_t*);
 _CRTIMP int  __cdecl __MINGW_NOTHROW   _wfindnext32i64 (long, struct _wfinddata32i64_t*);
 _CRTIMP int  __cdecl __MINGW_NOTHROW   _wfindnext64i32 (long, struct _wfinddata64i32_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*);
 _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct __wfinddata64_t*);
 _CRTIMP long __cdecl __MINGW_NOTHROW   _wfindfirst32 (const wchar_t*, struct __wfinddata32_t*);
 _CRTIMP int  __cdecl __MINGW_NOTHROW   _wfindnext32 (long, struct __wfinddata32_t*);
 
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+#if defined(_USE_32BIT_TIME_T) && MSVCRT_VERSION >= 800
 _CRTALIAS long __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t* _v1, struct _wfinddata_t* _v2)       { return(_wfindfirst32 (_v1,(struct __wfinddata32_t*)_v2)); }
 _CRTALIAS int  __cdecl __MINGW_NOTHROW _wfindnext (long _v1, struct _wfinddata_t* _v2)                  { return(_wfindnext32  (_v1,(struct __wfinddata32_t*)_v2)); }
 _CRTALIAS long __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t* _v1, struct _wfinddatai64_t* _v2) { return(_wfindfirst32i64 (_v1,(struct _wfinddata32i64_t*)_v2)); }
@@ -468,6 +463,23 @@ struct _stat32
        __time32_t st_ctime;    /* Creation time */
 };
 
+#ifndef __STRICT_ANSI__
+struct stat {
+    _dev_t  st_dev;    /* Equivalent to drive number 0=A 1=B ... */
+    _ino_t  st_ino;    /* Always zero ? */
+    _mode_t st_mode;   /* See above constants */
+    short   st_nlink;  /* Number of links. */
+    short   st_uid;    /* User: Maybe significant on NT ? */
+    short   st_gid;    /* Group: Ditto */
+    _dev_t  st_rdev;   /* Seems useless (not even filled in) */
+    _off_t  st_size;   /* File size in bytes */
+    time_t  st_atime;  /* Accessed date (always 00:00 hrs local
+                        * on FAT) */
+    time_t  st_mtime;  /* Modified time */
+    time_t  st_ctime;  /* Creation time */
+} ;
+#endif /* __STRICT_ANSI__ */
+
 struct _stat64 {
        dev_t   st_dev;         /* Equivalent to drive number 0=A 1=B ... */
        ino_t   st_ino;         /* Always zero ? */
@@ -476,26 +488,13 @@ struct _stat64 {
        short   st_uid;         /* User: Maybe significant on NT ? */
        short   st_gid;         /* Group: Ditto */
        dev_t   st_rdev;        /* Seems useless (not even filled in) */
-       __int64 st_size;        /* File size in bytes */
+       _off64_t st_size;       /* File size in bytes */
        __time64_t st_atime;    /* Accessed date (always 00:00 hrs local
                                 * on FAT) */
        __time64_t st_mtime;    /* Modified time */
        __time64_t st_ctime;    /* Creation time */
 };
 
-struct _stati64 {
-    _dev_t st_dev;
-    _ino_t st_ino;
-    _mode_t st_mode;
-    short st_nlink;
-    short st_uid;
-    short st_gid;
-    _dev_t st_rdev;
-    __int64 st_size;
-    time_t st_atime;
-    time_t st_mtime;
-    time_t st_ctime;
-};
 struct _stat32i64 {
        _dev_t          st_dev;
        _ino_t          st_ino;
@@ -504,11 +503,12 @@ struct _stat32i64 {
        short           st_uid;
        short           st_gid;
        _dev_t          st_rdev;
-       __int64         st_size;
+       _off64_t        st_size;
        __time32_t      st_atime;
        __time32_t      st_mtime;
        __time32_t      st_ctime;
-};
+} ;
+
 struct _stat64i32 {
        _dev_t          st_dev;
        _ino_t          st_ino;
@@ -517,14 +517,14 @@ struct _stat64i32 {
        short           st_uid;
        short           st_gid;
        _dev_t          st_rdev;
-       __int32         st_size;
+       _off_t          st_size;
        __time64_t      st_atime;
        __time64_t      st_mtime;
        __time64_t      st_ctime;
 };
 
 #define __stat64 _stat64
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+#if defined(_USE_32BIT_TIME_T) && MSVCRT_VERSION >= 800
 #define _fstat      _fstat32
 #define _fstati64   _fstat32i64
 #define _stat       _stat32
@@ -570,7 +570,7 @@ int __cdecl __MINGW_NOTHROW _wstat64i32 (const wchar_t*, struct _stat64i32*);
 #define _wstat64i32 _wstat64
 #endif
 
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+#if defined(_USE_32BIT_TIME_T) && MSVCRT_VERSION >= 800
 #define _wstat      _wstat32
 #define _wstati64   _wstat32i64
 #else
index 79bc312..29e95a8 100644 (file)
@@ -1,5 +1,5 @@
 ;
-; __FILENAME__ 
+; __FILENAME__
 ;    created from msvcrt.def.in
 ;* This file has no copyright assigned and is placed in the Public Domain.
 ;* This file is a part of the mingw-runtime package.
@@ -148,9 +148,7 @@ _cprintf
 _cputs
 _creat
 _cscanf
-#if  !(__msvcr71__ || __msvcr71d__ || __msvcr80__ || __msvcr80d__ || __msvcr90__ || msvcr90d__ || __msvcr100__ || __msvcr100d__)
 _ctype DATA
-#endif
 _cwait
 _daylight DATA
 _dstbias DATA
@@ -185,12 +183,10 @@ _filelength
 _filelengthi64
 _fileno
 _findclose
-#if __MSVCRT_VERSION__ < 0x0800
 _findfirst
 _findfirsti64
 _findnext
 _findnexti64
-#endif
 _finite
 _flsbuf
 _flushall
@@ -201,16 +197,12 @@ _fpreset DATA
 _fputchar
 _fputwchar
 _fsopen
-#if __MSVCRT_VERSION__ < 0x0800
 _fstat
 _fstati64
 _ftime
-#endif
 _ftol
 _fullpath
-#if __MSVCRT_VERSION__ < 0x0800
 _futime
-#endif
 _gcvt
 _get_osfhandle
 _get_sbh_threshold
@@ -408,10 +400,8 @@ _spawnve
 _spawnvp
 _spawnvpe
 _splitpath
-#if __MSVCRT_VERSION__ < 0x0800
 _stat
 _stati64
-#endif
 _statusfp
 _strcmpi
 _strdate
@@ -448,9 +438,7 @@ _ungetch
 _unlink
 _unloaddll
 _unlock
-#if __MSVCRT_VERSION__ < 0x0800
 _utime
-#endif
 _vsnprintf
 _vsnwprintf
 _waccess
@@ -470,9 +458,7 @@ _wcsnset
 _wcsrev
 _wcsset
 _wcsupr
-#if __MSVCRT_VERSION__ < 0x0800
 _wctime
-#endif
 _wenviron DATA
 _wexecl
 _wexecle
@@ -483,12 +469,10 @@ _wexecve
 _wexecvp
 _wexecvpe
 _wfdopen
-#if __MSVCRT_VERSION__ < 0x0800
 _wfindfirst
 _wfindfirsti64
 _wfindnext
 _wfindnexti64
-#endif
 _wfopen
 _wfreopen
 _wfsopen
@@ -523,10 +507,8 @@ _wspawnve
 _wspawnvp
 _wspawnvpe
 _wsplitpath
-#if __MSVCRT_VERSION__ < 0x0800
 _wstat
 _wstati64
-#endif
 _wstrdate
 _wstrtime
 _wsystem
@@ -536,9 +518,7 @@ _wtoi
 _wtoi64
 _wtol
 _wunlink
-#if __MSVCRT_VERSION__ < 0x0800
 _wutime
-#endif
 _y0
 _y1
 _yn
@@ -560,10 +540,8 @@ clearerr
 clock
 cos
 cosh
-#if __MSVCRT_VERSION__ < 0x0800
 ctime
 difftime
-#endif
 div
 exit
 exp
@@ -602,9 +580,7 @@ getenv
 gets
 getwc
 getwchar
-#if __MSVCRT_VERSION__ < 0x0800
 gmtime
-#endif
 is_wctype
 isalnum
 isalpha
@@ -635,9 +611,7 @@ labs
 ldexp
 ldiv
 localeconv
-#if __MSVCRT_VERSION__ < 0x0800
 localtime
-#endif
 log
 log10
 longjmp
@@ -650,9 +624,7 @@ memcmp
 memcpy
 memmove
 memset
-#if __MSVCRT_VERSION__ < 0x0800
 mktime
-#endif
 modf
 perror
 pow
@@ -706,9 +678,7 @@ swscanf
 system
 tan
 tanh
-#if __MSVCRT_VERSION__ < 0x0800
 time
-#endif
 tmpfile
 tmpnam
 tolower
@@ -822,7 +792,6 @@ _wcstoui64
 _wctype
 _wtof
 _get_heap_handle
-#if ( __msvcr70__ || __msvcr70d__ ||  __msvcr71__ || __msvcr71d__ || __msvcr80__ || __msvcr80d__ || __msvcr90__ || __msvcr90d__ || __msvcr100__ || __msvcr100d__)
 ; msvcr70.dll and later
 __buffer_overrun
 __lc_clike
@@ -830,14 +799,10 @@ __security_error_handler
 __set_buffer_overrun_handler
 _CRT_RTC_INIT
 _set_security_error_handler
-#endif  /* 7.0 */
-#if  (__msvcr71__ || __msvcr71d__ || __msvcr80__ || __msvcr80d__ || __msvcr90__ || __msvcr90d__ || __msvcr100__ || __msvcr100d__)
 ; msvcr71.dll
 __CppXcptFilter
 __CxxCallUnwindVecDtor
 _set_purecall_handler
-#endif /* 7.1  */
-#if ( __msvcr80__ || __msvcr80d__ || __msvcr90__ || __msvcr90d__ || __msvcr100__ || __msvcr100d__)
 ; msvcr80.dll
 _get_output_format
 _set_output_format
@@ -886,4 +851,3 @@ _wstat32
 _wstat32i64
 _wstat64i32
 _wutime32
-#endif