Fix building with DEBUG=1

This commit is contained in:
Maschell 2022-01-24 18:58:12 +01:00
parent 903856df4b
commit 13299660d5
2 changed files with 5 additions and 2 deletions

View File

@ -4,7 +4,6 @@
#include <whb/log_cafe.h> #include <whb/log_cafe.h>
#include <whb/log_module.h> #include <whb/log_module.h>
uint32_t moduleLogInit = false; uint32_t moduleLogInit = false;
uint32_t cafeLogInit = false; uint32_t cafeLogInit = false;
uint32_t udpLogInit = false; uint32_t udpLogInit = false;
@ -22,7 +21,7 @@ void initLogging() {
void deinitLogging() { void deinitLogging() {
#ifdef DEBUG #ifdef DEBUG
if (moduleLogInit) { if (moduleLogInit) {
WHBLogMffoduleDeinit(); WHBLogModuleDeinit();
moduleLogInit = false; moduleLogInit = false;
} }
if (cafeLogInit) { if (cafeLogInit) {

View File

@ -12,6 +12,8 @@ extern "C" {
#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) #define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__) #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)
#define DEBUG_FUNCTION_LINE_VERBOSE(FMT, ARGS...) while (0)
#define DEBUG_FUNCTION_LINE(FMT, ARGS...)do { \ #define DEBUG_FUNCTION_LINE(FMT, ARGS...)do { \
WHBLogPrintf("[%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \ WHBLogPrintf("[%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \
} while (0) } while (0)
@ -22,6 +24,8 @@ extern "C" {
#else #else
#define DEBUG_FUNCTION_LINE_VERBOSE(FMT, ARGS...) while (0)
#define DEBUG_FUNCTION_LINE(FMT, ARGS...) while (0) #define DEBUG_FUNCTION_LINE(FMT, ARGS...) while (0)
#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...) while (0) #define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...) while (0)