https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6f6b83172277699845cfc44e1aaf8a78cd379f15

commit 6f6b83172277699845cfc44e1aaf8a78cd379f15
Author:     Timo Kreuzer <timo.kreu...@reactos.org>
AuthorDate: Sun May 12 13:11:22 2024 +0300
Commit:     Timo Kreuzer <timo.kreu...@reactos.org>
CommitDate: Mon Oct 21 14:53:29 2024 +0300

    [CRT] Introduce corecrt.h
    
    Include this instead of crtdefs.h.
    This is for compatibility with MS headers.
---
 sdk/include/crt/assert.h              |  2 +-
 sdk/include/crt/complex.h             |  2 +-
 sdk/include/crt/conio.h               |  2 +-
 sdk/include/crt/corecrt.h             | 25 +++++++++++++++++++++++++
 sdk/include/crt/crtdbg.h              |  2 +-
 sdk/include/crt/crtdefs.h             | 12 ------------
 sdk/include/crt/ctype.h               |  2 +-
 sdk/include/crt/direct.h              |  2 +-
 sdk/include/crt/dos.h                 |  2 +-
 sdk/include/crt/dvec.h                |  2 +-
 sdk/include/crt/eh.h                  |  2 +-
 sdk/include/crt/errno.h               |  2 +-
 sdk/include/crt/fcntl.h               |  2 +-
 sdk/include/crt/float.h               |  2 +-
 sdk/include/crt/fpieee.h              |  2 +-
 sdk/include/crt/fvec.h                |  2 +-
 sdk/include/crt/inttypes.h            |  2 +-
 sdk/include/crt/io.h                  |  2 +-
 sdk/include/crt/ivec.h                |  2 +-
 sdk/include/crt/libgen.h              |  2 +-
 sdk/include/crt/locale.h              |  2 +-
 sdk/include/crt/malloc.h              |  2 +-
 sdk/include/crt/math.h                |  2 +-
 sdk/include/crt/mbctype.h             |  2 +-
 sdk/include/crt/mbstring.h            |  2 +-
 sdk/include/crt/memory.h              |  2 +-
 sdk/include/crt/process.h             |  2 +-
 sdk/include/crt/search.h              |  2 +-
 sdk/include/crt/signal.h              |  2 +-
 sdk/include/crt/stddef.h              |  2 +-
 sdk/include/crt/stdexcpt.h            |  2 +-
 sdk/include/crt/stdio.h               |  2 +-
 sdk/include/crt/stdlib.h              |  2 +-
 sdk/include/crt/string.h              |  2 +-
 sdk/include/crt/tchar.h               |  2 +-
 sdk/include/crt/time.h                |  2 +-
 sdk/include/crt/typeinfo.h            |  2 +-
 sdk/include/crt/wchar.h               |  2 +-
 sdk/include/crt/wctype.h              |  2 +-
 sdk/include/crt/yvals.h               |  4 +---
 sdk/lib/crt/include/internal/locale.h |  2 ++
 41 files changed, 65 insertions(+), 52 deletions(-)

diff --git a/sdk/include/crt/assert.h b/sdk/include/crt/assert.h
index 8f9fa217fe9..ce17f698e3a 100644
--- a/sdk/include/crt/assert.h
+++ b/sdk/include/crt/assert.h
@@ -6,7 +6,7 @@
 #ifndef __ASSERT_H_
 #define __ASSERT_H_
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifdef NDEBUG
 
diff --git a/sdk/include/crt/complex.h b/sdk/include/crt/complex.h
index c15887d0bd8..e73b0c17784 100644
--- a/sdk/include/crt/complex.h
+++ b/sdk/include/crt/complex.h
@@ -26,7 +26,7 @@
 #ifndef _COMPLEX_H_
 #define _COMPLEX_H_
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
      || !defined __STRICT_ANSI__
diff --git a/sdk/include/crt/conio.h b/sdk/include/crt/conio.h
index e260cf1969a..631f76bc7d9 100644
--- a/sdk/include/crt/conio.h
+++ b/sdk/include/crt/conio.h
@@ -6,7 +6,7 @@
 #ifndef _INC_CONIO
 #define _INC_CONIO
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #define __need___va_list
 #include <stdarg.h>
