source: rtems/cpukit/libcsupport/src/__assert.c @ b36dc03

4.104.114.95
Last change on this file since b36dc03 was b36dc03, checked in by Joel Sherrill <joel.sherrill@…>, on 01/09/08 at 15:40:19

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

  • libcsupport/src/assert.c: Newlib 1.16.0 adds assert_func(). We need to have it also.
  • Property mode set to 100644
File size: 969 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
20void __assert(
21  const char *file,
22  int         line,
23 
24const char *failedexpr)
25{
26  printk(
27    "assertion \"%s\" failed: file \"%s\", line %d\n",
28    failedexpr,
29    file,
30    line
31   );
32   rtems_fatal_error_occurred(0);
33}
34
35/*
36 * Newlib 1.16.0 added this method
37 */
38void __assert_func(
39  const char *file,
40  int         line,
41  const char *func,
42  const char *failedexpr
43)
44{
45  printk("assertion \"%s\" failed: file \"%s\", line %d%s%s\n",
46    failedexpr,
47    file,
48    line,
49    func ? ", function: " : "", func ? func : ""
50  );
51  rtems_fatal_error_occurred(0);
52}
Note: See TracBrowser for help on using the repository browser.