#define ULONG_MAX (~0UL)
#endif
+#define __token_glue(a,b,c) ___token_glue(a,b,c)
+#define ___token_glue(a,b,c) a ## b ## c
+#ifdef DEBUG_BUILD_CHECKS
+#define BUILD_ASSERT(x) extern int __token_glue(compile_time_assert_,__LINE__,__COUNTER__)[1-2*!(x)] __attribute__((unused))
+#else
+#define BUILD_ASSERT(x)
+#endif
+
#ifndef BTRFS_DISABLE_BACKTRACE
#define MAX_BACKTRACE 16
static inline void print_trace(void)
exit(1);
}
+#define BUG() assert_trace(NULL, __FILE__, __func__, __LINE__, 0)
+#else
+#define BUG() assert(0)
+#endif
+
static inline void warning_trace(const char *assertion, const char *filename,
const char *func, unsigned line, int val,
int trace)
fprintf(stderr,
"%s:%d: %s: Warning: assertion failed, value %d.\n",
filename, line, func, val);
+#ifndef BTRFS_DISABLE_BACKTRACE
if (trace)
print_trace();
+#endif
}
-#define BUG() assert_trace(NULL, __FILE__, __func__, __LINE__, 0)
-#else
-#define BUG() assert(0)
-#endif
#ifdef __CHECKER__
#define __force __attribute__((force))