diff --git a/sdk/include/crt/corecrt.h b/sdk/include/crt/corecrt.h
new file mode 100644
index 00000000000..4bae8184255
--- /dev/null
+++ b/sdk/include/crt/corecrt.h
@@ -0,0 +1,25 @@
+
+#pragma once
+
+#include <crtdefs.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _CRTRESTRICT
+#define _CRTRESTRICT
+#endif
+
+#ifndef DEFINED_localeinfo_struct
+typedef struct localeinfo_struct
+{
+    pthreadlocinfo locinfo;
+    pthreadmbcinfo mbcinfo;
+} _locale_tstruct, *_locale_t;
+#define DEFINED_localeinfo_struct 1
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/sdk/include/crt/crtdbg.h b/sdk/include/crt/crtdbg.h
index 13c16f66f50..6b90bc018d5 100644
--- a/sdk/include/crt/crtdbg.h
+++ b/sdk/include/crt/crtdbg.h
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifndef _INC_CRTDBG
 #define _INC_CRTDBG
diff --git a/sdk/include/crt/crtdefs.h b/sdk/include/crt/crtdefs.h
index 2eeb6a7fbd7..e83ed510c35 100644
--- a/sdk/include/crt/crtdefs.h
+++ b/sdk/include/crt/crtdefs.h
@@ -158,10 +158,6 @@
 #define _CRTNOALIAS
 #endif
 
-#ifndef _CRTRESTRICT
-#define _CRTRESTRICT
-#endif
-
 #ifndef __CRTDECL
 #define __CRTDECL __cdecl
 #endif
@@ -437,14 +433,6 @@ typedef struct threadmbcinfostruct *pthreadmbcinfo;
 
 struct __lc_time_data;
 
-#ifndef DEFINED_localeinfo_struct
-typedef struct localeinfo_struct {
-    pthreadlocinfo locinfo;
-    pthreadmbcinfo mbcinfo;
-}_locale_tstruct,*_locale_t;
-#define DEFINED_localeinfo_struct 1
-#endif
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/sdk/include/crt/ctype.h b/sdk/include/crt/ctype.h
index 618e2107574..3fc23a3b047 100644
--- a/sdk/include/crt/ctype.h
+++ b/sdk/include/crt/ctype.h
@@ -6,7 +6,7 @@
 #ifndef _INC_CTYPE
 #define _INC_CTYPE
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sdk/include/crt/direct.h b/sdk/include/crt/direct.h
index 05041796e80..c950824521a 100644
--- a/sdk/include/crt/direct.h
+++ b/sdk/include/crt/direct.h
@@ -6,7 +6,7 @@
 #ifndef _INC_DIRECT
 #define _INC_DIRECT
 
-#include <crtdefs.h>
+#include <corecrt.h>
 #include <io.h>
 
 #pragma pack(push,_CRT_PACKING)
diff --git a/sdk/include/crt/dos.h b/sdk/include/crt/dos.h
index 867326ab176..0c8c82dd379 100644
--- a/sdk/include/crt/dos.h
+++ b/sdk/include/crt/dos.h
@@ -6,7 +6,7 @@
 #ifndef _INC_DOS
 #define _INC_DOS
 
-#include <crtdefs.h>
+#include <corecrt.h>
 #include <io.h>
 
 #pragma pack(push,_CRT_PACKING)
diff --git a/sdk/include/crt/dvec.h b/sdk/include/crt/dvec.h
index 5617ffde263..d37b736b7db 100644
--- a/sdk/include/crt/dvec.h
+++ b/sdk/include/crt/dvec.h
@@ -14,7 +14,7 @@
 #include <emmintrin.h>
 #include <assert.h>
 #include <fvec.h>
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #pragma pack(push,_CRT_PACKING)
 
diff --git a/sdk/include/crt/eh.h b/sdk/include/crt/eh.h
index 8d2264b1db1..a384707e8c7 100644
--- a/sdk/include/crt/eh.h
+++ b/sdk/include/crt/eh.h
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifndef _EH_H_
 #define _EH_H_
