Engauge Digitizer  2
EngaugeAssert.h
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #ifndef ENGAUGE_ASSERT_H
8 #define ENGAUGE_ASSERT_H
9 
10 #include "LoggerUpload.h"
11 #include <QtGlobal>
12 
13 // For the replacements below, the qt_noop part prevents 'missing return' compiler warnings at the ends of functions
14 inline void engauge_noop(bool) {}
15 
20 #define ENGAUGE_ASSERT(cond) ((!(cond)) ? LoggerUpload::loggerAssert(#cond,__FILE__,__LINE__) : engauge_noop(cond))
21 
27 #define ENGAUGE_CHECK_PTR(ptr) (((ptr)==0) ? LoggerUpload::loggerCheckPtr(#ptr,__FILE__,__LINE__) : engauge_noop((ptr)==0))
28 
30 #endif // ENGAUGE_ASSERT_H