]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Converted VG_(assert_fail)() to ANSI C.
authorBart Van Assche <bvanassche@acm.org>
Sat, 10 May 2008 05:49:58 +0000 (05:49 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sat, 10 May 2008 05:49:58 +0000 (05:49 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8022

exp-drd/tests/drd_bitmap_test.c

index 3993afad36a43433ae713901d6b81cd2530de08f..115e97545c82cd18a0d44575d034919105df928e 100644 (file)
@@ -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)