Skip to content

Commit 5606fd6

Browse files
committed
Fix errors in new PHONGO_PARSE_PARAMETERS macros
1 parent 8eb4a30 commit 5606fd6

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

phongo_compat.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,16 @@
179179
&error_handling); \
180180
ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
181181

182-
#define PHONGO_PARSE_PARAMETERS_END \
182+
#define PHONGO_PARSE_PARAMETERS_END() \
183183
ZEND_PARSE_PARAMETERS_END_EX( \
184184
zend_restore_error_handling(&error_handling); \
185185
return ); \
186+
zend_restore_error_handling(&error_handling); \
186187
} \
187188
while (0)
188189

189190
#ifndef ZEND_PARSE_PARAMETERS_NONE
190-
#define PHONGO_PARSE_PARAMETERS_NONE \
191+
#define PHONGO_PARSE_PARAMETERS_NONE() \
191192
do { \
192193
zend_error_handling error_handling; \
193194
zend_replace_error_handling( \
@@ -201,7 +202,7 @@
201202
zend_restore_error_handling(&error_handling); \
202203
} while (0)
203204
#else
204-
#define PHONGO_PARSE_PARAMETERS_NONE \
205+
#define PHONGO_PARSE_PARAMETERS_NONE() \
205206
do { \
206207
zend_error_handling error_handling; \
207208
zend_replace_error_handling( \
@@ -213,6 +214,7 @@
213214
zend_restore_error_handling(&error_handling); \
214215
return; \
215216
} \
217+
zend_restore_error_handling(&error_handling); \
216218
} while (0)
217219
#endif
218220

src/MongoDB/ServerApi.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static PHP_METHOD(ServerApi, __construct)
111111
Z_PARAM_OPTIONAL
112112
Z_PARAM_BOOL_EX(strict, strict_null, 1, 0)
113113
Z_PARAM_BOOL_EX(deprecation_errors, deprecation_errors_null, 1, 0)
114-
PHONGO_PARSE_PARAMETERS_END;
114+
PHONGO_PARSE_PARAMETERS_END();
115115

116116
// Will throw on failure
117117
php_phongo_serverapi_create_libmongoc_object(
@@ -133,7 +133,7 @@ static PHP_METHOD(ServerApi, __set_state)
133133

134134
PHONGO_PARSE_PARAMETERS_START(1, 1)
135135
Z_PARAM_ARRAY(array)
136-
PHONGO_PARSE_PARAMETERS_END;
136+
PHONGO_PARSE_PARAMETERS_END();
137137

138138
object_init_ex(return_value, php_phongo_serverapi_ce);
139139

@@ -186,7 +186,7 @@ static HashTable* php_phongo_serverapi_get_properties_hash(phongo_compat_object_
186186
*/
187187
static PHP_METHOD(ServerApi, bsonSerialize)
188188
{
189-
PHONGO_PARSE_PARAMETERS_NONE;
189+
PHONGO_PARSE_PARAMETERS_NONE();
190190

191191
ZVAL_ARR(return_value, php_phongo_serverapi_get_properties_hash(PHONGO_COMPAT_OBJ_P(getThis()), true, false));
192192
convert_to_object(return_value);
@@ -203,7 +203,7 @@ static PHP_METHOD(ServerApi, serialize)
203203

204204
intern = Z_SERVERAPI_OBJ_P(getThis());
205205

206-
PHONGO_PARSE_PARAMETERS_NONE;
206+
PHONGO_PARSE_PARAMETERS_NONE();
207207

208208
array_init_size(&retval, 3);
209209

@@ -246,7 +246,7 @@ static PHP_METHOD(ServerApi, unserialize)
246246

247247
PHONGO_PARSE_PARAMETERS_START(1, 1)
248248
Z_PARAM_STRING(serialized, serialized_len)
249-
PHONGO_PARSE_PARAMETERS_END;
249+
PHONGO_PARSE_PARAMETERS_END();
250250

251251
if (!serialized_len) {
252252
return;

0 commit comments

Comments
 (0)