From: Bruno Haible Date: Mon, 16 Sep 2024 23:44:51 +0000 (+0200) Subject: stdc_count_ones: Fix compilation error with g++ < 4.4. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=4d57a8df99bc20ed6155c8cbd307c7c5245093b0;p=gnulib.git stdc_count_ones: Fix compilation error with g++ < 4.4. * lib/stdbit.in.h (__gl_stdbit_popcount_wide): Suffix 64-bit integer constant with LL. --- diff --git a/ChangeLog b/ChangeLog index be79b9228e..3551ae92de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-09-16 Bruno Haible + + stdc_count_ones: Fix compilation error with g++ < 4.4. + * lib/stdbit.in.h (__gl_stdbit_popcount_wide): Suffix 64-bit integer + constant with LL. + 2024-09-16 Bruno Haible faccessat: Correct errno value on AIX. diff --git a/lib/stdbit.in.h b/lib/stdbit.in.h index 9f9e60a5d3..20b9f4f466 100644 --- a/lib/stdbit.in.h +++ b/lib/stdbit.in.h @@ -308,7 +308,7 @@ __gl_stdbit_popcount_wide (unsigned long long int n) x333333 = max / (1 << 2 | 1), /* 0x333333... */ x0f0f0f = max / (1 << 4 | 1), /* 0x0f0f0f... */ x010101 = max / ((1 << 8) - 1), /* 0x010101... */ - x000_7f = max / 0xffffffffffffffff * 0x7f; /* 0x000000000000007f... */ + x000_7f = max / 0xffffffffffffffffLL * 0x7f; /* 0x000000000000007f... */ n -= (n >> 1) & x555555; n = (n & x333333) + ((n >> 2) & x333333); n = (n + (n >> 4)) & x0f0f0f;