-#define BUG_ON(c) assert_trace(#c, __FILE__, __func__, __LINE__, !(c))
-#define WARN_ON(c) warning_trace(#c, __FILE__, __func__, __LINE__, !(c), 1)
-#else
-#define BUG_ON(c) assert(!(c))
-#define WARN_ON(c) warning_trace(#c, __FILE__, __func__, __LINE__, !(c), 0)
-#endif
-
+static inline void assert_trace(const char *assertion, const char *filename,
+ const char *func, unsigned line, long val)
+{
+ if (val)
+ return;
+ fprintf(stderr,
+ "%s:%d: %s: Assertion `%s` failed, value %ld\n",
+ filename, line, func, assertion, val);