From 6beff505d76bb3e69cc269039cb4326cadf8ff2f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 8 Mar 2024 19:03:23 +0200 Subject: [PATCH] [CRT] Add _Exit to process.h This is already done this way in our stdlib.h. It is needed by GCC 13 C++ headers. The problem happens like this: - telnet/precomp.h includes fstream from GCC - fstream includes pthread.h from GCC - pthread.h includes process.h from ReactOS - process.h defines _CRT_TERMINATE_DEFINED, but doesn't declare _Exit - fstream includes cstdlib from GCC - cstdlib includes stdlib.h from GCC (#include_next) - stdlib.h doesn't declare _Exit, because _CRT_TERMINATE_DEFINED is defined - cstdlib uses _Exit --- sdk/include/crt/process.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk/include/crt/process.h b/sdk/include/crt/process.h index b8948f5f0e0..9c603e02850 100644 --- a/sdk/include/crt/process.h +++ b/sdk/include/crt/process.h @@ -54,7 +54,12 @@ extern "C" { #define _CRT_TERMINATE_DEFINED __declspec(noreturn) void __cdecl exit(_In_ int _Code); _CRTIMP __declspec(noreturn) void __cdecl _exit(_In_ int _Code); - +#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ + /* C99 function name */ + __declspec(noreturn) void __cdecl _Exit(int); /* Declare to get noreturn attribute. */ + __CRT_INLINE void __cdecl _Exit(int status) + { _exit(status); } +#endif #if __MINGW_GNUC_PREREQ(4,4) #pragma push_macro("abort") #undef abort