From: Bart Van Assche Date: Sat, 10 May 2008 05:49:58 +0000 (+0000) Subject: Converted VG_(assert_fail)() to ANSI C. X-Git-Tag: svn/VALGRIND_3_4_0~616 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d73424f8d95e44cc0aa74941e01b71b7455cceb;p=thirdparty%2Fvalgrind.git Converted VG_(assert_fail)() to ANSI C. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8022 --- diff --git a/exp-drd/tests/drd_bitmap_test.c b/exp-drd/tests/drd_bitmap_test.c index 3993afad36..115e97545c 100644 --- a/exp-drd/tests/drd_bitmap_test.c +++ b/exp-drd/tests/drd_bitmap_test.c @@ -14,13 +14,19 @@ void* VG_(malloc)(SizeT nbytes) { return malloc(nbytes); } void VG_(free)(void* p) { return free(p); } -void VG_(assert_fail)(Bool isCore, const Char* expr, const Char* file, - Int line, const Char* fn, const HChar* format, ...) { -#if defined(__linux__) -__assert_fail(expr, file, line, fn); abort(); -#else -assert(0); -#endif /* __linux__ */ +void VG_(assert_fail)(Bool isCore, const Char* assertion, const Char* file, + Int line, const Char* function, const HChar* format, + ...) +{ + fprintf(stderr, + "%s:%u: %s%sAssertion `%s' failed.\n", + file, + line, + function ? (char*)function : "", + function ? ": " : "", + assertion); + fflush(stderr); + abort(); } void* VG_(memset)(void *s, Int c, SizeT sz)