Added a proper assert() implementation, removed the old one.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8242 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -3,6 +3,7 @@ SubDir OBOS_TOP src kernel libroot posix ;
|
|||||||
UsePrivateHeaders [ FDirName syslog_daemon ] ;
|
UsePrivateHeaders [ FDirName syslog_daemon ] ;
|
||||||
|
|
||||||
KernelMergeObject posix_main.o :
|
KernelMergeObject posix_main.o :
|
||||||
|
<$(SOURCE_GRIST)>assert.c
|
||||||
<$(SOURCE_GRIST)>dlfcn.c
|
<$(SOURCE_GRIST)>dlfcn.c
|
||||||
<$(SOURCE_GRIST)>errno.c
|
<$(SOURCE_GRIST)>errno.c
|
||||||
<$(SOURCE_GRIST)>fnmatch.c
|
<$(SOURCE_GRIST)>fnmatch.c
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
** Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
|
** Distributed under the terms of the Haiku License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#undef NDEBUG
|
||||||
|
// just in case
|
||||||
|
|
||||||
|
#include <OS.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern char *__progname;
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
__assert_fail(const char *assertion, const char *file,
|
||||||
|
unsigned int line, const char *function)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function, assertion);
|
||||||
|
debugger(assertion);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
__assert_perror_fail(int error, const char *file,
|
||||||
|
unsigned int line, const char *function)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: %s:%d:%s: %s\n", __progname, file, line, function, strerror(error));
|
||||||
|
debugger(strerror(error));
|
||||||
|
}
|
||||||
@@ -2,7 +2,6 @@ SubDir OBOS_TOP src kernel libroot posix stdlib ;
|
|||||||
|
|
||||||
KernelMergeObject posix_stdlib.o :
|
KernelMergeObject posix_stdlib.o :
|
||||||
<$(SOURCE_GRIST)>abs.c
|
<$(SOURCE_GRIST)>abs.c
|
||||||
<$(SOURCE_GRIST)>assert.c
|
|
||||||
<$(SOURCE_GRIST)>atof.c
|
<$(SOURCE_GRIST)>atof.c
|
||||||
<$(SOURCE_GRIST)>atoi.c
|
<$(SOURCE_GRIST)>atoi.c
|
||||||
<$(SOURCE_GRIST)>bsearch.c
|
<$(SOURCE_GRIST)>bsearch.c
|
||||||
@@ -28,7 +27,6 @@ KernelMergeObject posix_stdlib.o :
|
|||||||
|
|
||||||
MergeObjectFromObjects kernel_posix_stdlib.o :
|
MergeObjectFromObjects kernel_posix_stdlib.o :
|
||||||
<$(SOURCE_GRIST)>abs.o
|
<$(SOURCE_GRIST)>abs.o
|
||||||
<$(SOURCE_GRIST)>assert.o
|
|
||||||
<$(SOURCE_GRIST)>atoi.o
|
<$(SOURCE_GRIST)>atoi.o
|
||||||
<$(SOURCE_GRIST)>bsearch.o
|
<$(SOURCE_GRIST)>bsearch.o
|
||||||
<$(SOURCE_GRIST)>merge.o
|
<$(SOURCE_GRIST)>merge.o
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
/*
|
|
||||||
** Copyright 2002, Travis Geiselbrecht. All rights reserved.
|
|
||||||
** Copyright 2002, Manuel J. Petit. All rights reserved.
|
|
||||||
** Distributed under the terms of the NewOS License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
void
|
|
||||||
_assert(char const *s1, int l, char const *s2)
|
|
||||||
{
|
|
||||||
(void)(s1);
|
|
||||||
(void)(l);
|
|
||||||
(void)(s2);
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user