Mobile API Reference  MicroStrategy 2019
DiagnoseCxx.h
Go to the documentation of this file.
1 //
2 // DiagnoseCxx.h
3 // ReportServiceCore
4 //
5 // Created by Sun on 3/9/18.
6 // Copyright © 2018 MicroStrategy, Inc. All rights reserved.
7 //
8 
9 #ifndef DiagnoseCxx_h
10 #define DiagnoseCxx_h
11 #include <stdio.h>
12 #define CHECK_HR {if (hr != S_OK) {print_stacktrace(); return hr;}}
13 #define CHECK_PTR(p) {if (!p) {print_stacktrace(); return E_POINTER;}}
14 #define CHECK_NEWED_PTR(p) {if (!p) {print_stacktrace(); return E_OUT_OF_MEMORY;}}
15 #define CHECK_HR_PTR(ptr) { CHECK_HR; CHECK_PTR(ptr);}
16 #define AE_ASSERT(expr) {_ASSERT(expr); if (!(expr)) return E_ASSERT;}
17 #define CHECK_HR_BLOCK(type) {CHECK_HR; if (type != lBlockType) {print_stacktrace(); return E_DATABLOCK;}}
18 #define CHECK_HR_OBJTYPE(type) {CHECK_HR; if (type != lObjectType) {print_stacktrace(); return E_DATABLOCK;}}
19 
20 void print_stacktrace(FILE *out = stderr, unsigned int max_frames = 63);
21 
22 #endif /* TraceCxx_h */
void print_stacktrace(FILE *out=stderr, unsigned int max_frames=63)