Try to fix MSVC build warnings

This commit is contained in:
Alex Spataru 2024-11-29 22:33:30 -05:00
parent c323133082
commit 5bdb1cdf5b
2 changed files with 4 additions and 3 deletions

View File

@ -126,6 +126,7 @@ if(PRODUCTION_OPTIMIZATION)
/OPT:REF # Remove unreferenced functions/data
/OPT:ICF # Remove identical COMDATs
/LTCG # Enable LTO during linkingn
/NODEFAULTLIB:msvcrt.lib # Exclude dynamic runtime
)
# macOS-specific settings

View File

@ -252,8 +252,8 @@ static void attachToConsole()
{
if (AttachConsole(ATTACH_PARENT_PROCESS))
{
(void)freopen("CONOUT$", "w", stdout);
(void)freopen("CONOUT$", "w", stderr);
(void)freopen_s(nullptr, "CONOUT$", "w", stdout);
(void)freopen_s(nullptr, "CONOUT$", "w", stderr);
printf("\n");
}
}
@ -280,7 +280,7 @@ static char **adjustArgumentsForFreeType(int &argc, char **argv)
// Copy original argv into newArgv
for (int i = 0; i < argc; ++i)
newArgv[i] = strdup(argv[i]);
newArgv[i] = _strdup(argv[i]);
// Add new arguments to the end
newArgv[argc] = const_cast<char *>(platformArgument);