wip: detected width bug (channels)
This commit is contained in:
parent
46224d331c
commit
2115cdf508
5 changed files with 63 additions and 31 deletions
16
src/debug.h
16
src/debug.h
|
|
@ -3,17 +3,19 @@
|
|||
#if defined (QT_DEBUG) || defined (DEBUG) || defined (_DEBUG)
|
||||
|
||||
#ifdef INIT_FILELOG
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
|
||||
FILE* fileLog;
|
||||
errno_t lfResult;
|
||||
bool writable = false;
|
||||
|
||||
bool initializeFileLogging() {
|
||||
void inline initializeFileLogging() {
|
||||
lfResult = fopen_s(&fileLog, "log.txt", "w");
|
||||
if (!lfResult) return true;
|
||||
else return false;
|
||||
if (!lfResult) writable = true;
|
||||
else writable = false;
|
||||
}
|
||||
|
||||
#else
|
||||
extern std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> converter;
|
||||
extern errno_t lfResult;
|
||||
extern FILE* fileLog;
|
||||
extern bool writable;
|
||||
|
|
@ -53,10 +55,13 @@ std::bitset<Y> varToBitset(T info) {
|
|||
|
||||
#endif
|
||||
|
||||
#define log_to_file(fmt, cnt) do { \
|
||||
|
||||
#define log_to_file_simple(fmt) log_to_file(fmt, "")
|
||||
#define log_to_file(fmt, cnt...) do { \
|
||||
if(writable) fprintf_s(fileLog, fmt, cnt); \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define print_as_binary(len, type, info) varToBitset<len, type>(info)
|
||||
|
||||
#define close_file_log_buffer() do { \
|
||||
|
|
@ -67,7 +72,8 @@ std::bitset<Y> varToBitset(T info) {
|
|||
#define log_debugcpp(str)
|
||||
#define log_wdebugcpp(str)
|
||||
#define print_as_binary(len, type, info)
|
||||
#define log_to_file(fmt, cnt)
|
||||
#define log_to_file_simple(fmt)
|
||||
#define log_to_file(fmt, cnt...)
|
||||
#define initialize_file_log() false
|
||||
#define close_file_log_buffer()
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue