F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CAssert.h
Go to the documentation of this file.
1 /*
2  * FwCAssert.hpp
3  *
4  * Created on: Jun 8, 2014
5  * Author: tcanham
6  */
7 
8 #ifndef FWCASSERT_HPP_
9 #define FWCASSERT_HPP_
10 
11 #include <Fw/FPrimeBasicTypes.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 #if FW_ASSERT_LEVEL == FW_NO_ASSERT
18 
19 #define FW_CASSERT(...)
20 #define FW_CASSERT_1(cond, arg1)
21 
22 #else // ASSERT is defined
23 
24 #if FW_ASSERT_LEVEL == FW_FILEID_ASSERT
25 #define FILE_NAME_ARG U32
26 #define FW_CASSERT(cond) ((void)((cond) ? (0) : (CAssert0(ASSERT_FILE_ID, __LINE__))))
27 #define FW_CASSERT_1(cond, arg1) ((void)((cond) ? (0) : (CAssert1(ASSERT_FILE_ID, (FwAssertArgType)(arg1), __LINE__))))
28 #else
29 #define FILE_NAME_ARG const CHAR*
30 #define FW_CASSERT(cond) ((void)((cond) ? (0) : (CAssert0((FILE_NAME_ARG)(__FILE__), __LINE__))))
31 #define FW_CASSERT_1(cond, arg1) \
32  ((void)((cond) ? (0) : (CAssert1((FILE_NAME_ARG)(__FILE__), (FwAssertArgType)(arg1), __LINE__))))
33 #endif
34 
35 I8 CAssert0(FILE_NAME_ARG file, FwSizeType lineNo);
37 
38 #endif // ASSERT is defined
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif /* FWCASSERT_HPP_ */
I8 CAssert1(FILE_NAME_ARG file, FwAssertArgType arg1, FwSizeType lineNo)
Definition: Assert.cpp:195
PlatformSizeType FwSizeType
int8_t I8
8-bit signed integer
Definition: BasicTypes.h:50
#define FILE_NAME_ARG
Definition: Assert.hpp:16
I8 CAssert0(FILE_NAME_ARG file, FwSizeType lineNo)
Definition: Assert.cpp:183
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.