mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcTemplateLib: Use __VA_ARGS__ indirection to prevent premature evalutaion by MSVC
This commit is contained in:
parent
44af121919
commit
1bf2915bf3
@ -37,7 +37,13 @@ VOID
|
||||
#define PRIV_OC_STRUCTOR_EXPAND(...) __VA_ARGS__
|
||||
|
||||
#define PRIV_OC_SELECT_NEXT_INNER(Dummy, Next, ...) Next
|
||||
#define PRIV_OC_SELECT_NEXT(...) PRIV_OC_SELECT_NEXT_INNER(__VA_ARGS__, Unused)
|
||||
//
|
||||
// Without this layer of indirection, MSVC evaluates __VA_ARGS__ early and
|
||||
// PRIV_OC_SELECT_NEXT_INNER receives only two arguments, the second always
|
||||
// being Unused as per PRIV_OC_SELECT_NEXT.
|
||||
//
|
||||
#define PRIV_OC_SELECT_NEXT_INNER_INDIR(...) PRIV_OC_SELECT_NEXT_INNER __VA_ARGS__
|
||||
#define PRIV_OC_SELECT_NEXT(...) PRIV_OC_SELECT_NEXT_INNER_INDIR((__VA_ARGS__, Unused))
|
||||
#define PRIV_OC_REMOVE_NEXT(...) , do { } while (0),
|
||||
|
||||
#define PRIV_OC_DECLARE_STRUCT_MEMBER(Type, Name, Suffix, Constructor, Destructor) \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user