diff options
author | Alex Marsev <alex.marsev@gmail.com> | 2016-01-27 13:25:19 +0300 |
---|---|---|
committer | Alex Marsev <alex.marsev@gmail.com> | 2016-01-27 13:25:19 +0300 |
commit | 3a874ee7c0486405e4b74fb8019b7567b932dc69 (patch) | |
tree | 34e89bf119871eb8e98a37716fec0e8a59d6d458 | |
parent | 303ce889bc9251d8cafab57133df1e226d792515 (diff) |
Replace DebugOut() helper function with macro
Ugly, but can't be helped. It's the only way to never evaluate the
arguments in release builds.
-rw-r--r-- | src/Utils.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Utils.h b/src/Utils.h index c2fa1fc..053eda3 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -99,9 +99,8 @@ namespace SaneAudioRenderer }
template <typename... T>
- inline void DebugOut(T&&... args)
+ inline void DebugOutBody(T&&... args)
{
- #ifndef NDEBUG
try
{
std::wostringstream stream;
@@ -114,9 +113,14 @@ namespace SaneAudioRenderer {
OutputDebugString(L"sanear: caught exception while formatting debug message");
}
- #endif
}
+ #ifndef NDEBUG
+ # define DebugOut(...) DebugOutBody(##__VA_ARGS__)
+ #else
+ # define DebugOut(...)
+ #endif
+
template <class T>
inline const char* ClassName(T* p)
{
|