Rev | Line | |
---|
[81] | 1 | #ifndef ENVIRONMENT_COMMON_DEBUG_H |
---|
| 2 | #define ENVIRONMENT_COMMON_DEBUG_H |
---|
| 3 | |
---|
[117] | 4 | #define DEBUG_true true |
---|
[127] | 5 | #define DEBUG_ENVIRONMENT false |
---|
[122] | 6 | #define DEBUG_CACHE false |
---|
| 7 | #define DEBUG_DATA false |
---|
| 8 | #define DEBUG_ENDIANNESS false |
---|
| 9 | #define DEBUG_QUEUE false |
---|
| 10 | #define DEBUG_RAMLOCK false |
---|
| 11 | #define DEBUG_SIM2OS false |
---|
| 12 | #define DEBUG_TTY false |
---|
[81] | 13 | |
---|
[117] | 14 | #define MSG_ENVIRONMENT "[ENVIRONMENT]" |
---|
| 15 | |
---|
| 16 | #define __cout(component,str...) \ |
---|
[81] | 17 | do \ |
---|
| 18 | { \ |
---|
[122] | 19 | if (DEBUG_ ## component == true ) \ |
---|
| 20 | { \ |
---|
| 21 | fprintf(stdout,str); \ |
---|
| 22 | } \ |
---|
| 23 | } \ |
---|
[88] | 24 | while(0) |
---|
[81] | 25 | |
---|
[117] | 26 | #define __cerr(str...) \ |
---|
[114] | 27 | do \ |
---|
| 28 | { \ |
---|
| 29 | fprintf(stderr,str); \ |
---|
| 30 | } \ |
---|
| 31 | while(0) |
---|
| 32 | |
---|
[117] | 33 | #define cout(str...) \ |
---|
| 34 | do \ |
---|
| 35 | { \ |
---|
| 36 | fprintf(stdout,"%s ",MSG_ENVIRONMENT); \ |
---|
| 37 | __cout(true,str); \ |
---|
| 38 | fflush (stdout); \ |
---|
| 39 | } \ |
---|
| 40 | while(0) |
---|
| 41 | |
---|
| 42 | #define cerr(str...) \ |
---|
| 43 | do \ |
---|
| 44 | { \ |
---|
| 45 | fprintf(stderr,"%s ",MSG_ENVIRONMENT); \ |
---|
| 46 | __cerr(str); \ |
---|
| 47 | fflush (stderr); \ |
---|
| 48 | } \ |
---|
| 49 | while(0) |
---|
| 50 | |
---|
| 51 | #define _cout(component, str...) \ |
---|
| 52 | do \ |
---|
| 53 | { \ |
---|
| 54 | if (DEBUG_ ## component == true ) \ |
---|
| 55 | { \ |
---|
| 56 | cout(str); \ |
---|
| 57 | } \ |
---|
| 58 | } \ |
---|
| 59 | while(0) |
---|
| 60 | |
---|
| 61 | #define _cerr(str...) cerr(str) |
---|
| 62 | |
---|
[81] | 63 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.