From: nishi Date: Thu, 8 Feb 2024 15:17:55 +0000 (+0000) Subject: deleted DEBUG=YES, you can just disable debug from the program now X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=7ebe114b107eaa1a1d7fb3942b596b53fe4440ec;p=libw3.git deleted DEBUG=YES, you can just disable debug from the program now git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@187 d27a3e52-49c5-7645-884c-6793ebffc270 --- diff --git a/Library/Util.c b/Library/Util.c index c1f7c28..893e5d4 100644 --- a/Library/Util.c +++ b/Library/Util.c @@ -24,13 +24,17 @@ #define __DEBUG_LEN 12 +bool debug_flag = true; + +void W3_Do_Debug(bool do_debug) { debug_flag = do_debug; } + void __W3_Debug(const char* title, const char* message) { -#ifdef __DEBUG__ - char* periods = malloc(__DEBUG_LEN - strlen(title) + 1); - periods[__DEBUG_LEN - strlen(title)] = 0; - memset(periods, '.', __DEBUG_LEN - strlen(title)); - fprintf(stderr, "%s%s %s\n", title, periods, message); -#endif + if(debug_flag) { + char* periods = malloc(__DEBUG_LEN - strlen(title) + 1); + periods[__DEBUG_LEN - strlen(title)] = 0; + memset(periods, '.', __DEBUG_LEN - strlen(title)); + fprintf(stderr, "%s%s %s\n", title, periods, message); + } } char* __W3_Concat(const char* str1, const char* str2) { diff --git a/Library/W3Util.h b/Library/W3Util.h index 47ae5b9..ba03227 100644 --- a/Library/W3Util.h +++ b/Library/W3Util.h @@ -10,6 +10,7 @@ extern "C" { #include +void W3_Do_Debug(bool do_debug); void __W3_Debug(const char* title, const char* message); char* __W3_Concat(const char* str1, const char* str2); char* __W3_Concat3(const char* str1, const char* str2, const char* str3); diff --git a/Makefile b/Makefile index a6117ba..5ed36ff 100644 --- a/Makefile +++ b/Makefile @@ -75,7 +75,7 @@ endif endif ifeq ($(DEBUG),YES) -CFLAGS += -g -D__DEBUG__ +CFLAGS += -g endif ifeq ($(WINDOWS),YES) diff --git a/W3Version.h.p b/W3Version.h.p index 519bcc9..76cefd2 100644 --- a/W3Version.h.p +++ b/W3Version.h.p @@ -6,7 +6,7 @@ extern "C" { #endif -#define LIBW3_VERSION "2.3F" \ +#define LIBW3_VERSION "2.4" \ SUFFIX #ifdef __cplusplus