Skip to content

Commit 67135cb

Browse files
authored
gen_stub: Conditionally include zend_attributes.h to arginfo based on usage (#21570)
Headers required by the generated code (zend_attributes.h, zend_constants.h, zend_enum.h) are collected during generation and emitted as includes at the top of the arginfo file, with the same preprocessor conditions and PHP version guards as the code that needs them. Removes the manual zend_attributes.h and zend_enum.h includes from sources that only needed them for the arginfo file they include.
1 parent 0a42300 commit 67135cb

105 files changed

Lines changed: 300 additions & 54 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Zend/zend_attributes_arginfo.h

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Zend/zend_builtin_functions_arginfo.h

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Zend/zend_constants_arginfo.h

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/gen_stub.php

Lines changed: 103 additions & 21 deletions
Large diffs are not rendered by default.

ext/calendar/calendar_arginfo.h

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/com_dotnet/com_extension_arginfo.h

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/curl/curl_arginfo.h

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/curl/interface.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
4545
#endif
4646

47-
#include "zend_attributes.h"
4847
#include "curl_arginfo.h"
4948

5049
ZEND_DECLARE_MODULE_GLOBALS(curl)

ext/date/php_date.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "ext/standard/php_versioning.h"
2020
#include "php_date.h"
2121
#include "php_time.h"
22-
#include "zend_attributes.h"
2322
#include "zend_interfaces.h"
2423
#include "zend_exceptions.h"
2524
#include "lib/timelib.h"

ext/date/php_date_arginfo.h

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)