headers: crt: move NULL to corecrt.h Deduplicate and follow UCRT 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/corecrt.h b/mingw-w64-headers/crt/corecrt.h index 2dd360f..c3f3a82 100644 --- a/mingw-w64-headers/crt/corecrt.h +++ b/mingw-w64-headers/crt/corecrt.h
@@ -188,6 +188,18 @@ #endif #endif +#ifndef NULL +#ifdef __cplusplus +#ifndef _WIN64 +#define NULL 0 +#else +#define NULL 0LL +#endif /* W64 */ +#else +#define NULL ((void *)0) +#endif +#endif + #if defined(__LIBMSVCRT__) /* When building mingw-w64, this should be blank. */ #define _SECIMP
diff --git a/mingw-w64-headers/crt/corecrt_wstdio.h b/mingw-w64-headers/crt/corecrt_wstdio.h index ffc808a..2779981 100644 --- a/mingw-w64-headers/crt/corecrt_wstdio.h +++ b/mingw-w64-headers/crt/corecrt_wstdio.h
@@ -42,18 +42,6 @@ #define stdout (__acrt_iob_func(1)) #define stderr (__acrt_iob_func(2)) -#ifndef NULL -#ifdef __cplusplus -#ifndef _WIN64 -#define NULL 0 -#else -#define NULL 0LL -#endif /* W64 */ -#else -#define NULL ((void *)0) -#endif -#endif - #if __MINGW_FORTIFY_LEVEL > 0 __mingw_bos_declare; #endif
diff --git a/mingw-w64-headers/crt/crtdbg.h b/mingw-w64-headers/crt/crtdbg.h index 1e9136e..f25fcba 100644 --- a/mingw-w64-headers/crt/crtdbg.h +++ b/mingw-w64-headers/crt/crtdbg.h
@@ -11,18 +11,6 @@ _CRT_BEGIN_C_HEADER -#ifndef NULL -#ifdef __cplusplus -#ifndef _WIN64 -#define NULL 0 -#else -#define NULL 0LL -#endif /* W64 */ -#else -#define NULL ((void *)0) -#endif -#endif - typedef void *_HFILE; #define _CRT_WARN 0
diff --git a/mingw-w64-headers/crt/locale.h b/mingw-w64-headers/crt/locale.h index e767e28..c7a6d30 100644 --- a/mingw-w64-headers/crt/locale.h +++ b/mingw-w64-headers/crt/locale.h
@@ -14,18 +14,6 @@ _CRT_BEGIN_C_HEADER -#ifndef NULL -#ifdef __cplusplus -#ifndef _WIN64 -#define NULL 0 -#else -#define NULL 0LL -#endif /* W64 */ -#else -#define NULL ((void *)0) -#endif -#endif - /** * Internal CRT stuff. */
diff --git a/mingw-w64-headers/crt/setjmp.h b/mingw-w64-headers/crt/setjmp.h index a725572..49e29a0 100644 --- a/mingw-w64-headers/crt/setjmp.h +++ b/mingw-w64-headers/crt/setjmp.h
@@ -10,18 +10,6 @@ _CRT_BEGIN_C_HEADER -#ifndef NULL -#ifdef __cplusplus -#ifndef _WIN64 -#define NULL 0 -#else -#define NULL 0LL -#endif /* W64 */ -#else -#define NULL ((void *)0) -#endif -#endif - #if defined(__i386__) #define _JBLEN 16
diff --git a/mingw-w64-headers/crt/stdlib.h b/mingw-w64-headers/crt/stdlib.h index 45ee016..f750e15 100644 --- a/mingw-w64-headers/crt/stdlib.h +++ b/mingw-w64-headers/crt/stdlib.h
@@ -12,18 +12,6 @@ _CRT_BEGIN_C_HEADER -#ifndef NULL -#ifdef __cplusplus -#ifndef _WIN64 -#define NULL 0 -#else -#define NULL 0LL -#endif /* W64 */ -#else -#define NULL ((void *)0) -#endif -#endif - #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1
diff --git a/mingw-w64-headers/crt/string.h b/mingw-w64-headers/crt/string.h index b629da2..7aece72 100644 --- a/mingw-w64-headers/crt/string.h +++ b/mingw-w64-headers/crt/string.h
@@ -19,18 +19,6 @@ #define _NLSCMPERROR 2147483647 -#ifndef NULL -#ifdef __cplusplus -#ifndef _WIN64 -#define NULL 0 -#else -#define NULL 0LL -#endif /* W64 */ -#else -#define NULL ((void *)0) -#endif -#endif - char * __cdecl _strset(char *_Str,int _Val) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; char * __cdecl _strset_l(char *_Str,int _Val,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; char * __cdecl strcpy(char * __restrict__ _Dest,const char * __restrict__ _Source);
diff --git a/mingw-w64-headers/crt/tchar.h b/mingw-w64-headers/crt/tchar.h index e3a7a87..09f5205 100644 --- a/mingw-w64-headers/crt/tchar.h +++ b/mingw-w64-headers/crt/tchar.h
@@ -1352,18 +1352,6 @@ #define _istlegal(_c) (1) -#ifndef NULL -#ifdef __cplusplus -#ifndef _WIN64 -#define NULL 0 -#else -#define NULL 0LL -#endif /* W64 */ -#else -#define NULL ((void *)0) -#endif -#endif - #define _strdec(_cpc1,_cpc2) ((_cpc1)>=(_cpc2) ? NULL : (_cpc2)-1) #define _strinc(_pc) ((_pc)+1) #define _strnextc(_cpc) ((unsigned int) *(const unsigned char *)(_cpc))
diff --git a/mingw-w64-headers/crt/time.h b/mingw-w64-headers/crt/time.h index b0e8cee..2a8e392 100644 --- a/mingw-w64-headers/crt/time.h +++ b/mingw-w64-headers/crt/time.h
@@ -23,18 +23,6 @@ typedef long clock_t; #endif -#ifndef NULL -#ifdef __cplusplus -#ifndef _WIN64 -#define NULL 0 -#else -#define NULL 0LL -#endif /* W64 */ -#else -#define NULL ((void *)0) -#endif -#endif - #define CLOCKS_PER_SEC 1000 #ifdef _UCRT