libroot_debug: Merge guarded heap into libroot_debug.
[haiku.git] / src / system / libroot / posix / assert.c
blobabefb7333d380f4011064d058038903ab5d397f6
1 /*
2 ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the Haiku License.
4 */
7 #undef NDEBUG
8 // just in case
10 #include <OS.h>
12 #include <assert.h>
13 #include <stdio.h>
14 #include <string.h>
17 extern char *__progname;
20 void
21 __assert_fail(const char *assertion, const char *file,
22 unsigned int line, const char *function)
24 fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function, assertion);
25 debugger(assertion);
29 void
30 __assert_perror_fail(int error, const char *file,
31 unsigned int line, const char *function)
33 fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function, strerror(error));
34 debugger(strerror(error));