diff --git a/sdk/include/crt/errno.h b/sdk/include/crt/errno.h
index a0522428a3b..5f67137a09b 100644
--- a/sdk/include/crt/errno.h
+++ b/sdk/include/crt/errno.h
@@ -6,7 +6,7 @@
 #ifndef _INC_ERRNO
 #define _INC_ERRNO
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sdk/include/crt/fcntl.h b/sdk/include/crt/fcntl.h
index fc3b00c2514..79d0af2acbc 100644
--- a/sdk/include/crt/fcntl.h
+++ b/sdk/include/crt/fcntl.h
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifndef _INC_FCNTL
 #define _INC_FCNTL
diff --git a/sdk/include/crt/float.h b/sdk/include/crt/float.h
index 8c42b3f9d04..e2e883d1455 100644
--- a/sdk/include/crt/float.h
+++ b/sdk/include/crt/float.h
@@ -27,7 +27,7 @@
 #error
 #endif
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 /*
  * Functions and definitions for controlling the FPU.
diff --git a/sdk/include/crt/fpieee.h b/sdk/include/crt/fpieee.h
index 61ffcdd2981..a339808f40c 100644
--- a/sdk/include/crt/fpieee.h
+++ b/sdk/include/crt/fpieee.h
@@ -6,7 +6,7 @@
 #ifndef _INC_FPIEEE
 #define _INC_FPIEEE
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #pragma pack(push,_CRT_PACKING)
 
diff --git a/sdk/include/crt/fvec.h b/sdk/include/crt/fvec.h
index a4c888677ea..2e17c88b7ce 100644
--- a/sdk/include/crt/fvec.h
+++ b/sdk/include/crt/fvec.h
@@ -14,7 +14,7 @@
 #include <xmmintrin.h>
 #include <assert.h>
 #include <ivec.h>
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #if defined(_ENABLE_VEC_DEBUG)
 #include <iostream>
diff --git a/sdk/include/crt/inttypes.h b/sdk/include/crt/inttypes.h
index a47e2fe2877..c440179aef0 100644
--- a/sdk/include/crt/inttypes.h
+++ b/sdk/include/crt/inttypes.h
@@ -8,7 +8,7 @@
 #ifndef _INTTYPES_H_
 #define _INTTYPES_H_
 
-#include <crtdefs.h>
+#include <corecrt.h>
 #include <stdint.h>
 #define __need_wchar_t
 #include <stddef.h>
diff --git a/sdk/include/crt/io.h b/sdk/include/crt/io.h
index e6a452cc0ac..961f46018ff 100644
--- a/sdk/include/crt/io.h
+++ b/sdk/include/crt/io.h
@@ -7,7 +7,7 @@
 #ifndef _IO_H_
 #define _IO_H_
 
-#include <crtdefs.h>
+#include <corecrt.h>
 #include <string.h>
 
 #pragma pack(push,_CRT_PACKING)
diff --git a/sdk/include/crt/ivec.h b/sdk/include/crt/ivec.h
index 7d10e0317c1..92dd540350f 100644
--- a/sdk/include/crt/ivec.h
+++ b/sdk/include/crt/ivec.h
@@ -14,7 +14,7 @@
 #include <intrin.h>
 #include <assert.h>
 #include <dvec.h>
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #pragma pack(push,_CRT_PACKING)
 
diff --git a/sdk/include/crt/libgen.h b/sdk/include/crt/libgen.h
index 8e5b95d3521..d42fdf9e56c 100644
--- a/sdk/include/crt/libgen.h
+++ b/sdk/include/crt/libgen.h
@@ -14,7 +14,7 @@
 #define _LIBGEN_H_
 
 /* All the headers include this file. */
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sdk/include/crt/locale.h b/sdk/include/crt/locale.h
index d24699d0463..c71f91c983d 100644
--- a/sdk/include/crt/locale.h
+++ b/sdk/include/crt/locale.h
@@ -6,7 +6,7 @@
 #ifndef _INC_LOCALE
 #define _INC_LOCALE
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #pragma pack(push,_CRT_PACKING)
 
diff --git a/sdk/include/crt/malloc.h b/sdk/include/crt/malloc.h
index 16329997837..591b4a6a0f0 100644
--- a/sdk/include/crt/malloc.h
+++ b/sdk/include/crt/malloc.h
@@ -6,7 +6,7 @@
 #ifndef _INC_MALLOC
 #define _INC_MALLOC
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #pragma pack(push,_CRT_PACKING)
 
