]> wimlib.net Git - wimlib/commitdiff
Fix when debugging enabled but error messages are not
authorEric Biggers <ebiggers3@gmail.com>
Thu, 21 Mar 2013 05:03:08 +0000 (00:03 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 21 Mar 2013 05:03:08 +0000 (00:03 -0500)
src/hardlink.c
src/util.c
src/util.h

index da91ac43800f6ed1f2799df4ee73a3d3f43aa508..479b1266d1af7f6fba5896a748885c51bc4cc12b 100644 (file)
@@ -150,7 +150,7 @@ inode_table_insert(struct wim_dentry *dentry, void *_table)
        return 0;
 }
 
        return 0;
 }
 
-#ifdef ENABLE_ERROR_MESSAGES
+#if defined(ENABLE_ERROR_MESSAGES) || defined(ENABLE_DEBUG)
 static void
 print_inode_dentries(const struct wim_inode *inode)
 {
 static void
 print_inode_dentries(const struct wim_inode *inode)
 {
index c0244ba2f2a5a90d83a7fbcab51f19f84ae5536b..0c00b2a6793e06cc27db70901bb228db59661e3f 100644 (file)
@@ -213,7 +213,7 @@ wimlib_warning_with_errno(const char *format, ...)
 
 #endif
 
 
 #endif
 
-#ifdef ENABLE_DEBUG
+#if defined(ENABLE_DEBUG) || defined(ENABLE_MORE_DEBUG)
 void wimlib_debug(const char *file, int line, const char *func,
                  const char *format, ...)
 {
 void wimlib_debug(const char *file, int line, const char *func,
                  const char *format, ...)
 {
index 28f9655ff6efaf87bece7cc3bf3337d8334ba7e9..77c4b352a1d549320245b4a0be112ec859b7f737 100644 (file)
@@ -173,7 +173,15 @@ wimlib_warning_with_errno(const char *format, ...) FORMAT(printf, 1, 2) COLD;
 #  define WARNING_WITH_ERRNO(format, ...)      dummy_printf(format, ## __VA_ARGS__)
 #endif /* !ENABLE_ERROR_MESSAGES */
 
 #  define WARNING_WITH_ERRNO(format, ...)      dummy_printf(format, ## __VA_ARGS__)
 #endif /* !ENABLE_ERROR_MESSAGES */
 
-#if defined(ENABLE_DEBUG) || defined(ENABLE_MORE_DEBUG)
+#if defined(ENABLE_MORE_DEBUG) && !defined(ENABLE_DEBUG)
+#  define ENABLE_DEBUG 1
+#endif
+
+#if defined(ENABLE_MORE_ASSERTIONS) && !defined(ENABLE_ASSERTIONS)
+#  define ENABLE_ASSERTIONS 1
+#endif
+
+#ifdef ENABLE_DEBUG
 extern void
 wimlib_debug(const char *file, int line, const char *func,
             const char *format, ...);
 extern void
 wimlib_debug(const char *file, int line, const char *func,
             const char *format, ...);
@@ -182,26 +190,26 @@ wimlib_debug(const char *file, int line, const char *func,
 
 #else
 #  define DEBUG(format, ...) dummy_printf(format, ## __VA_ARGS__)
 
 #else
 #  define DEBUG(format, ...) dummy_printf(format, ## __VA_ARGS__)
-#endif /* ENABLE_DEBUG || ENABLE_MORE_DEBUG */
+#endif /* !ENABLE_DEBUG */
 
 #ifdef ENABLE_MORE_DEBUG
 #  define DEBUG2(format, ...) DEBUG(format, ## __VA_ARGS__)
 #else
 #  define DEBUG2(format, ...) dummy_printf(format, ## __VA_ARGS__)
 
 #ifdef ENABLE_MORE_DEBUG
 #  define DEBUG2(format, ...) DEBUG(format, ## __VA_ARGS__)
 #else
 #  define DEBUG2(format, ...) dummy_printf(format, ## __VA_ARGS__)
-#endif /* ENABLE_DEBUG */
+#endif /* !ENABLE_MORE_DEBUG */
 
 #ifdef ENABLE_ASSERTIONS
 #include <assert.h>
 #  define wimlib_assert(expr) assert(expr)
 #else
 #  define wimlib_assert(expr)
 
 #ifdef ENABLE_ASSERTIONS
 #include <assert.h>
 #  define wimlib_assert(expr) assert(expr)
 #else
 #  define wimlib_assert(expr)
-#endif
+#endif /* !ENABLE_ASSERTIONS */
 
 #ifdef ENABLE_MORE_ASSERTIONS
 #  define wimlib_assert2(expr) wimlib_assert(expr)
 #else
 #  define wimlib_assert2(expr)
 
 #ifdef ENABLE_MORE_ASSERTIONS
 #  define wimlib_assert2(expr) wimlib_assert(expr)
 #else
 #  define wimlib_assert2(expr)
-#endif
+#endif /* !ENABLE_MORE_ASSERTIONS */
 
 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
 
 
 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))