@@ -114,21 +114,18 @@ BEGIN {
114
114
argnames[ num_funcs,args_max] = arg_name
115
115
116
116
args_max++
117
- spec_str = spec_str spec_map[ arg_type]
118
117
if (optional) {
119
- optionals [ num_funcs,i ] = optional
120
- if (arg_type != " resource " ) {
121
- useswitch [ num_funcs ] = 1
118
+ if ( ! spec_opt) {
119
+ spec_str = spec_str " | "
120
+ spec_opt = 1
122
121
}
122
+ optionals[ num_funcs,i] = optional
123
123
} else {
124
- args_min++
124
+ args_min++
125
125
}
126
+ spec_str = spec_str spec_map[ arg_type]
126
127
127
128
if (x = gobble(" \\ [" )) {
128
- if (! spec_opt) {
129
- spec_str = spec_str " |"
130
- spec_opt = 1
131
- }
132
129
optional++
133
130
}
134
131
@@ -180,13 +177,17 @@ END {
180
177
" <funcprototype>\n " \
181
178
" <funcdef>" types[ i] " <function>" funcs[ i] " </function></funcdef>\n "
182
179
183
- fetchargs = " \t if (zend_parse_parameters(ZEND_NUM_ARGS(), " specs[ i] " , "
180
+ fetchargs = " \t if (zend_parse_parameters("
181
+ if (spec_opt) {
182
+ ints = ints " \t int argc = ZEND_NUM_ARGS();\n "
183
+ fetchargs = fetchargs " argc"
184
+ } else
185
+ fetchargs = fetchargs " ZEND_NUM_ARGS()"
186
+ fetchargs = fetchargs " , " specs[ i]
184
187
185
188
for (j = 0 ; j < maxargs[ i] ; j++ ) {
186
189
187
- if (j) {
188
- fetchargs = fetchargs " , "
189
- }
190
+ fetchargs = fetchargs " , "
190
191
191
192
fetchargs = fetchargs " &" argnames[ i,j]
192
193
if (argtypes[ i,j] == " string" ) {
0 commit comments