git: bd953a6026fc - main - libutil: Fix 32-bit build

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Thu, 07 Aug 2025 09:34:44 UTC
The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=bd953a6026fce63b0a76a01da1812e51f630f797

commit bd953a6026fce63b0a76a01da1812e51f630f797
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2025-08-07 09:31:25 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2025-08-07 09:34:13 +0000

    libutil: Fix 32-bit build
    
    In the expand_generic test case for expand_number(), leave out size_t
    if it's not 64 bits wide.
    
    Fixes:          ab1c6874e500
---
 lib/libutil/tests/expand_number_test.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/libutil/tests/expand_number_test.c b/lib/libutil/tests/expand_number_test.c
index 8ff56e1ed01f..9bd339298575 100644
--- a/lib/libutil/tests/expand_number_test.c
+++ b/lib/libutil/tests/expand_number_test.c
@@ -251,7 +251,9 @@ ATF_TC_BODY(expand_generic, tp)
 {
 	uint64_t uint64;
 	int64_t int64;
+#ifdef __LP64__
 	size_t size;
+#endif
 	off_t off;
 
 	ATF_REQUIRE_EQ(0, expand_number("18446744073709551615", &uint64));
@@ -266,10 +268,12 @@ ATF_TC_BODY(expand_generic, tp)
 	ATF_REQUIRE_EQ(0, expand_number("-9223372036854775808", &int64));
 	ATF_REQUIRE_EQ(INT64_MIN, int64);
 
+#ifdef __LP64__
 	ATF_REQUIRE_EQ(0, expand_number("18446744073709551615", &size));
 	ATF_REQUIRE_EQ(UINT64_MAX, size);
 	ATF_REQUIRE_EQ(-1, expand_number("-1", &size));
 	ATF_REQUIRE_EQ(ERANGE, errno);
+#endif
 
 	ATF_REQUIRE_EQ(0, expand_number("9223372036854775807", &off));
 	ATF_REQUIRE_EQ(INT64_MAX, off);