1
0

trace.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef NULLOSFT_MEDIALIBRARY_TRACE_HEADER
  2. #define NULLOSFT_MEDIALIBRARY_TRACE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #ifdef _DEBUG
  7. #include <wtypes.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. void DebugPrintfA(LPCSTR format, ...);
  12. void DebugPrintfW(LPCWSTR format, ...);
  13. #ifdef __cplusplus
  14. }
  15. #endif
  16. #ifdef UNICODE
  17. #define DebugPrintf DebugPrintfW
  18. #else
  19. #define DebugPrintf DebugPrintfA
  20. #endif // !UNICODE
  21. #define aTRACE OutputDebugStringA
  22. #define aTRACE_FMT DebugPrintfA
  23. #define aTRACE_LINE(x) aTRACE_FMT("%s\n", (x))
  24. #define wTRACE OutputDebugStringW
  25. #define wTRACE_FMT DebugPrintfW
  26. #define wTRACE_LINE(x) wTRACE_FMT(L"%s\n", (x))
  27. #define TRACE OutputDebugString
  28. #define TRACE_FMT DebugPrintf
  29. #define TRACE_LINE(x) TRACE_FMT(TEXT("%s\n"), (x))
  30. #else // _DEBUG
  31. #define aTRACE
  32. #define aTRACE_FMT
  33. #define aTRACE_LINE
  34. #define wTRACE
  35. #define wTRACE_FMT
  36. #define wTRACE_LINE
  37. #define TRACE
  38. #define TRACE_FMT
  39. #define TRACE_LINE
  40. #endif // _DEBUG
  41. #endif // NULLOSFT_MEDIALIBRARY_TRACE_HEADER