00001 /****************************************************************************************************** 00002 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released * 00003 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file * 00004 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. * 00005 ******************************************************************************************************/ 00006 00007 #ifndef ENGAUGE_ASSERT_H 00008 #define ENGAUGE_ASSERT_H 00009 00010 #include "LoggerUpload.h" 00011 #include <QtGlobal> 00012 00013 // For the replacements below, the qt_noop part prevents 'missing return' compiler warnings at the ends of functions 00014 inline void engauge_noop(bool) {} 00015 00020 #define ENGAUGE_ASSERT(cond) ((!(cond)) ? LoggerUpload::loggerAssert(#cond,__FILE__,__LINE__) : engauge_noop(cond)) 00022 00027 #define ENGAUGE_CHECK_PTR(ptr) (((ptr)==0) ? LoggerUpload::loggerCheckPtr(#ptr,__FILE__,__LINE__) : engauge_noop((ptr)==0)) 00029 00030 #endif // ENGAUGE_ASSERT_H