diff --git a/ChangeLog b/ChangeLog index 3060b73b16..579c4f306b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,9 @@ || to respect codestyle. * libio/tst-memstream3.c (_FWRITE): Rename to FWRITE_FUNC. (do_test_bz20181): Rename accordingly. + * malloc/malloc.c: Include . + (assert): Do not define. + [!defined NDEBUG] (__assert_fail): Define to __malloc_assert. 2018-01-29 Darius Rad diff --git a/malloc/malloc.c b/malloc/malloc.c index 7889fb1961..f8e7250f70 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -223,6 +223,7 @@ #include #include /* needed for malloc_stats */ #include +#include #include @@ -278,13 +279,9 @@ #define MALLOC_DEBUG 0 #endif -#ifdef NDEBUG -# define assert(expr) ((void) 0) -#else -# define assert(expr) \ - ((expr) \ - ? ((void) 0) \ - : __malloc_assert (#expr, __FILE__, __LINE__, __func__)) +#ifndef NDEBUG +# define __assert_fail(assertion, file, line, function) \ + __malloc_assert(assertion, file, line, function) extern const char *__progname;