Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #781, Terminate UT macro variadic lists #782

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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