summaryrefslogtreecommitdiff
path: root/avstream/avscamera/common/Macros.h
blob: b87aa436907319a5072a15d6f1bf6a3f32ab18de (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**************************************************************************

    A/V Stream Camera Sample

    Copyright (c) 2014, Microsoft Corporation.

    File:

        macros.h

    Abstract:

        This file contains common error checking macros for the MFT0

    History:

        created 10/10/2014

**************************************************************************/

#pragma once

#define IFFAILED_BREAK(exp) \
{ \
    if ( FAILED(hr= (exp)) ) \
    { \
        break; \
    } \
}

#define IFFALSE_BREAK_HR(exp, retval) \
{ \
    if ( !(exp)) \
    { \
        hr = retval; \
        break; \
    } \
}


#define IFNULL_BREAK_HR(exp, retval) \
{ \
    if ( (exp) == NULL ) \
    { \
        hr = retval; \
        break; \
    } \
}