summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-12-22 09:33:17 +0100
committerBruno Haible <bruno@clisp.org>2019-12-22 09:33:42 +0100
commit00b4820cc972dd38f6251a21d255ee63419a1d45 (patch)
tree9be4e99f6a953ba241c1ebff5095f390988fad12
parent0dfa3015c0cf4bb2fb21a06781dc4b5b326a855d (diff)
downloadgnulib-00b4820cc972dd38f6251a21d255ee63419a1d45.tar.gz
count-trailing-zeros: Assume that the compiler supports 'long long'.
* lib/count-trailing-zeros.h (count_trailing_zeros_ll): Define unconditionally. * m4/count-trailing-zeros.m4: Remove file. * modules/count-trailing-zeros (Files): Remove it. (configure.ac): Don't invoke gl_COUNT_TRAILING_ZEROS. * tests/test-count-trailing-zeros.c (main): Test count_trailing_zeros_ll unconditionally.
-rw-r--r--ChangeLog9
-rw-r--r--lib/count-trailing-zeros.h2
-rw-r--r--m4/count-trailing-zeros.m412
-rw-r--r--modules/count-trailing-zeros2
-rw-r--r--tests/test-count-trailing-zeros.c2
5 files changed, 9 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 3e772e4f12..e68cfa15df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2019-12-22 Bruno Haible <bruno@clisp.org>
+ count-trailing-zeros: Assume that the compiler supports 'long long'.
+ * lib/count-trailing-zeros.h (count_trailing_zeros_ll): Define
+ unconditionally.
+ * m4/count-trailing-zeros.m4: Remove file.
+ * modules/count-trailing-zeros (Files): Remove it.
+ (configure.ac): Don't invoke gl_COUNT_TRAILING_ZEROS.
+ * tests/test-count-trailing-zeros.c (main): Test count_trailing_zeros_ll
+ unconditionally.
+
count-leading-zeros: Assume that the compiler supports 'long long'.
* lib/count-leading-zeros.h (count_leading_zeros_ll): Define
unconditionally.
diff --git a/lib/count-trailing-zeros.h b/lib/count-trailing-zeros.h
index 7988e4bff4..d481acaebf 100644
--- a/lib/count-trailing-zeros.h
+++ b/lib/count-trailing-zeros.h
@@ -92,7 +92,6 @@ count_trailing_zeros_l (unsigned long int x)
COUNT_TRAILING_ZEROS (__builtin_ctzl, _BitScanForward, unsigned long int);
}
-#if HAVE_UNSIGNED_LONG_LONG_INT
/* Compute and return the number of trailing zeros in X. */
COUNT_TRAILING_ZEROS_INLINE int
count_trailing_zeros_ll (unsigned long long int x)
@@ -100,7 +99,6 @@ count_trailing_zeros_ll (unsigned long long int x)
COUNT_TRAILING_ZEROS (__builtin_ctzll, _BitScanForward64,
unsigned long long int);
}
-#endif
_GL_INLINE_HEADER_END
diff --git a/m4/count-trailing-zeros.m4 b/m4/count-trailing-zeros.m4
deleted file mode 100644
index 94a8f7f2e1..0000000000
--- a/m4/count-trailing-zeros.m4
+++ /dev/null
@@ -1,12 +0,0 @@
-# count-trailing-zeros.m4
-dnl Copyright (C) 2013-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_TRAILING_ZEROS],
-[
- dnl We don't need (and can't compile) count_trailing_zeros_ll
- dnl unless the type 'unsigned long long int' exists.
- AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
-])
diff --git a/modules/count-trailing-zeros b/modules/count-trailing-zeros
index 841cfda583..daf24a05a8 100644
--- a/modules/count-trailing-zeros
+++ b/modules/count-trailing-zeros
@@ -4,13 +4,11 @@ Counts the number of trailing 0-bits in a word.
Files:
lib/count-trailing-zeros.c
lib/count-trailing-zeros.h
-m4/count-trailing-zeros.m4
Depends-on:
extern-inline
configure.ac:
-gl_COUNT_TRAILING_ZEROS
Makefile.am:
lib_SOURCES += count-trailing-zeros.c
diff --git a/tests/test-count-trailing-zeros.c b/tests/test-count-trailing-zeros.c
index 04d9ddca12..adb795adf7 100644
--- a/tests/test-count-trailing-zeros.c
+++ b/tests/test-count-trailing-zeros.c
@@ -68,10 +68,8 @@ main (int argc, char *argv[])
UINT_BIT, UINT_MAX, 1U);
TEST_COUNT_TRAILING_ZEROS (count_trailing_zeros_l, unsigned long int,
ULONG_BIT, ULONG_MAX, 1UL);
-#ifdef HAVE_UNSIGNED_LONG_LONG_INT
TEST_COUNT_TRAILING_ZEROS (count_trailing_zeros_ll, unsigned long long int,
ULLONG_BIT, ULLONG_MAX, 1ULL);
-#endif
return 0;
}