Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4738 → Rev 4739

/branches/network/uspace/srv/net/err.h
59,22 → 59,23
* @returns FALSE if the value indicates success (EOK).
* @returns TRUE otherwise.
*/
#ifdef CONFIG_DEBUG
 
#define ERROR_OCCURRED( value ) (( ERROR_CODE = ( value )) != EOK )
 
#else
 
#define ERROR_OCCURRED( value ) ((( ERROR_CODE = ( value )) != EOK ) && ({ printf( "error at %s:%d %d\n", __FILE__, __LINE__, ERROR_CODE ); 1; }))
 
#endif
 
/** Checks if an error occurred and immediately exits the actual function returning the error code.
* @param value The value to be checked. May be a function call. Input parameter.
*/
#ifdef CONFIG_DEBUG
 
#define ERROR_PROPAGATE( value ) if( ERROR_OCCURRED( value )){ printf( "error at %s:%d %d\n", __FILE__, __LINE__, ERROR_CODE ); return ERROR_CODE; }
 
#else
 
#define ERROR_PROPAGATE( value ) if( ERROR_OCCURRED( value )) return ERROR_CODE
 
#endif
 
#endif
 
/** @}
*/