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 <[email protected]>
---
 mingw-w64-headers/crt/sys/stat.h              | 35 -------------------
 mingw-w64-headers/crt/sys/timeb.h             | 29 ---------------
 mingw-w64-headers/crt/sys/types.h             | 26 --------------
 mingw-w64-headers/crt/sys/utime.h             | 34 ------------------
 mingw-w64-headers/crt/time.h                  | 28 ---------------
 mingw-w64-headers/ddk/include/ddk/ntstrsafe.h |  5 ---
 mingw-w64-headers/include/basetyps.h          |  5 ---
 mingw-w64-headers/include/dbt.h               |  5 ---
 mingw-w64-headers/include/rpcndr.h            |  5 ---
 mingw-w64-headers/include/rtcapi.h            |  5 ---
 mingw-w64-headers/include/strsafe.h           |  5 ---
 11 files changed, 182 deletions(-)

diff --git a/mingw-w64-headers/crt/sys/stat.h b/mingw-w64-headers/crt/sys/stat.h
index f2e243ef9..2255900e7 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 174f2ebd5..2bb9584bd 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 bc0a54fc4..e662d3106 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 4a7dd5dde..a93bee1eb 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 5bcbab7c2..bd19acfce 100644
--- a/mingw-w64-headers/crt/time.h
+++ b/mingw-w64-headers/crt/time.h
@@ -17,34 +17,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 95f4dd4d6..2b4a0a03e 100644
--- a/mingw-w64-headers/ddk/include/ddk/ntstrsafe.h
+++ b/mingw-w64-headers/ddk/include/ddk/ntstrsafe.h
@@ -26,11 +26,6 @@ typedef unsigned int size_t;
 #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 dbfdcea40..d3d4484c1 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 7d44eaa3b..999311ac0 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 7b4a23261..a7579c009 100644
--- a/mingw-w64-headers/include/rpcndr.h
+++ b/mingw-w64-headers/include/rpcndr.h
@@ -100,11 +100,6 @@ extern "C" {
 #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 aec6db6fb..406594b97 100644
--- a/mingw-w64-headers/include/rtcapi.h
+++ b/mingw-w64-headers/include/rtcapi.h
@@ -21,11 +21,6 @@ extern "C" {
 #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 5923612c9..245078a09 100644
--- a/mingw-w64-headers/include/strsafe.h
+++ b/mingw-w64-headers/include/strsafe.h
@@ -36,11 +36,6 @@ typedef int ssize_t;
 #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;
-- 
2.55.0.windows.4



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to