mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-06-19 21:38:30 +08:00
- support "weak" function definitions when available with compiler.
This commit is contained in:
@ -1092,8 +1092,14 @@ void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
|
#ifdef UNITY_SUPPORT_WEAK
|
||||||
|
void setUp(void) { }
|
||||||
|
void tearDown(void) { }
|
||||||
|
#else
|
||||||
void setUp(void);
|
void setUp(void);
|
||||||
void tearDown(void);
|
void tearDown(void);
|
||||||
|
#endif
|
||||||
|
//-----------------------------------------------
|
||||||
void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum)
|
void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum)
|
||||||
{
|
{
|
||||||
Unity.CurrentTestName = FuncName;
|
Unity.CurrentTestName = FuncName;
|
||||||
|
@ -260,6 +260,26 @@ extern int UNITY_OUTPUT_CHAR(int);
|
|||||||
#define UNITY_COUNTER_TYPE _U_UINT
|
#define UNITY_COUNTER_TYPE _U_UINT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
// Language Features Available
|
||||||
|
//-------------------------------------------------------
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define UNITY_SUPPORT_WEAK __attribute__((weak))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#define UNITY_SUPPORT_WEAK __attribute__((weak))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef UNITY_WEAK
|
||||||
|
#ifdef UNITY_SUPPORT_WEAK
|
||||||
|
#define UNITY_WEAK __attribute__((weak))
|
||||||
|
#else
|
||||||
|
#define UNITY_WEAK
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// Internal Structs Needed
|
// Internal Structs Needed
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user