summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2006-05-30 14:26:30 +0000
committerHisham Muhammad <hisham@gobolinux.org>2006-05-30 14:26:30 +0000
commit57bd892b37cdaae11b99b916dbb240870799e18d (patch)
treef56299d806d71533926ddf4ab01d4904d86e763f
parent9da282d748a00fef7210ec1df12eb3201397edd5 (diff)
Add "debuglite" mode.
-rw-r--r--Makefile.am3
-rw-r--r--debug.h34
2 files changed, 23 insertions, 14 deletions
diff --git a/Makefile.am b/Makefile.am
index 8ea9ac9d..ccaa95fc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,3 +29,6 @@ ColumnsPanel.h
debug:
$(MAKE) all CFLAGS="-g -DDEBUG"
+
+debuglite:
+ $(MAKE) all CFLAGS="-g -DDEBUGLITE"
diff --git a/debug.h b/debug.h
index 8ef971d6..59fe517a 100644
--- a/debug.h
+++ b/debug.h
@@ -1,22 +1,28 @@
-#ifdef DEBUG
+#if defined(DEBUG)
-#include "DebugMemory.h"
+ /* Full debug */
+ #include "DebugMemory.h"
+ #define calloc(a, b) DebugMemory_calloc(a, b, __FILE__, __LINE__);
+ #define malloc(x) DebugMemory_malloc(x, __FILE__, __LINE__, #x);
+ #define realloc(x,s) DebugMemory_realloc(x, s, __FILE__, __LINE__, #x);
+ #define strdup(x) DebugMemory_strdup(x, __FILE__, __LINE__);
+ #define free(x) DebugMemory_free(x, __FILE__, __LINE__);
+ #define debug_done() DebugMemory_report();
-#define calloc(a, b) DebugMemory_calloc(a, b, __FILE__, __LINE__);
-#define malloc(x) DebugMemory_malloc(x, __FILE__, __LINE__);
-#define realloc(x,s) DebugMemory_realloc(x, s, __FILE__, __LINE__);
-#define strdup(x) DebugMemory_strdup(x, __FILE__, __LINE__);
-#define free(x) DebugMemory_free(x, __FILE__, __LINE__);
+#elif defined(DEBUGLITE)
-#define debug_done() DebugMemory_report();
+ /* Assertions and core only */
+ #ifdef NDEBUG
+ #undef NDEBUG
+ #endif
+ #define debug_done() sleep(0)
-#endif
-
-#ifndef DEBUG
+#else
-#define NDEBUG
-
-#define debug_done() sleep(0)
+ /* No debugging */
+ #define NDEBUG
+ #define debug_done() sleep(0)
#endif
+

© 2014-2024 Faster IT GmbH | imprint | privacy policy