Skip to content

Commit

Permalink
Restrict BRPC_VALIDATE_GFLAG to global scope and namespace scope only (
Browse files Browse the repository at this point in the history
  • Loading branch information
chenBright committed May 6, 2024
1 parent f97cbe5 commit 4c5fad0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/brpc/reloadable_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand Down

0 comments on commit 4c5fad0

Please sign in to comment.