From 10ffa0b2f8c66b3a318503b4dfdfe02d6577d746 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 30 Nov 2015 12:00:44 +0100 Subject: erts: Mend ASSERT makro for erl_child_setup when called by hash.c for example. We use ASSERT from sys.h but erl_child_setup implements its own erl_assert_error() as it doesn't link with sys.o. --- erts/emulator/sys/unix/erl_child_setup.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'erts/emulator/sys') diff --git a/erts/emulator/sys/unix/erl_child_setup.c b/erts/emulator/sys/unix/erl_child_setup.c index 998a0d297f..94d1fd64c7 100644 --- a/erts/emulator/sys/unix/erl_child_setup.c +++ b/erts/emulator/sys/unix/erl_child_setup.c @@ -83,11 +83,16 @@ abort(); \ } while(0) -#undef ASSERT #ifdef DEBUG -#define ASSERT(cnd) do { if (!(cnd)) { ABORT("assertion %s failed", #cnd); } } while(0) -#else -#define ASSERT(cnd) +void +erl_assert_error(const char* expr, const char* func, const char* file, int line) +{ + fflush(stdout); + fprintf(stderr, "%s:%d:%s() Assertion failed: %s\n", + file, line, func, expr); + fflush(stderr); + abort(); +} #endif void sys_sigblock(int sig) -- cgit v1.2.3