summaryrefslogtreecommitdiff
path: root/AVStream/avscamera/common/Macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'AVStream/avscamera/common/Macros.h')
-rw-r--r--AVStream/avscamera/common/Macros.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/AVStream/avscamera/common/Macros.h b/AVStream/avscamera/common/Macros.h
new file mode 100644
index 00000000..b87aa436
--- /dev/null
+++ b/AVStream/avscamera/common/Macros.h
@@ -0,0 +1,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; \
+ } \
+} \ No newline at end of file