1/* 2** Copyright 2004, Axel D��rfler, axeld@pinc-software.de. All rights reserved. 3** Distributed under the terms of the Haiku License. 4*/ 5 6 7#undef NDEBUG 8 // just in case 9 10#include <OS.h> 11 12#include <assert.h> 13#include <stdio.h> 14#include <string.h> 15 16 17extern char *__progname; 18 19 20void 21__assert_fail(const char *assertion, const char *file, 22 unsigned int line, const char *function) 23{ 24 fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function, assertion); 25 debugger(assertion); 26} 27 28 29void 30__assert_perror_fail(int error, const char *file, 31 unsigned int line, const char *function) 32{ 33 fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function, strerror(error)); 34 debugger(strerror(error)); 35} 36