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 
21 #else // ASSERT is defined
22 
23 #if FW_ASSERT_LEVEL == FW_FILEID_ASSERT
24 #define FILE_NAME_ARG U32
25 #define FW_CASSERT(cond) ((void)((cond) ? (0) : (CAssert0(ASSERT_FILE_ID, __LINE__))))
26 #else
27 #define FILE_NAME_ARG const CHAR*
28 #define FW_CASSERT(cond) ((void)((cond) ? (0) : (CAssert0((FILE_NAME_ARG)(__FILE__), __LINE__))))
29 #endif
30 
31 I8 CAssert0(FILE_NAME_ARG file, FwSizeType lineNo);
32 
33 #endif // ASSERT is defined
34 
35 #ifdef __cplusplus
36 }
37 #endif
38 
39 #endif /* FWCASSERT_HPP_ */
PlatformSizeType FwSizeType
int8_t I8
8-bit signed integer
Definition: BasicTypes.h:53
#define FILE_NAME_ARG
Definition: Assert.hpp:16
I8 CAssert0(FILE_NAME_ARG file, FwSizeType lineNo)
Definition: Assert.cpp:185