From 498286b7af4e2d9409e38bebb50bc95ced8e1829 Mon Sep 17 00:00:00 2001 From: macintoshplus <814683+macintoshplus@users.noreply.github.com> Date: Tue, 24 Feb 2026 23:35:48 +0100 Subject: [PATCH] :construction_worker: fix Windows test 041 fail --- rarentry.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rarentry.c b/rarentry.c index cb5bdaa..d5f6e7c 100644 --- a/rarentry.c +++ b/rarentry.c @@ -65,7 +65,11 @@ void _rar_entry_to_zval(zval *parent, char *filename; int filename_size, filename_len; +#if PHP_MAJOR_VERSION >= 7 + zend_long unp_size; /* zval stores PHP ints as zend_long, so use that here */ +#else long unp_size; /* zval stores PHP ints as long, so use that here */ +#endif zval *parent_copy = parent; #if PHP_MAJOR_VERSION < 7 /* allocate zval on the heap */ @@ -85,7 +89,9 @@ void _rar_entry_to_zval(zval *parent, zend_update_property(rar_class_entry_ptr, obj, "rarfile", sizeof("rararch") - 1, parent_copy TSRMLS_CC); -#if ULONG_MAX > 0xffffffffUL +#if PHP_MAJOR_VERSION >= 7 && ZEND_ENABLE_ZVAL_LONG64 + unp_size = ((zend_long) entry->UnpSize) + (((zend_long) entry->UnpSizeHigh) << 32); +#elif PHP_MAJOR_VERSION < 7 && ULONG_MAX > 0xffffffffUL unp_size = ((long) entry->UnpSize) + (((long) entry->UnpSizeHigh) << 32); #else /* for 32-bit long, at least don't give negative values */