Initial implementation of scope guard logging for including in crash logs.
This adds a mechanism to create scope guards with an associated std::function which is called to output diagnostic info in the event of a crash. Add a macro to make it easy to efficiently capture variables on the stack and output a formatted message. Requires C++11, #ifdefed out for legacy compilers.
This commit is contained in:
@@ -520,4 +520,10 @@ static inline void free(const void *ptr)
|
||||
#define IGNORE_UNINITIALIZED_WARNING_STOP
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_SCOPE_INFO) && (__cplusplus >= 201103L || defined(__STDCXX_VERSION__) || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__))
|
||||
#define USE_SCOPE_INFO
|
||||
#endif
|
||||
|
||||
#define SINGLE_ARG(...) __VA_ARGS__
|
||||
|
||||
#endif /* STDAFX_H */
|
||||
|
Reference in New Issue
Block a user