source: trunk/libs/newlib/src/newlib/libc/machine/spu/assert.c @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 976 bytes
Line 
1#include <assert.h>
2#include <stdlib.h>
3#include <stdio.h>
4
5/*
6 * SPU specific assert: just directly call exit(6), and use fprintf. That
7 * way we do not pull in the abort, signal.o code, nor (the likely
8 * otherwise unused) fiprintf.
9 */
10
11/* func can be NULL, in which case no function information is given.  */
12void
13__assert_func (const char *file,
14        int line,
15        const char *func,
16        const char *failedexpr)
17{
18  fprintf(stderr,
19           "assertion \"%s\" failed: file \"%s\", line %d%s%s\n",
20           failedexpr, file, line,
21           func ? ", function: " : "", func ? func : "");
22  /*
23   * On the SPU, we do not have signaling. Previously, standard newlib
24   * abort code was used. That eventually leads to a kill(SIGABRT), and
25   * for SPU too an exit(SIGABRT). SIGABRT was 6, so just use that value
26   * here.
27   */
28  exit(6);
29  /* NOTREACHED */
30}
31
32void
33__assert (const char *file,
34        int line,
35        const char *failedexpr)
36{
37   __assert_func (file, line, NULL, failedexpr);
38  /* NOTREACHED */
39}
Note: See TracBrowser for help on using the repository browser.