headers: deduplicate macros, part 1

This commit removes following duplicate macros and/or typedefs:
1. _USE_32BIT_TIME_T
2. _TIME32_T_DEFINED
3. _TIME64_T_DEFINED
4. _TIME_T_DEFINED
5. _WCHAR_T_DEFINED
6. _CRTIMP

2-5 are defined in <corecrt.h>, 1 and 6 are defined in <_mingw.h>.
All guard macros in <corecrt.h> and <_mingw.h> are kept, as these macros
may be pre-defined by user code or other headers.

Signed-off-by: Zhongteng Gui <dragon-archer@outlook.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
diff --git a/mingw-w64-headers/crt/sys/stat.h b/mingw-w64-headers/crt/sys/stat.h
index f2e243e..2255900 100644
--- a/mingw-w64-headers/crt/sys/stat.h
+++ b/mingw-w64-headers/crt/sys/stat.h
@@ -15,42 +15,7 @@
 
 _CRT_BEGIN_C_HEADER
 
-#ifndef _CRTIMP
-#define _CRTIMP __declspec(dllimport)
-#endif
-
 #include <sys/types.h>
-
-#ifdef _USE_32BIT_TIME_T
-#ifdef _WIN64
-#undef _USE_32BIT_TIME_T
-#endif
-#endif
-
-#ifndef _TIME32_T_DEFINED
-  typedef long __time32_t;
-#define _TIME32_T_DEFINED
-#endif
-
-#ifndef _TIME64_T_DEFINED
-  __MINGW_EXTENSION typedef __int64 __time64_t;
-#define _TIME64_T_DEFINED
-#endif
-
-#ifndef _TIME_T_DEFINED
-#ifdef _USE_32BIT_TIME_T
-  typedef __time32_t time_t;
-#else
-  typedef __time64_t time_t;
-#endif
-#define _TIME_T_DEFINED
-#endif
-
-#ifndef _WCHAR_T_DEFINED
-  typedef unsigned short wchar_t;
-#define _WCHAR_T_DEFINED
-#endif
-
 #include <_mingw_stat64.h>
 
 #define _S_IFMT 0xF000
diff --git a/mingw-w64-headers/crt/sys/timeb.h b/mingw-w64-headers/crt/sys/timeb.h
index 174f2eb..2bb9584 100644
--- a/mingw-w64-headers/crt/sys/timeb.h
+++ b/mingw-w64-headers/crt/sys/timeb.h
@@ -14,35 +14,6 @@
 
 _CRT_BEGIN_C_HEADER
 
-#ifndef _CRTIMP
-#define _CRTIMP __declspec(dllimport)
-#endif
-
-#ifdef _USE_32BIT_TIME_T
-#ifdef _WIN64
-#undef _USE_32BIT_TIME_T
-#endif
-#endif
-
-#ifndef _TIME32_T_DEFINED
-  typedef long __time32_t;
-#define _TIME32_T_DEFINED
-#endif
-
-#ifndef _TIME64_T_DEFINED
-  __MINGW_EXTENSION typedef __int64 __time64_t;
-#define _TIME64_T_DEFINED
-#endif
-
-#ifndef _TIME_T_DEFINED
-#ifdef _USE_32BIT_TIME_T
-  typedef __time32_t time_t;
-#else
-  typedef __time64_t time_t;
-#endif
-#define _TIME_T_DEFINED
-#endif
-
 #ifndef _TIMEB_DEFINED
 #define _TIMEB_DEFINED
 
diff --git a/mingw-w64-headers/crt/sys/types.h b/mingw-w64-headers/crt/sys/types.h
index bc0a54f..e662d31 100644
--- a/mingw-w64-headers/crt/sys/types.h
+++ b/mingw-w64-headers/crt/sys/types.h
@@ -12,32 +12,6 @@
 
 #include <crtdefs.h>
 
