https://git.reactos.org/?p=reactos.git;a=commitdiff;h=51b5d846e9f01782e3d729a9a8e03c2a4df49cb4

commit 51b5d846e9f01782e3d729a9a8e03c2a4df49cb4
Author:     Timo Kreuzer <[email protected]>
AuthorDate: Sat May 20 21:08:58 2023 +0300
Commit:     Timo Kreuzer <[email protected]>
CommitDate: Fri Nov 10 19:00:41 2023 +0200

    [CRT] Define _NTSYSTEM_ in 2 files to force using import-stubs
    
    This prevents the code from linking to __imp_*, which would pull in the 
symbol from the import library (e.g. kernel32), which creates problems with the 
GNU linker, which doesn't like to have the import and a static definition at 
the same time.
---
 sdk/lib/crt/startup/crt_handler.c | 2 +-
 sdk/lib/crt/startup/gs_support.c  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sdk/lib/crt/startup/crt_handler.c 
b/sdk/lib/crt/startup/crt_handler.c
index a01ab8d7abf..5f102bb774a 100644
--- a/sdk/lib/crt/startup/crt_handler.c
+++ b/sdk/lib/crt/startup/crt_handler.c
@@ -11,7 +11,7 @@
 #include <memory.h>
 #include <signal.h>
 #include <stdio.h>
-
+#define _NTSYSTEM_
 #include <windef.h>
 #include <winbase.h>
 
diff --git a/sdk/lib/crt/startup/gs_support.c b/sdk/lib/crt/startup/gs_support.c
index 1a6d70d38cd..a8027b38c7a 100644
--- a/sdk/lib/crt/startup/gs_support.c
+++ b/sdk/lib/crt/startup/gs_support.c
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  */
-
+#define _NTSYSTEM_
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
 #endif
@@ -116,7 +116,7 @@ __report_gsfailure (ULONG_PTR StackCookie)
 
   RtlCaptureContext (&GS_ContextRecord);
   controlPC = GS_ContextRecord.Rip;
-  fctEntry = RtlLookupFunctionEntry (controlPC, &imgBase, NULL);
+  fctEntry = RtlLookupFunctionEntry(controlPC, &imgBase, NULL);
   if (fctEntry != NULL)
     {
       RtlVirtualUnwind (UNW_FLAG_NHANDLER, imgBase, controlPC, fctEntry,

Reply via email to