Cygwin: access: Fix X_OK behaviour for backup operators and admins
[newlib-cygwin.git] / newlib / libc / machine / spu / assert.c
blob90e94eb5de475e154bd2afb53f1dc780bfd3fe18
1 #include <assert.h>
2 #include <stdlib.h>
3 #include <stdio.h>
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 */
11 /* func can be NULL, in which case no function information is given. */
12 void
13 __assert_func (const char *file,
14 int line,
15 const char *func,
16 const char *failedexpr)
18 fprintf(stderr,
19 "assertion \"%s\" failed: file \"%s\", line %d%s%s\n",
20 failedexpr, file, line,
21 func ? ", function: " : "", func ? func : "");
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.
28 exit(6);
29 /* NOTREACHED */
32 void
33 __assert (const char *file,
34 int line,
35 const char *failedexpr)
37 __assert_func (file, line, NULL, failedexpr);
38 /* NOTREACHED */