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

Macro named variable argument #239

Merged
merged 3 commits into from
Apr 2, 2024
Merged

Conversation

jnikula
Copy link
Owner

@jnikula jnikula commented Mar 24, 2024

Add support for the named variable argument in variadic macros i.e. FOO(arg...) style, and remove a long standing FIXME comment.

https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html

Rename the expected first two tokens, and comment why we do the extent
checks.
GCC and Clang support named variable argument FOO(args...) in addition
to the standard FOO(...) and __VA_ARGS__. Handle it properly.

Simply gather and concatenate all the tokens until the next "," or
")". The parsing remains rather simplistic.
@BrunoMSantos
Copy link
Collaborator

Hey, sorry for taking so long. I reviewed this over the weekend but then forgot to say something 😅

Looks good to me though!

@jnikula jnikula merged commit 419705c into master Apr 2, 2024
5 checks passed
@jnikula jnikula deleted the macro-named-variable-argument branch April 2, 2024 08:08
@jnikula
Copy link
Owner Author

jnikula commented Apr 2, 2024

Hey, sorry for taking so long. I reviewed this over the weekend but then forgot to say something 😅

Looks good to me though!

Thanks, appreciated, as always!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants