forked from Imagelibrary/rtems
2008-01-09 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/src/__assert.c: Clean up and make __assert() call __assert_func().
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2008-01-09 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* libcsupport/src/__assert.c: Clean up and make __assert() call
|
||||||
|
__assert_func().
|
||||||
|
|
||||||
2008-01-09 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2008-01-09 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* libcsupport/src/__assert.c: Newlib 1.16.0 adds __assert_func(). We
|
* libcsupport/src/__assert.c: Newlib 1.16.0 adds __assert_func(). We
|
||||||
|
|||||||
@@ -17,23 +17,10 @@
|
|||||||
#include <rtems/bspIo.h>
|
#include <rtems/bspIo.h>
|
||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
|
|
||||||
void __assert(
|
|
||||||
const char *file,
|
|
||||||
int line,
|
|
||||||
|
|
||||||
const char *failedexpr)
|
|
||||||
{
|
|
||||||
printk(
|
|
||||||
"assertion \"%s\" failed: file \"%s\", line %d\n",
|
|
||||||
failedexpr,
|
|
||||||
file,
|
|
||||||
line
|
|
||||||
);
|
|
||||||
rtems_fatal_error_occurred(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Newlib 1.16.0 added this method
|
* Newlib 1.16.0 added this method. Together these provide an
|
||||||
|
* RTEMS safe, low memory implementation.
|
||||||
*/
|
*/
|
||||||
void __assert_func(
|
void __assert_func(
|
||||||
const char *file,
|
const char *file,
|
||||||
@@ -46,7 +33,17 @@ void __assert_func(
|
|||||||
failedexpr,
|
failedexpr,
|
||||||
file,
|
file,
|
||||||
line,
|
line,
|
||||||
func ? ", function: " : "", func ? func : ""
|
(func) ? ", function: " : "",
|
||||||
|
(func) ? func : ""
|
||||||
);
|
);
|
||||||
rtems_fatal_error_occurred(0);
|
rtems_fatal_error_occurred(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __assert(
|
||||||
|
const char *file,
|
||||||
|
int line,
|
||||||
|
const char *failedexpr
|
||||||
|
)
|
||||||
|
{
|
||||||
|
__assert_func (file, line, NULL, failedexpr);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user