File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4553,7 +4553,7 @@ public function generateCDeclarations(): string {
45534553 return $ code ;
45544554 }
45554555
4556-
4556+
45574557 /**
45584558 * @param array<string, ConstInfo> $allConstInfos
45594559 * @return array{string, string}
@@ -4669,9 +4669,12 @@ function (FuncInfo $funcInfo) use (&$generatedFunctionDeclarations) {
46694669 . "#endif /* {$ headerName } */ \n" ;
46704670 }
46714671
4672+ $ shouldIncludeAttributes = preg_match ('/zend_add_(class|function|parameter|property|class_constant|global_constant)_attribute\(/ ' , $ code );
4673+
46724674 $ code = "/* This is a generated file, edit {$ stubFilenameWithoutExtension }.stub.php instead. \n"
46734675 . " * Stub hash: $ stubHash "
46744676 . ($ hasDeclFile ? "\n * Has decl header: yes */ \n" : " */ \n" )
4677+ . ($ shouldIncludeAttributes ? "\n#include \"zend_attributes.h \"\n" : "" )
46754678 . $ code ;
46764679
46774680 return [$ code , $ declCode ];
You can’t perform that action at this time.
0 commit comments