source: rtems/cpukit/libcsupport/src/__assert.c @ 29ab6a0

4.104.114.9
Last change on this file since 29ab6a0 was 29ab6a0, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 9, 2008 at 4:37:40 PM

2008-01-09 Joel Sherrill <joel.sherrill@…>

  • libcsupport/src/assert.c: Clean up and make assert() call assert_func().
  • Property mode set to 100644
File size: 957 bytes
Line 
1/*  __assert - small RTEMS Specific Implementation
2 *
3 *  COPYRIGHT (c) 2007.
4 *  On-Line Applications Research Corporation (OAR).
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *  http://www.rtems.com/license/LICENSE.
9 *
10 *  $Id$
11 */
12
13#if HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include <rtems/bspIo.h>
18#include <rtems.h>
19
20
21/*
22 * Newlib 1.16.0 added this method.  Together these provide an
23 * RTEMS safe, low memory implementation.
24 */
25void __assert_func(
26  const char *file,
27  int         line,
28  const char *func,
29  const char *failedexpr
30)
31{
32  printk("assertion \"%s\" failed: file \"%s\", line %d%s%s\n",
33    failedexpr,
34    file,
35    line,
36    (func) ? ", function: " : "",
37    (func) ? func : ""
38  );
39  rtems_fatal_error_occurred(0);
40}
41
42void __assert(
43  const char *file,
44  int         line,
45  const char *failedexpr
46)
47{
48  __assert_func (file, line, NULL, failedexpr);
49}
Note: See TracBrowser for help on using the repository browser.