fprime/Fw/Types/CAssert.hpp
M Starch b76d8c9a0c
Update/types refactor as constants (#1623)
* lestarch: adding logical types implementation into Linux/StandardTypes.hpp

* lestarch: removing VxWorks StandardTypes from repository

* updated fprime types for correct compilation with vxworks and baremetal

* lestarch: refactoring types and configuration header w.r.t type design

* lestarch: replacing usages of AssertArg with FwAssertArgType

* lestarch: missspelled configuration

* lestarch: minor compilation fixes

* lestarch: renaming StandardTypes.hpp -> PlatformTypes.hpp

* lestarch: updating PRI tokens

* lestarch: replacing BasicTypes.hpp includes with FpConfig.hpp

* lestarch: UT and compilation fixes for types refactor

* lestarch: sp

* lestarch: fixing RPI issues in PassiveConsoleTextLogger

* lestarch: converting RPI build to debug

* lestarch: removing duplicate config imports

* lestarch: fixing documentation

* lestarch: fixing up multiple definitions and RPI compilation problems

* lestarch: reverting debug build

* lestarch: reverting platform types to class-based constants

* lestarch: reworking basic types

* lestarch: configured types refactor into classes

* lestarch: fixing bugs with static constants in classes

* lestarch: fixing platform types spelling and documentation

* lestarch: adding include guards to types headers

Co-authored-by: Kevin F Ortega <kevin.f.ortega@jpl.nasa.gov>
2022-08-18 13:25:56 -07:00

46 lines
912 B
C++

/*
* FwCAssert.hpp
*
* Created on: Jun 8, 2014
* Author: tcanham
*/
#ifndef FWCASSERT_HPP_
#define FWCASSERT_HPP_
#include <FpConfig.hpp>
#if FW_ASSERT_LEVEL == FW_NO_ASSERT
#define FW_CASSERT(...)
#else // ASSERT is defined
#if FW_ASSERT_LEVEL == FW_FILEID_ASSERT
#define FILE_NAME_ARG NATIVE_UINT_TYPE
#define FW_CASSERT(cond) \
((void) ((cond) ? (0) : \
(CAssert0(ASSERT_FILE_ID, __LINE__))))
#else
#define FILE_NAME_ARG const U8*
#define FW_CASSERT(cond) \
((void) ((cond) ? (0) : \
(CAssert0((FILE_NAME_ARG)(__FILE__), __LINE__))))
#endif
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
I32 CAssert0(FILE_NAME_ARG file, U32 lineNo); //!< C assert function
I32 CAssert1(FILE_NAME_ARG file, U32 lineNo, NATIVE_INT_TYPE arg1); //!< C assert function 1
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // ASSERT is defined
#endif /* FWCASSERT_HPP_ */