]> Savannah Git Hosting - gnulib.git/commitdiff
count-one-bits: Assume that the compiler supports 'long long'.
authorBruno Haible <bruno@clisp.org>
Sun, 22 Dec 2019 08:34:06 +0000 (09:34 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 22 Dec 2019 08:34:06 +0000 (09:34 +0100)
* lib/count-one-bits.h (count_one_bits_ll): Define unconditionally.
* m4/count-one-bits.m4: Remove file.
* modules/count-one-bits (Files): Remove it.
(configure.ac): Don't invoke gl_COUNT_ONE_BITS.
* tests/test-count-one-bits.c (main): Test count_one_bits_ll
unconditionally.

ChangeLog
lib/count-one-bits.h
m4/count-one-bits.m4 [deleted file]
modules/count-one-bits
tests/test-count-one-bits.c

index e68cfa15df5a4acee144db9ddf471c2c061232a6..81eb5e6edbff4baf5a9001990a52febc694fbef5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2019-12-22  Bruno Haible  <bruno@clisp.org>
 
+       count-one-bits: Assume that the compiler supports 'long long'.
+       * lib/count-one-bits.h (count_one_bits_ll): Define unconditionally.
+       * m4/count-one-bits.m4: Remove file.
+       * modules/count-one-bits (Files): Remove it.
+       (configure.ac): Don't invoke gl_COUNT_ONE_BITS.
+       * tests/test-count-one-bits.c (main): Test count_one_bits_ll
+       unconditionally.
+
        count-trailing-zeros: Assume that the compiler supports 'long long'.
        * lib/count-trailing-zeros.h (count_trailing_zeros_ll): Define
        unconditionally.
index 00569941885d544c2faf8edd96181b47f181bead..440d1aa38a448ce7ebf77cc2f554338f3599be7a 100644 (file)
@@ -122,14 +122,12 @@ count_one_bits_l (unsigned long int x)
   COUNT_ONE_BITS (__builtin_popcountl, __popcnt, unsigned long int);
 }
 
-#if HAVE_UNSIGNED_LONG_LONG_INT
 /* Compute and return the number of 1-bits set in X. */
 COUNT_ONE_BITS_INLINE int
 count_one_bits_ll (unsigned long long int x)
 {
   COUNT_ONE_BITS (__builtin_popcountll, __popcnt64, unsigned long long int);
 }
-#endif
 
 _GL_INLINE_HEADER_END
 
diff --git a/m4/count-one-bits.m4 b/m4/count-one-bits.m4
deleted file mode 100644 (file)
index b4721b5..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# count-one-bits.m4 serial 3
-dnl Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_COUNT_ONE_BITS],
-[
-  dnl We don't need (and can't compile) count_one_bits_ll
-  dnl unless the type 'unsigned long long int' exists.
-  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
-])
index 7bb18bd7602594dd330a83ff7e74b1ad828c3ab7..ddceacda4bcf727ab15c83fdb37cb9ee30c2d07b 100644 (file)
@@ -4,13 +4,11 @@ Counts the number of 1-bits in a word.
 Files:
 lib/count-one-bits.c
 lib/count-one-bits.h
-m4/count-one-bits.m4
 
 Depends-on:
 extern-inline
 
 configure.ac:
-gl_COUNT_ONE_BITS
 
 Makefile.am:
 lib_SOURCES += count-one-bits.c
index 852e1d62696b5a8d29ae524986bcabd5b2d970a4..d12838f0ed0c99ac57f6a1e50711157635cc6594 100644 (file)
@@ -66,10 +66,8 @@ main (int argc, char *argv[])
   TEST_COUNT_ONE_BITS (count_one_bits, unsigned int, UINT_BIT, UINT_MAX, 1U);
   TEST_COUNT_ONE_BITS (count_one_bits_l, unsigned long int,
                        ULONG_BIT, ULONG_MAX, 1UL);
-#ifdef HAVE_UNSIGNED_LONG_LONG_INT
-  TEST_COUNT_ONE_BITS (count_one_bits_ll,
-                       unsigned long long int, ULLONG_BIT, ULLONG_MAX, 1ULL);
-#endif
+  TEST_COUNT_ONE_BITS (count_one_bits_ll, unsigned long long int,
+                       ULLONG_BIT, ULLONG_MAX, 1ULL);
 
   return 0;
 }