headers: deduplicate macros, part 2

This commit removes following duplicate macros and/or typedefs:
1. _SIZE_T_DEFINED
2. _SSIZE_T_DEFINED
3. _WCTYPE_T_DEFINED

All are defined in <corecrt.h>. Note that <stddef.h> is not modified
here because it's much more complicated.

Also slightly simplified <tchar.h> by removing unnecessary
_CRT_BEGIN_C_HEADER and _CRT_END_C_HEADER macros.

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/tchar.h b/mingw-w64-headers/crt/tchar.h
index 059cc83..cc0a954 100644
--- a/mingw-w64-headers/crt/tchar.h
+++ b/mingw-w64-headers/crt/tchar.h
@@ -12,8 +12,6 @@
 #error Need to include strsafe.h after tchar.h
 #endif
 
-_CRT_BEGIN_C_HEADER
-
 #ifndef __CYGWIN__
 
 #define _ftcscat _tcscat
@@ -72,22 +70,10 @@
 
 #ifdef _UNICODE
 
-_CRT_END_C_HEADER
-
 #include <wchar.h>
 
 _CRT_BEGIN_C_HEADER
 
-#ifndef __CYGWIN__
-
-#ifndef _WCTYPE_T_DEFINED
-#define _WCTYPE_T_DEFINED
-  typedef unsigned short wint_t;
-  typedef unsigned short wctype_t;
-#endif
-
-#endif /* __CYGWIN__ */
-
 #ifndef __TCHAR_DEFINED
 #define __TCHAR_DEFINED
   typedef wchar_t _TCHAR;
@@ -493,13 +479,11 @@
 
 #endif /* __CYGWIN__ */
 
-#else /* _UNICODE */
-
 _CRT_END_C_HEADER
 
-#include <string.h>
+#else /* _UNICODE */
 
-_CRT_BEGIN_C_HEADER
+#include <string.h>
 
 #define _TEOF EOF
 
@@ -783,14 +767,10 @@
 
 #ifdef _MBCS
 
-_CRT_END_C_HEADER
-
 #ifndef __CYGWIN__
 
 #include <mbstring.h>
 
-_CRT_BEGIN_C_HEADER
-
 #ifndef __TCHAR_DEFINED
   typedef char _TCHAR;
   typedef signed char _TSCHAR;
@@ -881,6 +861,8 @@
 #define _tccpy_l _mbccpy_l
 #else
 
+_CRT_BEGIN_C_HEADER
+
   _CRTIMP _CONST_RETURN char *__cdecl _tcschr(const char *_Str,unsigned int _Val);
   _CRTIMP size_t __cdecl _tcscspn(const char *_Str,const char *_Control);
   _CRTIMP char *__cdecl _tcsncat(char *_Dst,const char *_Src,size_t _MaxCount);
@@ -942,6 +924,8 @@
   _CRTIMP size_t __cdecl _tclen(const char *_Str);
   _CRTIMP void __cdecl _tccpy(char *_DstCh,const char *_SrcCh);
 
+_CRT_END_C_HEADER
+
 #ifdef __cplusplus
 #ifndef _CPP_TCHAR_INLINES_DEFINED
 #define _CPP_TCHAR_INLINES_DEFINED
@@ -1159,8 +1143,6 @@
 #define _T(x) __T(x)
 #define _TEXT(x) __T(x)
 
-_CRT_END_C_HEADER
-
 #ifndef __CYGWIN__
 #include <sec_api/tchar_s.h>
 #endif /* __CYGWIN__ */
diff --git a/mingw-w64-headers/crt/time.h b/mingw-w64-headers/crt/time.h
index 7b6041a..b0e8cee 100644
--- a/mingw-w64-headers/crt/time.h
+++ b/mingw-w64-headers/crt/time.h
@@ -23,26 +23,6 @@
   typedef long clock_t;
 #endif
 
-#ifndef _SIZE_T_DEFINED
-#define _SIZE_T_DEFINED
-#undef size_t
-#ifdef _WIN64
-  __MINGW_EXTENSION typedef unsigned __int64 size_t;
-#else
-  typedef unsigned int size_t;
-#endif
-#endif
-
-#ifndef _SSIZE_T_DEFINED
-#define _SSIZE_T_DEFINED
-#undef ssize_t
-#ifdef _WIN64
-  __MINGW_EXTENSION typedef __int64 ssize_t;
-#else
-  typedef int ssize_t;
-#endif
-#endif
-
 #ifndef NULL
 #ifdef __cplusplus
 #ifndef _WIN64
diff --git a/mingw-w64-headers/ddk/include/ddk/ntstrsafe.h b/mingw-w64-headers/ddk/include/ddk/ntstrsafe.h
index 2b4a0a0..e2106e3 100644
--- a/mingw-w64-headers/ddk/include/ddk/ntstrsafe.h
+++ b/mingw-w64-headers/ddk/include/ddk/ntstrsafe.h
@@ -16,16 +16,6 @@
 #define __STRSAFE__NO_INLINE
 #endif
 
-#ifndef _SIZE_T_DEFINED
-#define _SIZE_T_DEFINED
-#undef size_t
-#ifdef _WIN64
-__MINGW_EXTENSION typedef unsigned __int64 size_t;
-#else
-typedef unsigned int size_t;
-#endif
-#endif
-
 #ifndef _NTSTATUS_DEFINED
 #define _NTSTATUS_DEFINED
 typedef __LONG32 NTSTATUS;
diff --git a/mingw-w64-headers/include/rpcndr.h b/mingw-w64-headers/include/rpcndr.h
index a7579c0..a7315ea 100644
--- a/mingw-w64-headers/include/rpcndr.h
+++ b/mingw-w64-headers/include/rpcndr.h
@@ -100,26 +100,6 @@
 #define MIDL_uhyper /* __MINGW_EXTENSION */ unsigned __int64
 #endif
 
-#ifndef _SIZE_T_DEFINED
-#define _SIZE_T_DEFINED
-#undef size_t
-#ifdef _WIN64
-  __MINGW_EXTENSION typedef unsigned __int64 size_t;
-#else
-  typedef unsigned int size_t;
-#endif
-#endif
-
-#ifndef _SSIZE_T_DEFINED
-#define _SSIZE_T_DEFINED
-#undef ssize_t
-#ifdef _WIN64
-  __MINGW_EXTENSION typedef __int64 ssize_t;
-#else
-  typedef int ssize_t;
-#endif
-#endif
-
 #ifdef __RPC_WIN32__
 #if defined(_ARM_)
 #define __RPC_CALLEE
diff --git a/mingw-w64-headers/include/strsafe.h b/mingw-w64-headers/include/strsafe.h
index 245078a..c5314a8 100644
--- a/mingw-w64-headers/include/strsafe.h
+++ b/mingw-w64-headers/include/strsafe.h
@@ -16,26 +16,6 @@
 #define __STRSAFE__NO_INLINE
 #endif
 
-#ifndef _SIZE_T_DEFINED
-#define _SIZE_T_DEFINED
-#undef size_t
-#ifdef _WIN64
-__MINGW_EXTENSION typedef unsigned __int64 size_t;
-#else
-typedef unsigned int size_t;
-#endif
-#endif
-
-#ifndef _SSIZE_T_DEFINED
-#define _SSIZE_T_DEFINED
-#undef ssize_t
-#ifdef _WIN64
-__MINGW_EXTENSION typedef __int64 ssize_t;
-#else
-typedef int ssize_t;
-#endif
-#endif
-
 #ifndef _HRESULT_DEFINED
 #define _HRESULT_DEFINED
 typedef __LONG32 HRESULT;