summaryrefslogtreecommitdiff
path: root/source/utilities/Error.h
blob: 069328792dba82e920f1bf3ea4eba829dd647130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*******************************************************************************
 * Copyright (C) ST-Ericsson SA 2011
 * License terms: 3-clause BSD license
 ******************************************************************************/
#ifndef _ERROR_H_
#define _ERROR_H_

#define VERIFY(Condition, ErrorCode)\
    do\
    {\
        if(!(Condition))\
        {\
            ReturnValue = (ErrorCode);\
            goto ErrorExit;\
        }\
    } while(0)

#define VERIFY_SUCCESS(ErrorCode)\
    do\
    {\
        ReturnValue = (ErrorCode);\
        VERIFY(E_SUCCESS == ReturnValue, ReturnValue);\
    } while (0)

#endif // _ERROR_H_