Skip to content

Commit

Permalink
Fix #781, Terminate UT macro variadic lists
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Feb 11, 2021
1 parent 09a2c5e commit 8c83486
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ut_assert/inc/utstubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,15 @@ int32 UT_DefaultStubImpl(const char *FunctionName, UT_EntryKey_t FuncKey, int32
*
* This version should be used on stubs that take no arguments
* and are expected to return 0 in the nominal case
*
* NOTE - Adding a NULL to the va list is only done for the
* two macros that do not have a va list passed in by the
* caller and is NOT a general pattern. Hooks that handle
* va lists should utilize the UT_KEY to process
* va lists correctly based on the implementation (no
* general pattern should be assumed).
*/
#define UT_DEFAULT_IMPL(FuncName) UT_DefaultStubImpl(#FuncName, UT_KEY(FuncName), 0)
#define UT_DEFAULT_IMPL(FuncName) UT_DefaultStubImpl(#FuncName, UT_KEY(FuncName), 0, NULL)

/**
* Macro to simplify usage of the UT_DefaultStubImpl() function
Expand All @@ -475,8 +482,15 @@ int32 UT_DefaultStubImpl(const char *FunctionName, UT_EntryKey_t FuncKey, int32
*
* This version should be used on stubs that take no arguments
* and are expected to return nonzero in the nominal case
*
* NOTE - Adding a NULL to the va list is only done for the
* two macros that do not have a va list passed in by the
* caller and is NOT a general pattern. Hooks that handle
* va lists should utilize the UT_KEY to process
* va lists correctly based on the implementation (no
* general pattern should be assumed).
*/
#define UT_DEFAULT_IMPL_RC(FuncName, Rc) UT_DefaultStubImpl(#FuncName, UT_KEY(FuncName), Rc)
#define UT_DEFAULT_IMPL_RC(FuncName, Rc) UT_DefaultStubImpl(#FuncName, UT_KEY(FuncName), Rc, NULL)

/**
* Macro to simplify usage of the UT_DefaultStubImpl() function
Expand Down

0 comments on commit 8c83486

Please sign in to comment.