Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | pmbaty | 1 | #include "brstddiag.h" |
2 | #include "CORE/FW/brbegin.h" |
||
3 | |||
4 | #include "harness/trace.h" |
||
5 | |||
6 | #include <stdio.h> |
||
7 | |||
8 | br_diaghandler BrStdioDiagHandler = { |
||
9 | "Stdio DiagHandler", |
||
10 | BrStdioWarning, |
||
11 | BrStdioFailure, |
||
12 | }; |
||
13 | |||
14 | br_diaghandler* _BrDefaultDiagHandler = &BrStdioDiagHandler; |
||
15 | |||
16 | void BrStdioWarning(char* message) { |
||
17 | fflush(stdout); |
||
18 | fputs(message, stderr); |
||
19 | fputc('\n', stderr); |
||
20 | fflush(stderr); |
||
21 | } |
||
22 | |||
23 | void BrStdioFailure(char* message) { |
||
24 | LOG_TRACE("(%s)", message); |
||
25 | |||
26 | #if 0 |
||
27 | // FIXME: 'real' implementation ends BRender |
||
28 | BrEnd(); |
||
29 | #endif |
||
30 | fflush(stdout); |
||
31 | fputs(message, stderr); |
||
32 | fputc('\n', stderr); |
||
33 | fflush(stderr); |
||
34 | #if 0 |
||
35 | // FIXME: 'real' implementation unconditionally exits. |
||
36 | exit(10); |
||
37 | #else |
||
38 | abort(); |
||
39 | #endif |
||
40 | } |