aboutsummaryrefslogtreecommitdiff
path: root/Src/nu/trace.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/nu/trace.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/nu/trace.h')
-rw-r--r--Src/nu/trace.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/Src/nu/trace.h b/Src/nu/trace.h
new file mode 100644
index 00000000..9cb29462
--- /dev/null
+++ b/Src/nu/trace.h
@@ -0,0 +1,56 @@
+#ifndef NULLOSFT_MEDIALIBRARY_TRACE_HEADER
+#define NULLOSFT_MEDIALIBRARY_TRACE_HEADER
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+#ifdef _DEBUG
+
+#include <wtypes.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void DebugPrintfA(LPCSTR format, ...);
+void DebugPrintfW(LPCWSTR format, ...);
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef UNICODE
+#define DebugPrintf DebugPrintfW
+#else
+#define DebugPrintf DebugPrintfA
+#endif // !UNICODE
+
+#define aTRACE OutputDebugStringA
+#define aTRACE_FMT DebugPrintfA
+#define aTRACE_LINE(x) aTRACE_FMT("%s\n", (x))
+
+#define wTRACE OutputDebugStringW
+#define wTRACE_FMT DebugPrintfW
+#define wTRACE_LINE(x) wTRACE_FMT(L"%s\n", (x))
+
+#define TRACE OutputDebugString
+#define TRACE_FMT DebugPrintf
+#define TRACE_LINE(x) TRACE_FMT(TEXT("%s\n"), (x))
+
+#else // _DEBUG
+
+#define aTRACE
+#define aTRACE_FMT
+#define aTRACE_LINE
+
+#define wTRACE
+#define wTRACE_FMT
+#define wTRACE_LINE
+
+#define TRACE
+#define TRACE_FMT
+#define TRACE_LINE
+
+#endif // _DEBUG
+#endif // NULLOSFT_MEDIALIBRARY_TRACE_HEADER \ No newline at end of file