comment the no_crt situation

This commit is contained in:
u130b8
2023-09-07 10:59:31 +03:00
parent 613b998348
commit 59937a8690
2 changed files with 6 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ if "%1" == "debug" (
set CL=/MT /Od /Zi /RTC1 /Fdprogmgr.pdb /fsanitize=address /DUNICODE /DPROGMGR_GIT_HASH="%GIT_HASH%"
set LINK=/DEBUG
) else (
set CL=/O1 /GS- /DUNICODE /DNDEBUG /DPROGMGR_NO_CRT /DPROGMGR_GIT_HASH="%GIT_HASH%"
set CL=/O1 /GS- /DUNICODE /DNDEBUG /DPROGMGR_GIT_HASH="%GIT_HASH%"
set LINK=/NODEFAULTLIB /OPT:REF /OPT:ICF
)

View File

@@ -166,7 +166,11 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
return 0;
}
#ifdef PROGMGR_NO_CRT
// NOTE(u130b8): We're compiling without the C runtime by default in Release builds.
// But in Debug builds, we need the C runtime, otherwise the address sanitizer and
// MSVC debug tools break because they use the wWinMainCRTStartup entrypoint to initialize.
#ifdef NDEBUG
#pragma function(memset)
void *memset(char* dst, int value, size_t count) {
while (count--) { *dst++ = value; }