diff --git a/sdk/include/crt/math.h b/sdk/include/crt/math.h
index f32c2a33a77..bd5d7022523 100644
--- a/sdk/include/crt/math.h
+++ b/sdk/include/crt/math.h
@@ -4,7 +4,7 @@
 #ifndef _INC_MATH
 #define _INC_MATH
 
-#include "crtdefs.h"
+#include <corecrt.h>
 
 #pragma pack(push,_CRT_PACKING)
 
diff --git a/sdk/include/crt/mbctype.h b/sdk/include/crt/mbctype.h
index 53fc0f2c80a..6dbefc318cf 100644
--- a/sdk/include/crt/mbctype.h
+++ b/sdk/include/crt/mbctype.h
@@ -6,7 +6,7 @@
 #ifndef _INC_MBCTYPE
 #define _INC_MBCTYPE
 
-#include <crtdefs.h>
+#include <corecrt.h>
 #include <ctype.h>
 
 #ifdef __cplusplus
diff --git a/sdk/include/crt/mbstring.h b/sdk/include/crt/mbstring.h
index b897196a4b6..31e2461cd53 100644
--- a/sdk/include/crt/mbstring.h
+++ b/sdk/include/crt/mbstring.h
@@ -7,7 +7,7 @@
 #ifndef _INC_MBSTRING
 #define _INC_MBSTRING
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #pragma pack(push,_CRT_PACKING)
 
diff --git a/sdk/include/crt/memory.h b/sdk/include/crt/memory.h
index 237b727b8f5..232531d9755 100644
--- a/sdk/include/crt/memory.h
+++ b/sdk/include/crt/memory.h
@@ -6,7 +6,7 @@
 #ifndef _INC_MEMORY
 #define _INC_MEMORY
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sdk/include/crt/process.h b/sdk/include/crt/process.h
index 85321ccf4c2..6d19cfc23bc 100644
--- a/sdk/include/crt/process.h
+++ b/sdk/include/crt/process.h
@@ -6,7 +6,7 @@
 #ifndef _INC_PROCESS
 #define _INC_PROCESS
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 /* Includes a definition of _pid_t and pid_t */
 #include <sys/types.h>
diff --git a/sdk/include/crt/search.h b/sdk/include/crt/search.h
index 6fddba84da2..400035d3fc5 100644
--- a/sdk/include/crt/search.h
+++ b/sdk/include/crt/search.h
@@ -7,7 +7,7 @@
 #ifndef _INC_SEARCH
 #define _INC_SEARCH
 
-#include <crtdefs.h>
+#include <corecrt.h>
 #include <stddef.h>
 
 #ifdef __cplusplus
diff --git a/sdk/include/crt/signal.h b/sdk/include/crt/signal.h
index 8a269971a17..a3157b663db 100644
--- a/sdk/include/crt/signal.h
+++ b/sdk/include/crt/signal.h
@@ -6,7 +6,7 @@
 #ifndef _INC_SIGNAL
 #define _INC_SIGNAL
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sdk/include/crt/stddef.h b/sdk/include/crt/stddef.h
index 1ff523e3a06..fe7db25a17b 100644
--- a/sdk/include/crt/stddef.h
+++ b/sdk/include/crt/stddef.h
@@ -4,7 +4,7 @@
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifndef _INC_STDDEF
 #define _INC_STDDEF
diff --git a/sdk/include/crt/stdexcpt.h b/sdk/include/crt/stdexcpt.h
index 90a242f2635..c0e6caafaca 100644
--- a/sdk/include/crt/stdexcpt.h
+++ b/sdk/include/crt/stdexcpt.h
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifndef _INC_STDEXCPT
 #define _INC_STDEXCPT
diff --git a/sdk/include/crt/stdio.h b/sdk/include/crt/stdio.h
index e67c3df6351..f740a22ea40 100644
--- a/sdk/include/crt/stdio.h
+++ b/sdk/include/crt/stdio.h
@@ -6,7 +6,7 @@
 #ifndef _INC_STDIO
 #define _INC_STDIO
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #define __need___va_list
 #include <stdarg.h>
