Rev 4307 | Rev 4743 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4307 | Rev 4739 | ||
|---|---|---|---|
| Line 57... | Line 57... | ||
| 57 | /** Stores the value as an error code and checks if an error occurred. |
57 | /** Stores the value as an error code and checks if an error occurred. |
| 58 | * @param value The value to be checked. May be a function call. Input parameter. |
58 | * @param value The value to be checked. May be a function call. Input parameter. |
| 59 | * @returns FALSE if the value indicates success (EOK). |
59 | * @returns FALSE if the value indicates success (EOK). |
| 60 | * @returns TRUE otherwise. |
60 | * @returns TRUE otherwise. |
| 61 | */ |
61 | */ |
| 62 | #define ERROR_OCCURRED( value ) (( ERROR_CODE = ( value )) != EOK ) |
- | |
| 63 | - | ||
| 64 | /** Checks if an error occurred and immediately exits the actual function returning the error code. |
- | |
| 65 | * @param value The value to be checked. May be a function call. Input parameter. |
- | |
| 66 | */ |
- | |
| 67 | #ifdef CONFIG_DEBUG |
62 | #ifdef CONFIG_DEBUG |
| 68 | 63 | ||
| 69 | #define ERROR_PROPAGATE( value ) if( ERROR_OCCURRED( value )){ printf( "error at %s:%d %d\n", __FILE__, __LINE__, ERROR_CODE ); return ERROR_CODE; } |
64 | #define ERROR_OCCURRED( value ) (( ERROR_CODE = ( value )) != EOK ) |
| 70 | 65 | ||
| 71 | #else |
66 | #else |
| 72 | 67 | ||
| 73 | #define ERROR_PROPAGATE( value ) if( ERROR_OCCURRED( value )) return ERROR_CODE |
68 | #define ERROR_OCCURRED( value ) ((( ERROR_CODE = ( value )) != EOK ) && ({ printf( "error at %s:%d %d\n", __FILE__, __LINE__, ERROR_CODE ); 1; })) |
| 74 | 69 | ||
| 75 | #endif |
70 | #endif |
| 76 | 71 | ||
| - | 72 | /** Checks if an error occurred and immediately exits the actual function returning the error code. |
|
| - | 73 | * @param value The value to be checked. May be a function call. Input parameter. |
|
| - | 74 | */ |
|
| - | 75 | ||
| - | 76 | #define ERROR_PROPAGATE( value ) if( ERROR_OCCURRED( value )) return ERROR_CODE |
|
| - | 77 | ||
| 77 | #endif |
78 | #endif |
| 78 | 79 | ||
| 79 | /** @} |
80 | /** @} |
| 80 | */ |
81 | */ |