Last change
on this file was
144,
checked in by rosiere, 14 years ago
|
1) compatible gcc 4.4.3
2) Translation file in MORPHEO_PREFIX directory
|
-
Property svn:keywords set to
Id
|
File size:
2.0 KB
|
Line | |
---|
1 | #ifndef ENVIRONMENT_COMMON_DEBUG_H |
---|
2 | #define ENVIRONMENT_COMMON_DEBUG_H |
---|
3 | |
---|
4 | #include <stdio.h> |
---|
5 | |
---|
6 | #define DEBUG_true true |
---|
7 | #define DEBUG_ENVIRONMENT false |
---|
8 | #define DEBUG_CACHE false |
---|
9 | #define DEBUG_DATA false |
---|
10 | #define DEBUG_ENDIANNESS false |
---|
11 | #define DEBUG_QUEUE false |
---|
12 | #define DEBUG_RAMLOCK false |
---|
13 | #define DEBUG_SIM2OS false |
---|
14 | #define DEBUG_TTY false |
---|
15 | |
---|
16 | #define MSG_ENVIRONMENT "[ENVIRONMENT]" |
---|
17 | |
---|
18 | #define __cout(component,str...) \ |
---|
19 | do \ |
---|
20 | { \ |
---|
21 | if (DEBUG_ ## component == true ) \ |
---|
22 | { \ |
---|
23 | fprintf(stdout,str); \ |
---|
24 | } \ |
---|
25 | } \ |
---|
26 | while(0) |
---|
27 | |
---|
28 | #define __cerr(str...) \ |
---|
29 | do \ |
---|
30 | { \ |
---|
31 | fprintf(stderr,str); \ |
---|
32 | } \ |
---|
33 | while(0) |
---|
34 | |
---|
35 | #define cout(str...) \ |
---|
36 | do \ |
---|
37 | { \ |
---|
38 | fprintf(stdout,"%s ",MSG_ENVIRONMENT); \ |
---|
39 | __cout(true,str); \ |
---|
40 | fflush (stdout); \ |
---|
41 | } \ |
---|
42 | while(0) |
---|
43 | |
---|
44 | #define cerr(str...) \ |
---|
45 | do \ |
---|
46 | { \ |
---|
47 | fprintf(stderr,"%s ",MSG_ENVIRONMENT); \ |
---|
48 | __cerr(str); \ |
---|
49 | fflush (stderr); \ |
---|
50 | } \ |
---|
51 | while(0) |
---|
52 | |
---|
53 | #define _cout(component, str...) \ |
---|
54 | do \ |
---|
55 | { \ |
---|
56 | if (DEBUG_ ## component == true ) \ |
---|
57 | { \ |
---|
58 | cout(str); \ |
---|
59 | } \ |
---|
60 | } \ |
---|
61 | while(0) |
---|
62 | |
---|
63 | #define _cerr(str...) cerr(str) |
---|
64 | |
---|
65 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.