-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
base: master
Are you sure you want to change the base?
Generated arginfo headers: combine preprocessor conditional blocks (2) #18667
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement 👍🏽
REGISTER_LONG_CONSTANT("DNS_PTR", PHP_DNS_PTR, CONST_PERSISTENT); | ||
#endif | ||
#if (defined(PHP_WIN32) || (defined(HAVE_DNS_SEARCH_FUNC) && defined(HAVE_FULL_DNS_FUNCS))) | ||
REGISTER_LONG_CONSTANT("DNS_HINFO", PHP_DNS_HINFO, CONST_PERSISTENT); | ||
#endif | ||
#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))) |
There was a problem hiding this comment.
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.
ea3af1b
to
ff133a2
Compare
If there are no objections in the next few days I plan to merge this (cc @kocsismate if you wanted to take a look) |
There was a problem hiding this 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.
14b7352
to
b8cb368
Compare
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.