OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-newlib/] [newlib-1.17.0/] [newlib/] [libc/] [machine/] [spu/] [assert.c] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 jlechner
#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.  */
12
void
13
_DEFUN (__assert_func, (file, line, func, failedexpr),
14
        const char *file _AND
15
        int line _AND
16
        const char *func _AND
17
        const char *failedexpr)
18
{
19
  fprintf(stderr,
20
           "assertion \"%s\" failed: file \"%s\", line %d%s%s\n",
21
           failedexpr, file, line,
22
           func ? ", function: " : "", func ? func : "");
23
  /*
24
   * On the SPU, we do not have signaling. Previously, standard newlib
25
   * abort code was used. That eventually leads to a kill(SIGABRT), and
26
   * for SPU too an exit(SIGABRT). SIGABRT was 6, so just use that value
27
   * here.
28
   */
29
  exit(6);
30
  /* NOTREACHED */
31
}
32
 
33
void
34
_DEFUN (__assert, (file, line, failedexpr),
35
        const char *file _AND
36
        int line _AND
37
        const char *failedexpr)
38
{
39
   __assert_func (file, line, NULL, failedexpr);
40
  /* NOTREACHED */
41
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.