-#ifdef _USE_32BIT_TIME_T
-#ifdef _WIN64
-#undef _USE_32BIT_TIME_T
-#endif
-#endif
-
-#ifndef _TIME32_T_DEFINED
-#define _TIME32_T_DEFINED
-typedef long	__time32_t;
-#endif
-
-#ifndef _TIME64_T_DEFINED
-#define _TIME64_T_DEFINED
-__MINGW_EXTENSION
-typedef __int64	__time64_t;
-#endif
-
-#ifndef _TIME_T_DEFINED
-#define _TIME_T_DEFINED
-#ifdef _USE_32BIT_TIME_T
-typedef __time32_t time_t;
-#else
-typedef __time64_t time_t;
-#endif
-#endif
-
 #ifndef _INO_T_DEFINED
 #define _INO_T_DEFINED
 typedef unsigned short _ino_t;
diff --git a/mingw-w64-headers/crt/sys/utime.h b/mingw-w64-headers/crt/sys/utime.h
index 4a7dd5d..a93bee1 100644
--- a/mingw-w64-headers/crt/sys/utime.h
+++ b/mingw-w64-headers/crt/sys/utime.h
@@ -14,40 +14,6 @@
 
 _CRT_BEGIN_C_HEADER
 
-#ifndef _CRTIMP
-#define _CRTIMP __declspec(dllimport)
-#endif
-
-#ifndef _WCHAR_T_DEFINED
-  typedef unsigned short wchar_t;
-#define _WCHAR_T_DEFINED
-#endif
-
-#ifdef _USE_32BIT_TIME_T
-#ifdef _WIN64
-#undef _USE_32BIT_TIME_T
-#endif
-#endif
-
-#ifndef _TIME32_T_DEFINED
-#define _TIME32_T_DEFINED
-  typedef long __time32_t;
-#endif
-
-#ifndef _TIME64_T_DEFINED
-#define _TIME64_T_DEFINED
-  __MINGW_EXTENSION typedef __int64 __time64_t;
-#endif
-
-#ifndef _TIME_T_DEFINED
-#define _TIME_T_DEFINED
-#ifdef _USE_32BIT_TIME_T
-  typedef __time32_t time_t;
-#else
-  typedef __time64_t time_t;
-#endif
-#endif
-
 #ifndef _UTIMBUF_DEFINED
 #define _UTIMBUF_DEFINED
 
diff --git a/mingw-w64-headers/crt/time.h b/mingw-w64-headers/crt/time.h
index e5ab7e9..7b6041a 100644
--- a/mingw-w64-headers/crt/time.h
+++ b/mingw-w64-headers/crt/time.h
@@ -18,34 +18,6 @@
 
 _CRT_BEGIN_C_HEADER
 
-#ifndef _CRTIMP
-#define _CRTIMP __declspec(dllimport)
-#endif
-
-#ifndef _WCHAR_T_DEFINED
-#define _WCHAR_T_DEFINED
-  typedef unsigned short wchar_t;
-#endif
-
-#ifndef _TIME32_T_DEFINED
-#define _TIME32_T_DEFINED
-  typedef long __time32_t;
-#endif
-
-#ifndef _TIME64_T_DEFINED
-#define _TIME64_T_DEFINED
-  __MINGW_EXTENSION typedef __int64 __time64_t;
-#endif
-
-#ifndef _TIME_T_DEFINED
-#define _TIME_T_DEFINED
-#ifdef _USE_32BIT_TIME_T
-  typedef __time32_t time_t;
-#else
-  typedef __time64_t time_t;
-#endif
-#endif
-
 #ifndef _CLOCK_T_DEFINED
 #define _CLOCK_T_DEFINED
   typedef long clock_t;
