Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Generated arginfo headers: combine preprocessor conditional blocks (2) #18667

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

Merged
DanielEScherzer merged 3 commits into php:master from DanielEScherzer:arginfo-combine-conds-2
Jun 22, 2025

Conversation

Copy link
Member

@DanielEScherzer DanielEScherzer commented May 26, 2025

When global constants' or class constants' availability is based on some preprocessor condition, the generated arginfo header files wrap the declarations in the preprocessor #if conditional blocks, one per declaration, even if they are in the same conditional block based on comments in the stub file. Instead of having multiple conditional blocks one after the other with the same condition, combine them into a single conditional block.

Copy link
Contributor

@jorgsowa jorgsowa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement 👍🏽

#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) && (!defined(PHP_WIN32))
REGISTER_LONG_CONSTANT("DNS_CAA", PHP_DNS_CAA, CONST_PERSISTENT);
#endif
#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential improvement: you have the same condition on lines 3593 and 3614.

Copy link
Member Author

If there are no objections in the next few days I plan to merge this (cc @kocsismate if you wanted to take a look)

nielsdos reacted with thumbs up emoji

Copy link
Member

@kocsismate kocsismate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for the two nits. Feel free to merge it once those are addressed.

When global constants' or class constants' availability is based on some
preprocessor condition, the generated arginfo header files wrap the
declarations in the preprocessor `#if` conditional blocks, one per declaration,
even if they are in the same conditional block based on comments in the stub
file. Instead of having multiple conditional blocks one after the other with
the same condition, combine them into a single conditional block.
@DanielEScherzer DanielEScherzer merged commit ddd33fd into php:master Jun 22, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@kocsismate kocsismate kocsismate left review comments

@bukka bukka Awaiting requested review from bukka bukka is a code owner

@nielsdos nielsdos Awaiting requested review from nielsdos nielsdos is a code owner

@devnexen devnexen Awaiting requested review from devnexen devnexen is a code owner

@kamil-tekiela kamil-tekiela Awaiting requested review from kamil-tekiela kamil-tekiela is a code owner

@SakiTakamachi SakiTakamachi Awaiting requested review from SakiTakamachi SakiTakamachi is a code owner

@NattyNarwhal NattyNarwhal Awaiting requested review from NattyNarwhal NattyNarwhal is a code owner

@Girgias Girgias Awaiting requested review from Girgias Girgias is a code owner

@adoy adoy Awaiting requested review from adoy adoy is a code owner

+1 more reviewer

@jorgsowa jorgsowa jorgsowa left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /