mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-16 08:58:24 +01:00
Add VS trace function
VS OutputDebugString doesn't support %hh* %ll*, so let vsnprint handle it then write a simple string to debug console. The purpose of this is that its faster than writing logs to a file. (Only when debugging with VS tho). This can be enabled by defining preprocessor: VS_TRACE_DEBUG
This commit is contained in:
parent
0677b8e2ff
commit
ba23e904ad
2 changed files with 41 additions and 0 deletions
|
|
@ -44,7 +44,12 @@
|
|||
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
|
||||
#define PATH_SEPARATOR "\\"
|
||||
#ifndef EMU_RELEASE_BUILD
|
||||
#ifdef VS_TRACE_DEBUG
|
||||
bool _trace(const char* format, ...);
|
||||
#define PRINT_DEBUG(FMT, ...) _trace(FMT, ##__VA_ARGS__)
|
||||
#else // VS_TRACE_DEBUG
|
||||
#define PRINT_DEBUG(a, ...) do {FILE *t = fopen("STEAM_LOG.txt", "a"); fprintf(t, "%u " a, GetCurrentThreadId(), __VA_ARGS__); fclose(t); WSASetLastError(0);} while (0)
|
||||
#endif // VS_TRACE_DEBUG
|
||||
#endif
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue