1
0
mirror of synced 2024-11-13 19:20:46 +01:00

Fix up logging to use debug string

This commit is contained in:
Rin 2022-07-09 11:20:35 +01:00
parent 1ca9a3e513
commit ee253d92f3
2 changed files with 10 additions and 4 deletions

View File

@ -120,7 +120,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;OPENBANAPASS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;OPENBANAPASS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
@ -137,7 +137,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;OPENBANAPASS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;OPENBANAPASS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>

View File

@ -4,11 +4,17 @@
#include <cstdlib>
#include <cstring>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
void log(const char* format, ...)
{
char buffer[1024];
va_list args;
va_start(args, format);
printf("[OpenBanapass] ");
vprintf(format, args);
char fmt[1024] = "[OpenBanapass] ";
strcat(fmt, format);
vsprintf(buffer, fmt, args);
OutputDebugStringA(buffer);
va_end(args);
}