summaryrefslogtreecommitdiffstats
path: root/Platforms
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2017-12-28 18:50:59 +0000
committerEgor Yusov <egor.yusov@gmail.com>2017-12-28 18:50:59 +0000
commit2fae6ac5c48324fd7b697b158f94fce7334e7b8a (patch)
treea8cceeadf327e76699a5f2137a1f22f07c235f54 /Platforms
parentFixed release build issue (diff)
downloadDiligentCore-2fae6ac5c48324fd7b697b158f94fce7334e7b8a.tar.gz
DiligentCore-2fae6ac5c48324fd7b697b158f94fce7334e7b8a.zip
Updated debug macros
Diffstat (limited to 'Platforms')
-rw-r--r--Platforms/Basic/interface/Errors.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/Platforms/Basic/interface/Errors.h b/Platforms/Basic/interface/Errors.h
index 9c91865c..16eca82d 100644
--- a/Platforms/Basic/interface/Errors.h
+++ b/Platforms/Basic/interface/Errors.h
@@ -24,7 +24,6 @@
#pragma once
#include <stdexcept>
-#include <mutex>
#include "BasicPlatformDebug.h"
#include "FormatMessage.h"
@@ -85,20 +84,16 @@ do{ \
#define LOG_WARNING_MESSAGE(...) LOG_DEBUG_MESSAGE(BasicPlatformDebug::DebugMessageSeverity::Warning, ##__VA_ARGS__)
#define LOG_INFO_MESSAGE(...) LOG_DEBUG_MESSAGE(BasicPlatformDebug::DebugMessageSeverity::Info, ##__VA_ARGS__)
-#define LOG_ERROR_MESSAGE_ONCE(...)\
-do{ \
- static std::once_flag FirstTimeFlag; \
- std::call_once(FirstTimeFlag, [&](){ LOG_ERROR_MESSAGE(__VA_ARGS__); });\
-} while (false)
-
-#define LOG_WARNING_MESSAGE_ONCE(...)\
-do{ \
- static std::once_flag FirstTimeFlag; \
- std::call_once(FirstTimeFlag, [&](){ LOG_WARNING_MESSAGE(__VA_ARGS__); });\
+#define LOG_DEBUG_MESSAGE_ONCE(Severity, ...)\
+do{ \
+ static bool IsFirstTime = true; \
+ if(IsFirstTime) \
+ { \
+ LOG_DEBUG_MESSAGE(Severity, ##__VA_ARGS__);\
+ IsFirstTime = false; \
+ } \
}while(false)
-#define LOG_INFO_MESSAGE_ONCE(...)\
-do{ \
- static std::once_flag FirstTimeFlag; \
- std::call_once(FirstTimeFlag, [&](){ LOG_INFO_MESSAGE(__VA_ARGS__); });\
-} while(false)
+#define LOG_ERROR_MESSAGE_ONCE(...) LOG_DEBUG_MESSAGE_ONCE(BasicPlatformDebug::DebugMessageSeverity::Error, ##__VA_ARGS__)
+#define LOG_WARNING_MESSAGE_ONCE(...) LOG_DEBUG_MESSAGE_ONCE(BasicPlatformDebug::DebugMessageSeverity::Warning, ##__VA_ARGS__)
+#define LOG_INFO_MESSAGE_ONCE(...) LOG_DEBUG_MESSAGE_ONCE(BasicPlatformDebug::DebugMessageSeverity::Info, ##__VA_ARGS__)