diff --git a/Libraries/LibC/assert.cpp b/Libraries/LibC/assert.cpp index f5659b1a59..244074d5c3 100644 --- a/Libraries/LibC/assert.cpp +++ b/Libraries/LibC/assert.cpp @@ -32,10 +32,10 @@ extern "C" { #ifdef DEBUG -void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func) +void __assertion_failed(const char* msg) { - dbgprintf("USERSPACE(%d) ASSERTION FAILED: %s\n%s:%u in %s\n", getpid(), msg, file, line, func); - fprintf(stderr, "ASSERTION FAILED: %s\n%s:%u in %s\n", msg, file, line, func); + dbgprintf("USERSPACE(%d) ASSERTION FAILED: %s\n", getpid(), msg); + fprintf(stderr, "ASSERTION FAILED: %s\n", msg); abort(); for (;;) ; diff --git a/Libraries/LibC/assert.h b/Libraries/LibC/assert.h index bc03750bb4..bc374e5e12 100644 --- a/Libraries/LibC/assert.h +++ b/Libraries/LibC/assert.h @@ -31,8 +31,10 @@ __BEGIN_DECLS #ifdef DEBUG -__attribute__((noreturn)) void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func); -# define assert(expr) ((expr) ? (void)0 : __assertion_failed(# expr, __FILE__, __LINE__, __PRETTY_FUNCTION__)) +__attribute__((noreturn)) void __assertion_failed(const char* msg); +# define __stringify_helper(x) # x +# define __stringify(x) __stringify_helper(x) +# define assert(expr) ((expr) ? (void)0 : __assertion_failed(# expr "\n" __FILE__ ":" __stringify(__LINE__))); # define ASSERT_NOT_REACHED() assert(false) #else # define assert(expr)