diff --git a/mingw-w64-headers/ddk/include/ddk/ntstrsafe.h b/mingw-w64-headers/ddk/include/ddk/ntstrsafe.h
index 95f4dd4..2b4a0a0 100644
--- a/mingw-w64-headers/ddk/include/ddk/ntstrsafe.h
+++ b/mingw-w64-headers/ddk/include/ddk/ntstrsafe.h
@@ -26,11 +26,6 @@
 #endif
 #endif
 
-#ifndef _WCHAR_T_DEFINED
-#define _WCHAR_T_DEFINED
-typedef unsigned short wchar_t;
-#endif
-
 #ifndef _NTSTATUS_DEFINED
 #define _NTSTATUS_DEFINED
 typedef __LONG32 NTSTATUS;
diff --git a/mingw-w64-headers/include/basetyps.h b/mingw-w64-headers/include/basetyps.h
index dbfdcea..d3d4484 100644
--- a/mingw-w64-headers/include/basetyps.h
+++ b/mingw-w64-headers/include/basetyps.h
@@ -89,9 +89,4 @@
 typedef unsigned __LONG32 error_status_t;
 #endif
 
-#ifndef _WCHAR_T_DEFINED
-#define _WCHAR_T_DEFINED
-typedef unsigned short wchar_t;
-#endif
-
 #endif
diff --git a/mingw-w64-headers/include/dbt.h b/mingw-w64-headers/include/dbt.h
index 7d44eaa..999311a 100644
--- a/mingw-w64-headers/include/dbt.h
+++ b/mingw-w64-headers/include/dbt.h
@@ -15,11 +15,6 @@
 #define DBTFAR far
 #endif
 
-#ifndef _WCHAR_T_DEFINED
-#define _WCHAR_T_DEFINED
-typedef unsigned short wchar_t;
-#endif
-
 #include <guiddef.h>
 
 #define BSF_QUERY 0x00000001
diff --git a/mingw-w64-headers/include/rpcndr.h b/mingw-w64-headers/include/rpcndr.h
index 7b4a232..a7579c0 100644
--- a/mingw-w64-headers/include/rpcndr.h
+++ b/mingw-w64-headers/include/rpcndr.h
@@ -100,11 +100,6 @@
 #define MIDL_uhyper /* __MINGW_EXTENSION */ unsigned __int64
 #endif
 
-#ifndef _WCHAR_T_DEFINED
-#define _WCHAR_T_DEFINED
-  typedef unsigned short wchar_t;
-#endif
-
 #ifndef _SIZE_T_DEFINED
 #define _SIZE_T_DEFINED
 #undef size_t
diff --git a/mingw-w64-headers/include/rtcapi.h b/mingw-w64-headers/include/rtcapi.h
index aec6db6..406594b 100644
--- a/mingw-w64-headers/include/rtcapi.h
+++ b/mingw-w64-headers/include/rtcapi.h
@@ -21,11 +21,6 @@
 #define _RTC_ERRTYPE_IGNORE -1
 #define _RTC_ERRTYPE_ASK -2
 
-#ifndef _WCHAR_T_DEFINED
-#define _WCHAR_T_DEFINED
-  typedef unsigned short wchar_t;
-#endif
-
   typedef int (__cdecl *_RTC_error_fn)(int,const char *,int,const char *,const char *,...);
   typedef int (__cdecl *_RTC_error_fnW)(int,const wchar_t *,int,const wchar_t *,const wchar_t *,...);
 
diff --git a/mingw-w64-headers/include/strsafe.h b/mingw-w64-headers/include/strsafe.h
index 5923612..245078a 100644
--- a/mingw-w64-headers/include/strsafe.h
+++ b/mingw-w64-headers/include/strsafe.h
@@ -36,11 +36,6 @@
 #endif
 #endif
 
-#ifndef _WCHAR_T_DEFINED
-#define _WCHAR_T_DEFINED
-typedef unsigned short wchar_t;
-#endif
-
 #ifndef _HRESULT_DEFINED
 #define _HRESULT_DEFINED
 typedef __LONG32 HRESULT;