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

Fix gflags namespace #2877

Merged
merged 1 commit into from
Jan 18, 2025
Merged

Fix gflags namespace #2877

merged 1 commit into from
Jan 18, 2025

Conversation

chenBright
Copy link
Contributor

@chenBright chenBright commented Jan 15, 2025

What problem does this PR solve?

Issue Number: resolve #2874

Problem Summary:

GFLAGS_NS的作用是兼容gflags不同版本的不同namespace,应该是gflags 2.0前后发生了变化。目前GFLAGS_NS是在编译bRPC库的时候动态生成的。如果GFLAGS_NS出现在用户使用的头文件中,就要求用户也要定义GFLAGS_NS,否则就会编译失败。

What is changed and the side effects?

Changed:

  1. 目前bRPC库要求gflags版本大于2.1,没有namespace兼容性问题,使用gflags库的GFLAGS_NAMESPACE替代GFLAGS_NS即可。
  2. bthread、butil目录中的注册检验器的逻辑(除了string的检验器)使用BUTIL_VALIDATE_GFLAG代替。
  3. GFLAGS_NS涉及的范围比较广,一次性改完的话,改动比较大。所以先改src和test目录,等这个PR合了之后,再改tool和example目录。

Side effects:

  • Performance effects(性能影响):

  • Breaking backward compatibility(向后兼容性):


Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

@wwbmmm
Copy link
Contributor

wwbmmm commented Jan 16, 2025

LGTM

1 similar comment
@yanglimingcn
Copy link
Contributor

LGTM

@chenBright chenBright merged commit c93d0e0 into apache:master Jan 18, 2025
20 checks passed
@chenBright chenBright deleted the fix_gflag_ns branch January 18, 2025 09:49
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.

‘GFLAGS_NS’ has not been declared
3 participants