Subversion Repositories HelenOS

Rev

Rev 4743 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4743 Rev 4756
Line 53... Line 53...
53
 *  This has to be declared in the block where the error processing is desired.
53
 *  This has to be declared in the block where the error processing is desired.
54
 */
54
 */
55
#define ERROR_DECLARE               int ERROR_CODE
55
#define ERROR_DECLARE               int ERROR_CODE
56
 
56
 
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[in] value The value to be checked. May be a function call.
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
#ifdef CONFIG_DEBUG
62
#ifdef CONFIG_DEBUG
63
 
63
 
Line 68... Line 68...
68
#define ERROR_OCCURRED( value )     (( ERROR_CODE = ( value )) != EOK )
68
#define ERROR_OCCURRED( value )     (( ERROR_CODE = ( value )) != EOK )
69
 
69
 
70
#endif
70
#endif
71
 
71
 
72
/** Checks if an error occurred and immediately exits the actual function returning the error code.
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.
73
 *  @param[in] value The value to be checked. May be a function call.
74
 */
74
 */
75
 
75
 
76
#define ERROR_PROPAGATE( value )    if( ERROR_OCCURRED( value )) return ERROR_CODE
76
#define ERROR_PROPAGATE( value )    if( ERROR_OCCURRED( value )) return ERROR_CODE
77
 
77
 
78
#endif
78
#endif