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
|
Rev | Line | |
---|
[81] | 1 | #ifndef ENVIRONMENT_COMMON_DEBUG_H |
---|
| 2 | #define ENVIRONMENT_COMMON_DEBUG_H |
---|
| 3 | |
---|
[144] | 4 | #include <stdio.h> |
---|
[143] | 5 | |
---|
[117] | 6 | #define DEBUG_true true |
---|
[127] | 7 | #define DEBUG_ENVIRONMENT false |
---|
[122] | 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 |
---|
[81] | 15 | |
---|
[117] | 16 | #define MSG_ENVIRONMENT "[ENVIRONMENT]" |
---|
| 17 | |
---|
| 18 | #define __cout(component,str...) \ |
---|
[81] | 19 | do \ |
---|
| 20 | { \ |
---|
[122] | 21 | if (DEBUG_ ## component == true ) \ |
---|
| 22 | { \ |
---|
| 23 | fprintf(stdout,str); \ |
---|
| 24 | } \ |
---|
| 25 | } \ |
---|
[88] | 26 | while(0) |
---|
[81] | 27 | |
---|
[117] | 28 | #define __cerr(str...) \ |
---|
[114] | 29 | do \ |
---|
| 30 | { \ |
---|
| 31 | fprintf(stderr,str); \ |
---|
| 32 | } \ |
---|
| 33 | while(0) |
---|
| 34 | |
---|
[117] | 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 | |
---|
[81] | 65 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.