rad  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Assert.h
Go to the documentation of this file.
1 /*
2  * scampl4cpp/engine
3  *
4  * Copyright by European Southern Observatory, 2012
5  * All rights reserved
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA.
21  */
22 
23 /*
24  * $Id: Assert.h 1139 2016-07-20 14:57:28Z landolfa $
25  */
26 
27 #include "scxml4cpp/Log.h"
28 
29 #ifndef SCXML4CPP_ASSERT_H
30 #define SCXML4CPP_ASSERT_H
31 
32 #ifndef __cplusplus
33 #error This is a C++ include file and cannot be used from plain C
34 #endif
35 
36 #ifndef SCXML4CPP_DISABLE_ASSERT
37 #define SCXML4CPP_ASSERT(a) scxml4cpp_assert(a, __FILE__, __FUNCTION__, __LINE__)
38 #define SCXML4CPP_ASSERTPTR(a) scxml4cpp_assert(a != NULL, __FILE__, __FUNCTION__, __LINE__)
39 #define SCXML4CPP_ASSERTNEVER() scxml4cpp_assert(false, __FILE__, __FUNCTION__, __LINE__)
40 #else
41 #define SCXML4CPP_ASSERT(a)
42 #define SCXML4CPP_ASSERTPTR(a)
43 #define SCXML4CPP_ASSERTNEVER()
44 #endif
45 
46 void scxml4cpp_assert(bool condition, const char* fileName, const char* functionName, int lineNumber);
47 
48 #endif // SCXML4CPP_ASSERT_H
49 
50 
51 
void scxml4cpp_assert(bool condition, const char *fileName, const char *functionName, int lineNumber)
Definition: Assert.cpp:31