mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-09-05 09:49:59 +00:00
added defines to example Types.h needed by some compilers; reverted changes in return handling that accidentally snuck in previous check in
git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@58 bf332499-1b4d-0410-844d-d2d48d5cc64c
This commit is contained in:
@@ -36,6 +36,26 @@ typedef char bool;
|
||||
#endif // NULL
|
||||
#define DONT_CARE (0)
|
||||
|
||||
// Floating point edge case defintions
|
||||
#define MATH_NaN (0xFFFFFFFF)
|
||||
#define MATH_POS_INF (0x7F800000)
|
||||
#define MATH_NEG_INF (0xFF800000)
|
||||
|
||||
#define F_TO_U(f) (*(uint32_t*)(&f))
|
||||
#define U_TO_F(u) (*(float*)(u))
|
||||
|
||||
#define IS_NAN(f) ( F_TO_U(f) == MATH_NaN )
|
||||
#define IS_POS_INF(f) ( F_TO_U(f) == MATH_POS_INF )
|
||||
#define IS_NEG_INF(f) ( F_TO_U(f) == MATH_NEG_INF )
|
||||
|
||||
#ifndef INFINITY
|
||||
#define INFINITY (U_TO_F(MATH_POS_INF))
|
||||
#endif
|
||||
|
||||
#ifndef NAN
|
||||
#define NAN MATH_NaN
|
||||
#endif
|
||||
|
||||
// MIN/MAX Definitions for Standard Types
|
||||
#ifndef INT8_MAX
|
||||
#define INT8_MAX 127
|
||||
|
||||
Reference in New Issue
Block a user