Index: sys/stat.h
==================================================================
--- sys/stat.h
+++ sys/stat.h
@@ -164,11 +164,11 @@
 	__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)
 #define _fstat      _fstat32
 #define _fstati64   _fstat32i64
 #define _stat       _stat32
 #define _stati64    _stat32i64
 #else  /* !_USE_32BIT_TIME_T */
@@ -240,11 +240,11 @@
 #define _stat64i32 _stat64
 #define _fstat64i32 _fstat64
 #endif
 
 #if !defined(_NO_OLDNAMES) && !defined(__STRICT_ANSI__)
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+#if defined(_USE_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)
@@ -282,11 +282,11 @@
   }
 #else
 #define _wstat64i32 _wstat64
 #endif
 
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+#if defined(_USE_32BIT_TIME_T)
 #define _wstat      _wstat32
 #define _wstati64   _wstat32i64
 #else /* !_USE_32BIT_TIME_T */
 
 #define _wstat      _wstat64i32

Index: sys/timeb.h
==================================================================
--- sys/timeb.h
+++ sys/timeb.h
@@ -91,14 +91,11 @@
 
 _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)
-_CRTALIAS void __cdecl __MINGW_NOTHROW	_ftime (struct _timeb* _v) { return(_ftime32 ((struct __timeb32*)_v)); }
-#else
-
+#if !defined(_USE_32BIT_TIME_T)
 _CRTALIAS void __cdecl __MINGW_NOTHROW	_ftime (struct _timeb* _v) { return(_ftime64 ((struct __timeb64*)_v)); }
 #endif
 
 #ifdef	__cplusplus
 }

Index: sys/types.h
==================================================================
--- sys/types.h
+++ sys/types.h
@@ -46,11 +46,11 @@
 #endif
 
 #ifndef _TIME_T_DEFINED
 /* FIXME __STRICT_ANSI__ ! */
 
-#if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+#if defined(_USE_32BIT_TIME_T)
 typedef	__time32_t time_t;
 #else
 
 typedef	__time64_t time_t;
 #endif /* _USE_32BIT_TIME_T */

Index: time.h
==================================================================
--- time.h
+++ time.h
@@ -59,11 +59,11 @@
 typedef __int64 __time64_t;
 #define _TIME64_T_DEFINED
 #endif
 
 #ifndef _TIME_T_DEFINED
-# if defined(_USE_32BIT_TIME_T) && defined(_HAVE_32BIT_TIME_T)
+# if defined(_USE_32BIT_TIME_T)
    typedef	__time32_t time_t;
 # else
    typedef	__time64_t time_t;
 # endif /* _USE_32BIT_TIME_T */
 # define _TIME_T_DEFINED
@@ -141,29 +141,23 @@
 _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). */ 
+#if defined(_HAVE_32BIT_TIME_T)
 _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	_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*);
+#endif /* _HAVE_32BIT_TIME_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)); }
-#else
+#if !defined(_USE_32BIT_TIME_T)
 _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)); }
@@ -207,12 +201,10 @@
 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW	_wctime64 (const __time64_t*);
 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW	_wctime32 (const __time32_t*);
 
 #ifndef _USE_32BIT_TIME_T
 _CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW	_wctime (const time_t* _v) { return(_wctime64 (_v)); }
-#else
-_CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW	_wctime (const time_t* _v) { return(_wctime32 (_v)); }
 #endif
 
 #endif /* __STRICT_ANSI__ */
 
 _CRTIMP size_t __cdecl __MINGW_NOTHROW		wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);

Index: wchar.h
==================================================================
--- wchar.h
+++ wchar.h
@@ -81,13 +81,28 @@
 	int	_bufsiz;
 	char*	_tmpfname;
 } FILE;
 #endif	/* Not _FILE_DEFINED */
 
-#ifndef _TIME_T_DEFINED  /* Also in time.h */
-typedef long time_t;
-#define _TIME_T_DEFINED
+#ifndef _TIME32_T_DEFINED
+typedef __int32 __time32_t;
+#define _TIME32_T_DEFINED
+#endif
+
+#ifndef _TIME64_T_DEFINED
+/* A 64-bit time_t to get to Y3K */
+typedef __int64 __time64_t;
+#define _TIME64_T_DEFINED
+#endif
+
+#ifndef _TIME_T_DEFINED
+# if defined(_USE_32BIT_TIME_T)
+   typedef	__time32_t time_t;
+# else
+   typedef	__time64_t time_t;
+# endif /* _USE_32BIT_TIME_T */
+# define _TIME_T_DEFINED
 #endif
 
 #ifndef _TM_DEFINED /* Also in time.h */
 struct tm {
         int tm_sec;     /* seconds after the minute - [0,59] */