diff --git a/sdk/include/crt/stdlib.h b/sdk/include/crt/stdlib.h
index e3548a84a71..fc66c3a6874 100644
--- a/sdk/include/crt/stdlib.h
+++ b/sdk/include/crt/stdlib.h
@@ -6,7 +6,7 @@
 #ifndef _INC_STDLIB
 #define _INC_STDLIB
 
-#include <crtdefs.h>
+#include <corecrt.h>
 #include <limits.h>
 
 #pragma pack(push,_CRT_PACKING)
diff --git a/sdk/include/crt/string.h b/sdk/include/crt/string.h
index db962ae1c27..e0b2f09d96b 100644
--- a/sdk/include/crt/string.h
+++ b/sdk/include/crt/string.h
@@ -6,7 +6,7 @@
 #ifndef _INC_STRING
 #define _INC_STRING
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/sdk/include/crt/tchar.h b/sdk/include/crt/tchar.h
index 5143e5961a8..e9c5234d409 100644
--- a/sdk/include/crt/tchar.h
+++ b/sdk/include/crt/tchar.h
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifndef _INC_TCHAR
 #define _INC_TCHAR
diff --git a/sdk/include/crt/time.h b/sdk/include/crt/time.h
index 680c7fd2a1a..ff6dd05b130 100644
--- a/sdk/include/crt/time.h
+++ b/sdk/include/crt/time.h
@@ -7,7 +7,7 @@
 #ifndef _TIME_H_
 #define _TIME_H_
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifndef _WIN32
 #error Only Win32 target is supported!
diff --git a/sdk/include/crt/typeinfo.h b/sdk/include/crt/typeinfo.h
index e7bd1187266..fe6b0cad3c3 100644
--- a/sdk/include/crt/typeinfo.h
+++ b/sdk/include/crt/typeinfo.h
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #ifndef _INC_TYPEINFO
 #define _INC_TYPEINFO
diff --git a/sdk/include/crt/wchar.h b/sdk/include/crt/wchar.h
index c6cd0d7ba92..765cfd797f4 100644
--- a/sdk/include/crt/wchar.h
+++ b/sdk/include/crt/wchar.h
@@ -6,7 +6,7 @@
 #ifndef _INC_WCHAR
 #define _INC_WCHAR
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #define __need___va_list
 #include <stdarg.h>
diff --git a/sdk/include/crt/wctype.h b/sdk/include/crt/wctype.h
index 249f10f9dc8..72419d7e53b 100644
--- a/sdk/include/crt/wctype.h
+++ b/sdk/include/crt/wctype.h
@@ -10,7 +10,7 @@
 #error Only Win32 target is supported!
 #endif
 
-#include <crtdefs.h>
+#include <corecrt.h>
 
 #pragma pack(push,_CRT_PACKING)
 
diff --git a/sdk/include/crt/yvals.h b/sdk/include/crt/yvals.h
index 10b812dac62..14c27a28c7e 100644
--- a/sdk/include/crt/yvals.h
+++ b/sdk/include/crt/yvals.h
@@ -7,10 +7,8 @@
 #define _YVALS
 
 #include <_mingw.h>
-/* TODO, don't include crtdef.h.  */
-#include <crtdefs.h>
 
-#pragma pack(push,_CRT_PACKING)
+#pragma pack(push,8)
 
 #define _CPPLIB_VER 405
 #define __PURE_APPDOMAIN_GLOBAL
diff --git a/sdk/lib/crt/include/internal/locale.h 
b/sdk/lib/crt/include/internal/locale.h
index 23c618ff2cf..f991fa6496b 100644
--- a/sdk/lib/crt/include/internal/locale.h
+++ b/sdk/lib/crt/include/internal/locale.h
@@ -1,6 +1,8 @@
 #ifndef __CRT_INTERNAL_LOCALE_H
 #define __CRT_INTERNAL_LOCALE_H
 
+#include <crtdefs.h> // for LC_ID
+
 typedef struct MSVCRT_threadlocaleinfostruct {
     LONG refcount;
     unsigned int lc_codepage;

Reply via email to