This is an automated email from the ASF dual-hosted git repository.
wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git
The following commit(s) were added to refs/heads/master by this push:
new 4c5fad00 Restrict BRPC_VALIDATE_GFLAG to global scope and namespace
scope only (#2625)
4c5fad00 is described below
commit 4c5fad003f01e505027f4e78d9fe2b4ce3cde906
Author: Bright Chen <[email protected]>
AuthorDate: Mon May 6 10:11:10 2024 +0800
Restrict BRPC_VALIDATE_GFLAG to global scope and namespace scope only
(#2625)
---
src/brpc/reloadable_flags.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/brpc/reloadable_flags.h b/src/brpc/reloadable_flags.h
index bbe62f89..c451bde8 100644
--- a/src/brpc/reloadable_flags.h
+++ b/src/brpc/reloadable_flags.h
@@ -35,9 +35,10 @@
// modify directly. To emphasize this, you have to write the validator by
// yourself and use GFLAGS_NS::GetCommandLineOption() to acess the flag.
#define BRPC_VALIDATE_GFLAG(flag, validate_fn) \
- const int register_FLAGS_ ## flag ## _dummy \
- __attribute__((__unused__)) = \
- ::brpc::RegisterFlagValidatorOrDie( \
+ namespace brpc_flags {} \
+ const int register_FLAGS_ ## flag ## _dummy \
+ __attribute__((__unused__)) = \
+ ::brpc::RegisterFlagValidatorOrDie( \
&FLAGS_##flag, (validate_fn))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]