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

Fixed compilation errors during macro expansion by vs2022 #237

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cyrilcourvoisier
Copy link

On Visual Studio 2022 compiler, the macro expansion of DLOG_IF_F fails for some reasons. VA_ARGS is expanded into 'cond' variable of the VLOG_IF macro and : loguru::log() only got three arguments.

#define VLOG_IF_F(verbosity, cond, ...)
((verbosity) > loguru::current_verbosity_cutoff() || (cond) == false)
? (void)0
: loguru::log(verbosity, FILE, LINE, VA_ARGS)

I have added 'cond' parameter to DLOG_IF_F and DVLOG_IF_F so the signature maps correctly with VLOG_IF_F and it fixes the problem.

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.

1 participant