template and fixed guid obtaining
This commit is contained in:
parent
80685f1a21
commit
7e741f3bca
3 changed files with 39 additions and 13 deletions
14
src/debug.h
14
src/debug.h
|
|
@ -2,10 +2,22 @@
|
|||
|
||||
#if defined (QT_DEBUG) || defined (DEBUG) || defined (_DEBUG)
|
||||
|
||||
template<size_t Y, typename T>
|
||||
std::bitset<Y> varToBitset(T info) {
|
||||
std::bitset<Y> content(info);
|
||||
return content;
|
||||
}
|
||||
|
||||
#define log_debugcpp(str) do { \
|
||||
std::cout << "[DEBUG]" << "(" << __FILE__ << ":" << __LINE__ << "): " << str << std::endl; \
|
||||
} while (0)
|
||||
|
||||
#define print_as_binary(len, type, info) varToBitset<len, type>(info)
|
||||
|
||||
#else
|
||||
#define log_debugcpp(str)
|
||||
#define log_debugcpp(str)
|
||||
#define print_as_binary(len, info)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue