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

Support vmodule filter support on non GNU compilers #154

Closed
garyturnbull opened this issue Jan 13, 2017 · 0 comments
Closed

Support vmodule filter support on non GNU compilers #154

garyturnbull opened this issue Jan 13, 2017 · 0 comments

Comments

@garyturnbull
Copy link

Currently the vmodule implementation is limited to GNU compilers as it uses a compiler specific extension for the VLOG_IS_ON() macro. This can be written using an inline lambda in Visual Studio 2015 and likely any compiler with C++11 support. It may also make sense to replace the current GNU specific implementation with a common one based on a lambda if the compiler supports it.

Here's an implementation that works with Visual Studio 2015 from vlog_is_on.h.

#define VLOG_IS_ON(verboselevel)	\
[]()	\
{	\
    static google::int32* vlocal__ = &google::kLogSiteUninitialized;	\
    google::int32 verbose_level__ = (verboselevel);	\
    return (*vlocal__ >= verbose_level__) &&	\
        ((vlocal__ != &google::kLogSiteUninitialized) ||	\
        (google::InitVLOG3__(&vlocal__, &FLAGS_v,	\
            __FILE__, verbose_level__))); 	\
}()
@sergiud sergiud closed this as completed Mar 30, 2021
@sergiud sergiud mentioned this issue May 6, 2021
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

No branches or pull requests

2 participants