[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.
This commit is contained in:
Timo Kreuzer 2023-05-20 21:08:58 +03:00
parent 520cf2294d
commit 51b5d846e9
2 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@
#include <memory.h>
#include <signal.h>
#include <stdio.h>
#define _NTSYSTEM_
#include <windef.h>
#include <winbase.h>

View file

@ -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,