ZEND_API void zend_error(int type, const char *format, ...)
{
va_list args;
+ va_list usr_copy;
zval ***params;
zval *retval;
zval *z_error_type, *z_error_message, *z_error_filename, *z_error_lineno, *z_context;
ALLOC_INIT_ZVAL(z_error_lineno);
ALLOC_INIT_ZVAL(z_context);
- z_error_message->value.str.len = zend_vspprintf(&z_error_message->value.str.val, 0, format, args);
+#if defined(va_copy)
+ va_copy(usr_copy, args);
+#else
+ usr_copy = args;
+#endif
+ z_error_message->value.str.len = zend_vspprintf(&z_error_message->value.str.val, 0, format, usr_copy);
+#if defined(va_copy)
+ va_end(usr_copy);
+#endif
z_error_message->type = IS_STRING;
z_error_type->value.lval = type;