Skip to content

Commit 28c7df4

Browse files
committed
Fix windows compile error
1 parent 7385027 commit 28c7df4

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

main/php_variables.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,13 @@ SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler)
416416
zend_long post_max_size = SG(post_max_size);
417417
bool throw_exceptions = SG(request_parse_body_context).throw_exceptions;
418418

419-
#define EMIT_WARNING_OR_ERROR(...) \
420-
(throw_exceptions \
421-
? zend_throw_exception_ex(NULL, 0, __VA_ARGS__) \
422-
: sapi_module.sapi_error(E_WARNING, __VA_ARGS__))
419+
#define EMIT_WARNING_OR_ERROR(...) do { \
420+
if (throw_exceptions) { \
421+
zend_throw_exception_ex(NULL, 0, __VA_ARGS__); \
422+
} else { \
423+
sapi_module.sapi_error(E_WARNING, __VA_ARGS__); \
424+
} \
425+
} while (0)
423426

424427
memset(&post_data, 0, sizeof(post_data));
425428

main/rfc1867.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -682,10 +682,13 @@ static void rfc1867_post_handler_ex(char *content_type_dup, zval *arg)
682682
php_rfc1867_basename_t _basename;
683683
zend_long count = 0;
684684

685-
#define EMIT_WARNING_OR_ERROR(...) \
686-
(throw_exceptions \
687-
? zend_throw_exception_ex(NULL, 0, __VA_ARGS__) \
688-
: sapi_module.sapi_error(E_WARNING, __VA_ARGS__))
685+
#define EMIT_WARNING_OR_ERROR(...) do { \
686+
if (throw_exceptions) { \
687+
zend_throw_exception_ex(NULL, 0, __VA_ARGS__); \
688+
} else { \
689+
sapi_module.sapi_error(E_WARNING, __VA_ARGS__); \
690+
} \
691+
} while (0)
689692

690693
if (php_rfc1867_encoding_translation() && internal_encoding) {
691694
getword = php_rfc1867_getword;

0 commit comments

Comments
 (0)