It's now time to assume that all compilers supported by Gnulib support 'long long': - 64-bit platforms are commonplace since 2004 approximately (namely x86_64), - ISO C11 ยง 6.2.5 specifies 'long long int'. - MSVC supports 'long long' since MSVC 14 (2015).
This shouldn't come as a surprise, since I've mentioned this plan already in <https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00141.html>. 2019-12-22 Bruno Haible <[email protected]> longlong: Mark module obsolete. * modules/longlong (Status, Notice): New sections. stdint: Assume that the compiler supports 'long long'. * lib/stdint.in.h (int64_t, uint64_t, intmax_t, uintmax_t, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C): Assume HAVE_LONG_LONG_INT and HAVE_UNSIGNED_LONG_LONG_INT to be 1. * m4/stdint.m4 (gl_STDINT_H): Don't require AC_TYPE_LONG_LONG_INT, AC_TYPE_UNSIGNED_LONG_LONG_INT. * modules/stdint (Files): Remove longlong.m4. (Makefile.am): Don't substitute HAVE_LONG_LONG_INT, HAVE_UNSIGNED_LONG_LONG_INT. inttypes-incomplete: Assume that the compiler supports 'long long'. * lib/inttypes.in.h (_PRI64_PREFIX, _PRIu64_PREFIX, _SCN64_PREFIX, _SCNu64_PREFIX): Assume HAVE_LONG_LONG_INT and HAVE_UNSIGNED_LONG_LONG_INT to be 1. * m4/inttypes.m4 (gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION): Assume HAVE_LONG_LONG_INT to be 1. * modules/inttypes-incomplete (Makefile.am): Don't substitute HAVE_LONG_LONG_INT, HAVE_UNSIGNED_LONG_LONG_INT. malloca: Assume that the compiler supports 'long long'. * lib/malloca.h: Assume HAVE_LONG_LONG_INT to be 1. * m4/malloca.m4 (gl_MALLOCA): Don't require AC_TYPE_LONG_LONG_INT. * modules/malloca (Files): Remove longlong.m4. * modules/relocatable-prog-wrapper (Files): Likewise. atoll: Assume that the compiler supports 'long long'. * m4/atoll.m4 (gl_FUNC_ATOLL): Don't require AC_TYPE_LONG_LONG_INT. * modules/atoll (Files): Remove longlong.m4. strtoll: Assume that the compiler supports 'long long'. * m4/strtoll.m4 (gl_FUNC_STRTOLL): Don't require AC_TYPE_LONG_LONG_INT. * modules/strtoll (Files): Remove longlong.m4. strtoull: Assume that the compiler supports 'long long'. * m4/strtoull.m4 (gl_FUNC_STRTOULL): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. * modules/strtoull (Files): Remove longlong.m4. strtoimax, strtoumax: Assume that the compiler supports 'long long'. * lib/strtoimax.c: Assume HAVE_LONG_LONG_INT and HAVE_UNSIGNED_LONG_LONG_INT to be 1. * m4/strtoimax.m4 (gl_PREREQ_STRTOIMAX): Don't require AC_TYPE_LONG_LONG_INT. * m4/strtoumax.m4 (gl_PREREQ_STRTOUMAX): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. * modules/strtoimax (Files): Remove longlong.m4. * modules/strtoumax (Files): Likewise. xstrtoll: Assume that the compiler supports 'long long'. * lib/xstrtol.h (xstrtoll, xstrtoull): Declare unconditionally. * modules/xstrtoll (configure.ac): Don't invoke AC_TYPE_LONG_LONG_INT. vasnprintf: Assume that the compiler supports 'long long'. * lib/printf-args.h: Assume HAVE_LONG_LONG_INT to be 1. * lib/printf-args.c (PRINTF_FETCHARGS): Likewise. * lib/printf-parse.c (PRINTF_PARSE): Likewise. * lib/vasnprintf.c (MAX_ROOM_NEEDED, VASNPRINTF): Likewise. * m4/intmax_t.m4 (gl_AC_TYPE_INTMAX_T, gt_AC_TYPE_INTMAX_T): Don't require AC_TYPE_LONG_LONG_INT. * m4/vasnprintf.m4 (gl_PREREQ_PRINTF_ARGS, gl_PREREQ_PRINTF_PARSE, gl_PREREQ_VASNPRINTF): Likewise. * modules/vasnprintf (Files): Remove longlong.m4. * modules/c-vasnprintf (Files): Likewise. * modules/unistdio/u8-vasnprintf (Files): Likewise. * modules/unistdio/u8-u8-vasnprintf (Files): Likewise. * modules/unistdio/u16-vasnprintf (Files): Likewise. * modules/unistdio/u16-u16-vasnprintf (Files): Likewise. * modules/unistdio/u32-vasnprintf (Files): Likewise. * modules/unistdio/u32-u32-vasnprintf (Files): Likewise. * modules/unistdio/ulc-vasnprintf (Files): Likewise. gethrxtime: Assume that the compiler supports 'long long'. * lib/xtime.h (xtime_t): Define to 'long long int' always. (XTIME_PRECISION): Define to 1000000000 always. (xtime_make, xtime_sec): Optimize accordingly. * m4/gethrxtime.m4 (gl_XTIME): Don't require AC_TYPE_LONG_LONG_INT. * modules/gethrxtime (Files): Remove longlong.m4. integer_length*: Assume that the compiler supports 'long long'. * lib/integer_length.h (integer_length_ll): Declare unconditionally. * modules/integer_length (Files): Remove longlong.m4. (configure.ac): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. * modules/integer_length_l (Files): Remove longlong.m4. (configure.ac): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. * modules/integer_length_ll (Files): Remove longlong.m4. (configure.ac): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. 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. * 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. * m4/count-leading-zeros.m4: Remove file. * modules/count-leading-zeros (Files): Remove it. (configure.ac): Don't invoke gl_COUNT_LEADING_ZEROS. * tests/test-count-leading-zeros.c (main): Test count_leading_zeros_ll unconditionally.
>From 0dfa3015c0cf4bb2fb21a06781dc4b5b326a855d Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 09:32:07 +0100 Subject: [PATCH 01/15] count-leading-zeros: Assume that the compiler supports 'long long'. * lib/count-leading-zeros.h (count_leading_zeros_ll): Define unconditionally. * m4/count-leading-zeros.m4: Remove file. * modules/count-leading-zeros (Files): Remove it. (configure.ac): Don't invoke gl_COUNT_LEADING_ZEROS. * tests/test-count-leading-zeros.c (main): Test count_leading_zeros_ll unconditionally. --- ChangeLog | 11 +++++++++++ lib/count-leading-zeros.h | 2 -- m4/count-leading-zeros.m4 | 12 ------------ modules/count-leading-zeros | 2 -- tests/test-count-leading-zeros.c | 2 -- 5 files changed, 11 insertions(+), 18 deletions(-) delete mode 100644 m4/count-leading-zeros.m4 diff --git a/ChangeLog b/ChangeLog index 5ac5ee6..3e772e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2019-12-22 Bruno Haible <[email protected]> + count-leading-zeros: Assume that the compiler supports 'long long'. + * lib/count-leading-zeros.h (count_leading_zeros_ll): Define + unconditionally. + * m4/count-leading-zeros.m4: Remove file. + * modules/count-leading-zeros (Files): Remove it. + (configure.ac): Don't invoke gl_COUNT_LEADING_ZEROS. + * tests/test-count-leading-zeros.c (main): Test count_leading_zeros_ll + unconditionally. + +2019-12-22 Bruno Haible <[email protected]> + localcharset: Update support for OpenBSD. * lib/localcharset.c (alias_table): Map "US-ASCII" to "ASCII". diff --git a/lib/count-leading-zeros.h b/lib/count-leading-zeros.h index cf867ac..ba573ca 100644 --- a/lib/count-leading-zeros.h +++ b/lib/count-leading-zeros.h @@ -100,7 +100,6 @@ count_leading_zeros_l (unsigned long int x) COUNT_LEADING_ZEROS (__builtin_clzl, _BitScanReverse, unsigned long int); } -#if HAVE_UNSIGNED_LONG_LONG_INT /* Compute and return the number of leading zeros in X. */ COUNT_LEADING_ZEROS_INLINE int count_leading_zeros_ll (unsigned long long int x) @@ -108,7 +107,6 @@ count_leading_zeros_ll (unsigned long long int x) COUNT_LEADING_ZEROS (__builtin_clzll, _BitScanReverse64, unsigned long long int); } -#endif _GL_INLINE_HEADER_END diff --git a/m4/count-leading-zeros.m4 b/m4/count-leading-zeros.m4 deleted file mode 100644 index efe31f9..0000000 --- a/m4/count-leading-zeros.m4 +++ /dev/null @@ -1,12 +0,0 @@ -# count-leading-zeros.m4 serial 2 -dnl Copyright (C) 2012-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_LEADING_ZEROS], -[ - dnl We don't need (and can't compile) count_leading_zeros_ll - dnl unless the type 'unsigned long long int' exists. - AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) -]) diff --git a/modules/count-leading-zeros b/modules/count-leading-zeros index f6ec283..09a910d 100644 --- a/modules/count-leading-zeros +++ b/modules/count-leading-zeros @@ -4,14 +4,12 @@ Counts the number of leading 0-bits in a word. Files: lib/count-leading-zeros.c lib/count-leading-zeros.h -m4/count-leading-zeros.m4 Depends-on: extern-inline verify configure.ac: -gl_COUNT_LEADING_ZEROS Makefile.am: lib_SOURCES += count-leading-zeros.c diff --git a/tests/test-count-leading-zeros.c b/tests/test-count-leading-zeros.c index e94e37e..76f6f96 100644 --- a/tests/test-count-leading-zeros.c +++ b/tests/test-count-leading-zeros.c @@ -68,10 +68,8 @@ main (int argc, char *argv[]) UINT_BIT, UINT_MAX, 1U); TEST_COUNT_LEADING_ZEROS (count_leading_zeros_l, unsigned long int, ULONG_BIT, ULONG_MAX, 1UL); -#ifdef HAVE_UNSIGNED_LONG_LONG_INT TEST_COUNT_LEADING_ZEROS (count_leading_zeros_ll, unsigned long long int, ULLONG_BIT, ULLONG_MAX, 1ULL); -#endif return 0; } -- 2.7.4
>From 00b4820cc972dd38f6251a21d255ee63419a1d45 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 09:33:17 +0100 Subject: [PATCH 02/15] 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. --- ChangeLog | 9 +++++++++ lib/count-trailing-zeros.h | 2 -- m4/count-trailing-zeros.m4 | 12 ------------ modules/count-trailing-zeros | 2 -- tests/test-count-trailing-zeros.c | 2 -- 5 files changed, 9 insertions(+), 18 deletions(-) delete mode 100644 m4/count-trailing-zeros.m4 diff --git a/ChangeLog b/ChangeLog index 3e772e4..e68cfa1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2019-12-22 Bruno Haible <[email protected]> + 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 7988e4b..d481aca 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 94a8f7f..0000000 --- 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 841cfda..daf24a0 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 04d9ddc..adb795a 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; } -- 2.7.4
>From 4069d42575181bd484af4f433c0d0d5358470a80 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 09:34:06 +0100 Subject: [PATCH 03/15] 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. --- ChangeLog | 8 ++++++++ lib/count-one-bits.h | 2 -- m4/count-one-bits.m4 | 12 ------------ modules/count-one-bits | 2 -- tests/test-count-one-bits.c | 6 ++---- 5 files changed, 10 insertions(+), 20 deletions(-) delete mode 100644 m4/count-one-bits.m4 diff --git a/ChangeLog b/ChangeLog index e68cfa1..81eb5e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2019-12-22 Bruno Haible <[email protected]> + 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. diff --git a/lib/count-one-bits.h b/lib/count-one-bits.h index 0056994..440d1aa 100644 --- a/lib/count-one-bits.h +++ b/lib/count-one-bits.h @@ -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 index b4721b5..0000000 --- a/m4/count-one-bits.m4 +++ /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]) -]) diff --git a/modules/count-one-bits b/modules/count-one-bits index 7bb18bd..ddceacd 100644 --- a/modules/count-one-bits +++ b/modules/count-one-bits @@ -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 diff --git a/tests/test-count-one-bits.c b/tests/test-count-one-bits.c index 852e1d6..d12838f 100644 --- a/tests/test-count-one-bits.c +++ b/tests/test-count-one-bits.c @@ -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; } -- 2.7.4
>From 3a5d13f42ba42a4e1625bdbcdd93bd2099c550a0 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 09:43:25 +0100 Subject: [PATCH 04/15] integer_length*: Assume that the compiler supports 'long long'. * lib/integer_length.h (integer_length_ll): Declare unconditionally. * modules/integer_length (Files): Remove longlong.m4. (configure.ac): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. * modules/integer_length_l (Files): Remove longlong.m4. (configure.ac): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. * modules/integer_length_ll (Files): Remove longlong.m4. (configure.ac): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. --- ChangeLog | 9 +++++++++ lib/integer_length.h | 2 -- modules/integer_length | 2 -- modules/integer_length_l | 2 -- modules/integer_length_ll | 2 -- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81eb5e6..0d9c546 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2019-12-22 Bruno Haible <[email protected]> + integer_length*: Assume that the compiler supports 'long long'. + * lib/integer_length.h (integer_length_ll): Declare unconditionally. + * modules/integer_length (Files): Remove longlong.m4. + (configure.ac): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. + * modules/integer_length_l (Files): Remove longlong.m4. + (configure.ac): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. + * modules/integer_length_ll (Files): Remove longlong.m4. + (configure.ac): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. + 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. diff --git a/lib/integer_length.h b/lib/integer_length.h index 4c3b345..f3d06a9 100644 --- a/lib/integer_length.h +++ b/lib/integer_length.h @@ -36,11 +36,9 @@ extern int integer_length (unsigned int x); The result is >= 0, <= sizeof (unsigned long) * CHAR_BIT. */ extern int integer_length_l (unsigned long x); -#if HAVE_UNSIGNED_LONG_LONG_INT /* Returns the integer length of x. The result is >= 0, <= sizeof (unsigned long long) * CHAR_BIT. */ extern int integer_length_ll (unsigned long long x); -#endif #ifdef __cplusplus } diff --git a/modules/integer_length b/modules/integer_length index f37713b..86f257b 100644 --- a/modules/integer_length +++ b/modules/integer_length @@ -5,14 +5,12 @@ Files: lib/integer_length.h lib/integer_length.c lib/float+.h -m4/longlong.m4 m4/exponentd.m4 Depends-on: float configure.ac: -AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) Makefile.am: diff --git a/modules/integer_length_l b/modules/integer_length_l index 768e9fb..59a4b4f 100644 --- a/modules/integer_length_l +++ b/modules/integer_length_l @@ -4,13 +4,11 @@ Finds the most significant bit in an 'unsigned long'. Files: lib/integer_length.h lib/integer_length_l.c -m4/longlong.m4 Depends-on: integer_length configure.ac: -AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) Makefile.am: lib_SOURCES += integer_length_l.c diff --git a/modules/integer_length_ll b/modules/integer_length_ll index 96218cc..eadcbe0 100644 --- a/modules/integer_length_ll +++ b/modules/integer_length_ll @@ -5,13 +5,11 @@ Files: lib/integer_length.h lib/integer_length_ll.c lib/integer_length_l.c -m4/longlong.m4 Depends-on: integer_length configure.ac: -AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) Makefile.am: lib_SOURCES += integer_length_ll.c -- 2.7.4
>From 896daf273035e889c50dc5b33e74b5fb891851bc Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 09:46:46 +0100 Subject: [PATCH 05/15] gethrxtime: Assume that the compiler supports 'long long'. * lib/xtime.h (xtime_t): Define to 'long long int' always. (XTIME_PRECISION): Define to 1000000000 always. (xtime_make, xtime_sec): Optimize accordingly. * m4/gethrxtime.m4 (gl_XTIME): Don't require AC_TYPE_LONG_LONG_INT. * modules/gethrxtime (Files): Remove longlong.m4. --- ChangeLog | 7 +++++++ lib/xtime.h | 25 ++++--------------------- m4/gethrxtime.m4 | 3 +-- modules/gethrxtime | 1 - 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d9c546..57b0036 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2019-12-22 Bruno Haible <[email protected]> + gethrxtime: Assume that the compiler supports 'long long'. + * lib/xtime.h (xtime_t): Define to 'long long int' always. + (XTIME_PRECISION): Define to 1000000000 always. + (xtime_make, xtime_sec): Optimize accordingly. + * m4/gethrxtime.m4 (gl_XTIME): Don't require AC_TYPE_LONG_LONG_INT. + * modules/gethrxtime (Files): Remove longlong.m4. + integer_length*: Assume that the compiler supports 'long long'. * lib/integer_length.h (integer_length_ll): Declare unconditionally. * modules/integer_length (Files): Remove longlong.m4. diff --git a/lib/xtime.h b/lib/xtime.h index 9edd123..77f1c30 100644 --- a/lib/xtime.h +++ b/lib/xtime.h @@ -29,21 +29,9 @@ _GL_INLINE_HEADER_BEGIN #endif /* xtime_t is a signed type used for timestamps. It is an integer - type that is a count of nanoseconds -- except for obsolescent hosts - without sufficiently-wide integers, where it is a count of - seconds. */ -#if HAVE_LONG_LONG_INT + type that is a count of nanoseconds. */ typedef long long int xtime_t; -# define XTIME_PRECISION 1000000000 -#else -# include <limits.h> -typedef long int xtime_t; -# if LONG_MAX >> 31 >> 31 == 0 -# define XTIME_PRECISION 1 -# else -# define XTIME_PRECISION 1000000000 -# endif -#endif +#define XTIME_PRECISION 1000000000 #ifdef __cplusplus extern "C" { @@ -57,10 +45,7 @@ xtime_make (xtime_t s, long int ns) const long int giga = 1000 * 1000 * 1000; s += ns / giga; ns %= giga; - if (XTIME_PRECISION == 1) - return s; - else - return XTIME_PRECISION * s + ns; + return XTIME_PRECISION * s + ns; } /* Return the number of seconds in T, which must be nonnegative. */ @@ -74,9 +59,7 @@ xtime_nonnegative_sec (xtime_t t) XTIME_INLINE xtime_t xtime_sec (xtime_t t) { - return (XTIME_PRECISION == 1 - ? t - : t < 0 + return (t < 0 ? (t + XTIME_PRECISION - 1) / XTIME_PRECISION - 1 : xtime_nonnegative_sec (t)); } diff --git a/m4/gethrxtime.m4 b/m4/gethrxtime.m4 index 6444fad..70439d3 100644 --- a/m4/gethrxtime.m4 +++ b/m4/gethrxtime.m4 @@ -1,4 +1,4 @@ -# gethrxtime.m4 serial 12 +# gethrxtime.m4 serial 13 dnl Copyright (C) 2005-2006, 2008-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, @@ -62,6 +62,5 @@ AC_DEFUN([gl_ARITHMETIC_HRTIME_T], # Prerequisites of lib/xtime.h. AC_DEFUN([gl_XTIME], [ - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) : ]) diff --git a/modules/gethrxtime b/modules/gethrxtime index b728003..b4a715f 100644 --- a/modules/gethrxtime +++ b/modules/gethrxtime @@ -7,7 +7,6 @@ lib/xtime.c lib/gethrxtime.c lib/gethrxtime.h m4/gethrxtime.m4 -m4/longlong.m4 Depends-on: clock-time -- 2.7.4
>From 5ceaccc072d0aa464dbfd611564eb553f0a29dec Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 09:55:04 +0100 Subject: [PATCH 06/15] vasnprintf: Assume that the compiler supports 'long long'. * lib/printf-args.h: Assume HAVE_LONG_LONG_INT to be 1. * lib/printf-args.c (PRINTF_FETCHARGS): Likewise. * lib/printf-parse.c (PRINTF_PARSE): Likewise. * lib/vasnprintf.c (MAX_ROOM_NEEDED, VASNPRINTF): Likewise. * m4/intmax_t.m4 (gl_AC_TYPE_INTMAX_T, gt_AC_TYPE_INTMAX_T): Don't require AC_TYPE_LONG_LONG_INT. * m4/vasnprintf.m4 (gl_PREREQ_PRINTF_ARGS, gl_PREREQ_PRINTF_PARSE, gl_PREREQ_VASNPRINTF): Likewise. * modules/vasnprintf (Files): Remove longlong.m4. * modules/c-vasnprintf (Files): Likewise. * modules/unistdio/u8-vasnprintf (Files): Likewise. * modules/unistdio/u8-u8-vasnprintf (Files): Likewise. * modules/unistdio/u16-vasnprintf (Files): Likewise. * modules/unistdio/u16-u16-vasnprintf (Files): Likewise. * modules/unistdio/u32-vasnprintf (Files): Likewise. * modules/unistdio/u32-u32-vasnprintf (Files): Likewise. * modules/unistdio/ulc-vasnprintf (Files): Likewise. --- ChangeLog | 19 +++++++++++++++++++ lib/printf-args.c | 4 ---- lib/printf-args.h | 12 ++---------- lib/printf-parse.c | 24 +++++++++--------------- lib/vasnprintf.c | 25 +++++-------------------- m4/intmax_t.m4 | 14 +++----------- m4/vasnprintf.m4 | 5 +---- modules/c-vasnprintf | 1 - modules/unistdio/u16-u16-vasnprintf | 1 - modules/unistdio/u16-vasnprintf | 1 - modules/unistdio/u32-u32-vasnprintf | 1 - modules/unistdio/u32-vasnprintf | 1 - modules/unistdio/u8-u8-vasnprintf | 1 - modules/unistdio/u8-vasnprintf | 1 - modules/unistdio/ulc-vasnprintf | 1 - modules/vasnprintf | 1 - 16 files changed, 39 insertions(+), 73 deletions(-) diff --git a/ChangeLog b/ChangeLog index 57b0036..bf96d6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,24 @@ 2019-12-22 Bruno Haible <[email protected]> + vasnprintf: Assume that the compiler supports 'long long'. + * lib/printf-args.h: Assume HAVE_LONG_LONG_INT to be 1. + * lib/printf-args.c (PRINTF_FETCHARGS): Likewise. + * lib/printf-parse.c (PRINTF_PARSE): Likewise. + * lib/vasnprintf.c (MAX_ROOM_NEEDED, VASNPRINTF): Likewise. + * m4/intmax_t.m4 (gl_AC_TYPE_INTMAX_T, gt_AC_TYPE_INTMAX_T): Don't + require AC_TYPE_LONG_LONG_INT. + * m4/vasnprintf.m4 (gl_PREREQ_PRINTF_ARGS, gl_PREREQ_PRINTF_PARSE, + gl_PREREQ_VASNPRINTF): Likewise. + * modules/vasnprintf (Files): Remove longlong.m4. + * modules/c-vasnprintf (Files): Likewise. + * modules/unistdio/u8-vasnprintf (Files): Likewise. + * modules/unistdio/u8-u8-vasnprintf (Files): Likewise. + * modules/unistdio/u16-vasnprintf (Files): Likewise. + * modules/unistdio/u16-u16-vasnprintf (Files): Likewise. + * modules/unistdio/u32-vasnprintf (Files): Likewise. + * modules/unistdio/u32-u32-vasnprintf (Files): Likewise. + * modules/unistdio/ulc-vasnprintf (Files): Likewise. + gethrxtime: Assume that the compiler supports 'long long'. * lib/xtime.h (xtime_t): Define to 'long long int' always. (XTIME_PRECISION): Define to 1000000000 always. diff --git a/lib/printf-args.c b/lib/printf-args.c index c764917..ee50149 100644 --- a/lib/printf-args.c +++ b/lib/printf-args.c @@ -65,14 +65,12 @@ PRINTF_FETCHARGS (va_list args, arguments *a) case TYPE_ULONGINT: ap->a.a_ulongint = va_arg (args, unsigned long int); break; -#if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: ap->a.a_longlongint = va_arg (args, long long int); break; case TYPE_ULONGLONGINT: ap->a.a_ulonglongint = va_arg (args, unsigned long long int); break; -#endif case TYPE_DOUBLE: ap->a.a_double = va_arg (args, double); break; @@ -135,11 +133,9 @@ PRINTF_FETCHARGS (va_list args, arguments *a) case TYPE_COUNT_LONGINT_POINTER: ap->a.a_count_longint_pointer = va_arg (args, long int *); break; -#if HAVE_LONG_LONG_INT case TYPE_COUNT_LONGLONGINT_POINTER: ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); break; -#endif #if ENABLE_UNISTDIO /* The unistdio extensions. */ case TYPE_U8_STRING: diff --git a/lib/printf-args.h b/lib/printf-args.h index 1baa3f3..e87cca8 100644 --- a/lib/printf-args.h +++ b/lib/printf-args.h @@ -57,10 +57,8 @@ typedef enum TYPE_UINT, TYPE_LONGINT, TYPE_ULONGINT, -#if HAVE_LONG_LONG_INT TYPE_LONGLONGINT, TYPE_ULONGLONGINT, -#endif TYPE_DOUBLE, TYPE_LONGDOUBLE, TYPE_CHAR, @@ -75,10 +73,8 @@ typedef enum TYPE_COUNT_SCHAR_POINTER, TYPE_COUNT_SHORT_POINTER, TYPE_COUNT_INT_POINTER, - TYPE_COUNT_LONGINT_POINTER -#if HAVE_LONG_LONG_INT -, TYPE_COUNT_LONGLONGINT_POINTER -#endif + TYPE_COUNT_LONGINT_POINTER, + TYPE_COUNT_LONGLONGINT_POINTER #if ENABLE_UNISTDIO /* The unistdio extensions. */ , TYPE_U8_STRING @@ -101,10 +97,8 @@ typedef struct unsigned int a_uint; long int a_longint; unsigned long int a_ulongint; -#if HAVE_LONG_LONG_INT long long int a_longlongint; unsigned long long int a_ulonglongint; -#endif float a_float; double a_double; long double a_longdouble; @@ -121,9 +115,7 @@ typedef struct short * a_count_short_pointer; int * a_count_int_pointer; long int * a_count_longint_pointer; -#if HAVE_LONG_LONG_INT long long int * a_count_longlongint_pointer; -#endif #if ENABLE_UNISTDIO /* The unistdio extensions. */ const uint8_t * a_u8_string; diff --git a/lib/printf-parse.c b/lib/printf-parse.c index 76a1b48..ba1585a 100644 --- a/lib/printf-parse.c +++ b/lib/printf-parse.c @@ -447,14 +447,12 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) switch (c) { case 'd': case 'i': -#if HAVE_LONG_LONG_INT - /* If 'long long' exists and is larger than 'long': */ + /* If 'long long' is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_LONGLONGINT; else -#endif - /* If 'long long' exists and is the same as 'long', we parse - "lld" into TYPE_LONGINT. */ + /* If 'long long' is the same as 'long', we parse "lld" into + TYPE_LONGINT. */ if (flags >= 8) type = TYPE_LONGINT; else if (flags & 2) @@ -465,14 +463,12 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) type = TYPE_INT; break; case 'o': case 'u': case 'x': case 'X': -#if HAVE_LONG_LONG_INT - /* If 'long long' exists and is larger than 'long': */ + /* If 'unsigned long long' is larger than 'unsigned long': */ if (flags >= 16 || (flags & 4)) type = TYPE_ULONGLONGINT; else -#endif - /* If 'unsigned long long' exists and is the same as - 'unsigned long', we parse "llu" into TYPE_ULONGINT. */ + /* If 'unsigned long long' is the same as 'unsigned long', we + parse "llu" into TYPE_ULONGINT. */ if (flags >= 8) type = TYPE_ULONGINT; else if (flags & 2) @@ -525,14 +521,12 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) type = TYPE_POINTER; break; case 'n': -#if HAVE_LONG_LONG_INT - /* If 'long long' exists and is larger than 'long': */ + /* If 'long long' is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_COUNT_LONGLONGINT_POINTER; else -#endif - /* If 'long long' exists and is the same as 'long', we parse - "lln" into TYPE_COUNT_LONGINT_POINTER. */ + /* If 'long long' is the same as 'long', we parse "lln" into + TYPE_COUNT_LONGINT_POINTER. */ if (flags >= 8) type = TYPE_COUNT_LONGINT_POINTER; else if (flags & 2) diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 1d849ee..e5806f9 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -1553,16 +1553,13 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion, switch (conversion) { case 'd': case 'i': case 'u': -# if HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.30103 /* binary -> decimal */ ) + 1; /* turn floor into ceil */ - else -# endif - if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + else if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.30103 /* binary -> decimal */ @@ -1583,16 +1580,13 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion, break; case 'o': -# if HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1; /* turn floor into ceil */ - else -# endif - if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + else if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.333334 /* binary -> octal */ @@ -1611,16 +1605,13 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion, break; case 'x': case 'X': -# if HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1; /* turn floor into ceil */ - else -# endif - if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + else if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ @@ -1939,11 +1930,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, case TYPE_COUNT_LONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longint_pointer = length; break; -#if HAVE_LONG_LONG_INT case TYPE_COUNT_LONGLONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; break; -#endif default: abort (); } @@ -4835,17 +4824,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, switch (type) { -#if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: case TYPE_ULONGLONGINT: -# if defined _WIN32 && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ *fbp++ = 'I'; *fbp++ = '6'; *fbp++ = '4'; break; -# else +#else *fbp++ = 'l'; -# endif #endif FALLTHROUGH; case TYPE_LONGINT: @@ -5063,7 +5050,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, SNPRINTF_BUF (arg); } break; -#if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: { long long int arg = a.arg[dp->arg_index].a.a_longlongint; @@ -5076,7 +5062,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, SNPRINTF_BUF (arg); } break; -#endif case TYPE_DOUBLE: { double arg = a.arg[dp->arg_index].a.a_double; diff --git a/m4/intmax_t.m4 b/m4/intmax_t.m4 index 5ded16e..7948f0c 100644 --- a/m4/intmax_t.m4 +++ b/m4/intmax_t.m4 @@ -1,4 +1,4 @@ -# intmax_t.m4 serial 8 +# intmax_t.m4 serial 9 dnl Copyright (C) 1997-2004, 2006-2007, 2009-2019 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -19,11 +19,7 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T], AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) - test $ac_cv_type_long_long_int = yes \ - && ac_type='long long' \ - || ac_type='long' - AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], + AC_DEFINE_UNQUOTED([intmax_t], [long long], [Define to long or long long if <inttypes.h> and <stdint.h> don't define.]) else AC_DEFINE([HAVE_INTMAX_T], [1], @@ -57,11 +53,7 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) else - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) - test $ac_cv_type_long_long_int = yes \ - && ac_type='long long' \ - || ac_type='long' - AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], + AC_DEFINE_UNQUOTED([intmax_t], [long long], [Define to long or long long if <stdint.h> and <inttypes.h> don't define.]) fi ]) diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4 index b763a3d..cfae6a4 100644 --- a/m4/vasnprintf.m4 +++ b/m4/vasnprintf.m4 @@ -1,4 +1,4 @@ -# vasnprintf.m4 serial 36 +# vasnprintf.m4 serial 37 dnl Copyright (C) 2002-2004, 2006-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, @@ -32,7 +32,6 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF], # Prerequisites of lib/printf-args.h, lib/printf-args.c. AC_DEFUN([gl_PREREQ_PRINTF_ARGS], [ - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) ]) @@ -41,7 +40,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS], AC_DEFUN([gl_PREREQ_PRINTF_PARSE], [ AC_REQUIRE([gl_FEATURES_H]) - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_REQUIRE([AC_TYPE_SIZE_T]) @@ -56,7 +54,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE], AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], [ AC_REQUIRE([AC_FUNC_ALLOCA]) - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb]) diff --git a/modules/c-vasnprintf b/modules/c-vasnprintf index cd94193..ae51ea9 100644 --- a/modules/c-vasnprintf +++ b/modules/c-vasnprintf @@ -13,7 +13,6 @@ lib/vasnprintf.h lib/vasnprintf.c m4/wchar_t.m4 m4/wint_t.m4 -m4/longlong.m4 m4/intmax_t.m4 m4/stdint_h.m4 m4/inttypes_h.m4 diff --git a/modules/unistdio/u16-u16-vasnprintf b/modules/unistdio/u16-u16-vasnprintf index 6650e95..6997f37 100644 --- a/modules/unistdio/u16-u16-vasnprintf +++ b/modules/unistdio/u16-u16-vasnprintf @@ -9,7 +9,6 @@ m4/printf.m4 m4/math_h.m4 m4/wchar_t.m4 m4/wint_t.m4 -m4/longlong.m4 m4/intmax_t.m4 m4/stdint_h.m4 m4/inttypes_h.m4 diff --git a/modules/unistdio/u16-vasnprintf b/modules/unistdio/u16-vasnprintf index 7eec389..29c82a6 100644 --- a/modules/unistdio/u16-vasnprintf +++ b/modules/unistdio/u16-vasnprintf @@ -9,7 +9,6 @@ m4/printf.m4 m4/math_h.m4 m4/wchar_t.m4 m4/wint_t.m4 -m4/longlong.m4 m4/intmax_t.m4 m4/stdint_h.m4 m4/inttypes_h.m4 diff --git a/modules/unistdio/u32-u32-vasnprintf b/modules/unistdio/u32-u32-vasnprintf index 2c1b796..58f6579 100644 --- a/modules/unistdio/u32-u32-vasnprintf +++ b/modules/unistdio/u32-u32-vasnprintf @@ -9,7 +9,6 @@ m4/printf.m4 m4/math_h.m4 m4/wchar_t.m4 m4/wint_t.m4 -m4/longlong.m4 m4/intmax_t.m4 m4/stdint_h.m4 m4/inttypes_h.m4 diff --git a/modules/unistdio/u32-vasnprintf b/modules/unistdio/u32-vasnprintf index f1edafe..be0c3cd 100644 --- a/modules/unistdio/u32-vasnprintf +++ b/modules/unistdio/u32-vasnprintf @@ -9,7 +9,6 @@ m4/printf.m4 m4/math_h.m4 m4/wchar_t.m4 m4/wint_t.m4 -m4/longlong.m4 m4/intmax_t.m4 m4/stdint_h.m4 m4/inttypes_h.m4 diff --git a/modules/unistdio/u8-u8-vasnprintf b/modules/unistdio/u8-u8-vasnprintf index 364ab43..57ed3fe 100644 --- a/modules/unistdio/u8-u8-vasnprintf +++ b/modules/unistdio/u8-u8-vasnprintf @@ -9,7 +9,6 @@ m4/printf.m4 m4/math_h.m4 m4/wchar_t.m4 m4/wint_t.m4 -m4/longlong.m4 m4/intmax_t.m4 m4/stdint_h.m4 m4/inttypes_h.m4 diff --git a/modules/unistdio/u8-vasnprintf b/modules/unistdio/u8-vasnprintf index dba93f2..8841790 100644 --- a/modules/unistdio/u8-vasnprintf +++ b/modules/unistdio/u8-vasnprintf @@ -9,7 +9,6 @@ m4/printf.m4 m4/math_h.m4 m4/wchar_t.m4 m4/wint_t.m4 -m4/longlong.m4 m4/intmax_t.m4 m4/stdint_h.m4 m4/inttypes_h.m4 diff --git a/modules/unistdio/ulc-vasnprintf b/modules/unistdio/ulc-vasnprintf index 5febf32..77a0b8c 100644 --- a/modules/unistdio/ulc-vasnprintf +++ b/modules/unistdio/ulc-vasnprintf @@ -9,7 +9,6 @@ m4/printf.m4 m4/math_h.m4 m4/wchar_t.m4 m4/wint_t.m4 -m4/longlong.m4 m4/intmax_t.m4 m4/stdint_h.m4 m4/inttypes_h.m4 diff --git a/modules/vasnprintf b/modules/vasnprintf index fafa1a3..671cb68 100644 --- a/modules/vasnprintf +++ b/modules/vasnprintf @@ -12,7 +12,6 @@ lib/vasnprintf.c lib/asnprintf.c m4/wchar_t.m4 m4/wint_t.m4 -m4/longlong.m4 m4/intmax_t.m4 m4/stdint_h.m4 m4/inttypes_h.m4 -- 2.7.4
>From 5377e375dd6e933437bac066cd86ea54880f3f73 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 09:57:17 +0100 Subject: [PATCH 07/15] xstrtoll: Assume that the compiler supports 'long long'. * lib/xstrtol.h (xstrtoll, xstrtoull): Declare unconditionally. * modules/xstrtoll (configure.ac): Don't invoke AC_TYPE_LONG_LONG_INT. --- ChangeLog | 4 ++++ lib/xstrtol.h | 7 ++----- modules/xstrtoll | 4 ---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf96d6c..e295186 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2019-12-22 Bruno Haible <[email protected]> + xstrtoll: Assume that the compiler supports 'long long'. + * lib/xstrtol.h (xstrtoll, xstrtoull): Declare unconditionally. + * modules/xstrtoll (configure.ac): Don't invoke AC_TYPE_LONG_LONG_INT. + vasnprintf: Assume that the compiler supports 'long long'. * lib/printf-args.h: Assume HAVE_LONG_LONG_INT to be 1. * lib/printf-args.c (PRINTF_FETCHARGS): Likewise. diff --git a/lib/xstrtol.h b/lib/xstrtol.h index d888120..ea92f1b 100644 --- a/lib/xstrtol.h +++ b/lib/xstrtol.h @@ -42,12 +42,9 @@ typedef enum strtol_error strtol_error; strtol_error name (const char *, char **, int, type *, const char *); _DECLARE_XSTRTOL (xstrtol, long int) _DECLARE_XSTRTOL (xstrtoul, unsigned long int) -_DECLARE_XSTRTOL (xstrtoimax, intmax_t) -_DECLARE_XSTRTOL (xstrtoumax, uintmax_t) - -#if HAVE_LONG_LONG_INT _DECLARE_XSTRTOL (xstrtoll, long long int) _DECLARE_XSTRTOL (xstrtoull, unsigned long long int) -#endif +_DECLARE_XSTRTOL (xstrtoimax, intmax_t) +_DECLARE_XSTRTOL (xstrtoumax, uintmax_t) #endif /* not XSTRTOL_H_ */ diff --git a/modules/xstrtoll b/modules/xstrtoll index ee5fa8e..ccff7f1 100644 --- a/modules/xstrtoll +++ b/modules/xstrtoll @@ -14,10 +14,6 @@ xstrtol configure.ac: AC_LIBOBJ([xstrtoll]) AC_LIBOBJ([xstrtoull]) -AC_TYPE_LONG_LONG_INT -test $ac_cv_type_long_long_int = no \ - && AC_MSG_ERROR( - [you lack long long support; required by gnulib's xstrtoll module]) Makefile.am: -- 2.7.4
>From 1cf18f42fc1a47c17ba0073c1391a0f66fc4435e Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 09:59:49 +0100 Subject: [PATCH 08/15] strtoimax, strtoumax: Assume that the compiler supports 'long long'. * lib/strtoimax.c: Assume HAVE_LONG_LONG_INT and HAVE_UNSIGNED_LONG_LONG_INT to be 1. * m4/strtoimax.m4 (gl_PREREQ_STRTOIMAX): Don't require AC_TYPE_LONG_LONG_INT. * m4/strtoumax.m4 (gl_PREREQ_STRTOUMAX): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. * modules/strtoimax (Files): Remove longlong.m4. * modules/strtoumax (Files): Likewise. --- ChangeLog | 10 ++++++++++ lib/strtoimax.c | 22 ++++++---------------- m4/strtoimax.m4 | 3 +-- m4/strtoumax.m4 | 3 +-- modules/strtoimax | 1 - modules/strtoumax | 1 - 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index e295186..d5b304b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2019-12-22 Bruno Haible <[email protected]> + strtoimax, strtoumax: Assume that the compiler supports 'long long'. + * lib/strtoimax.c: Assume HAVE_LONG_LONG_INT and + HAVE_UNSIGNED_LONG_LONG_INT to be 1. + * m4/strtoimax.m4 (gl_PREREQ_STRTOIMAX): Don't require + AC_TYPE_LONG_LONG_INT. + * m4/strtoumax.m4 (gl_PREREQ_STRTOUMAX): Don't require + AC_TYPE_UNSIGNED_LONG_LONG_INT. + * modules/strtoimax (Files): Remove longlong.m4. + * modules/strtoumax (Files): Likewise. + xstrtoll: Assume that the compiler supports 'long long'. * lib/xstrtol.h (xstrtoll, xstrtoull): Declare unconditionally. * modules/xstrtoll (configure.ac): Don't invoke AC_TYPE_LONG_LONG_INT. diff --git a/lib/strtoimax.c b/lib/strtoimax.c index 87b080c..6c9cc63 100644 --- a/lib/strtoimax.c +++ b/lib/strtoimax.c @@ -28,36 +28,30 @@ #include "verify.h" #ifdef UNSIGNED -# if HAVE_UNSIGNED_LONG_LONG_INT -# ifndef HAVE_DECL_STRTOULL +# ifndef HAVE_DECL_STRTOULL "this configure-time declaration test was not run" -# endif -# if !HAVE_DECL_STRTOULL +# endif +# if !HAVE_DECL_STRTOULL unsigned long long int strtoull (char const *, char **, int); -# endif # endif #else -# if HAVE_LONG_LONG_INT -# ifndef HAVE_DECL_STRTOLL +# ifndef HAVE_DECL_STRTOLL "this configure-time declaration test was not run" -# endif -# if !HAVE_DECL_STRTOLL +# endif +# if !HAVE_DECL_STRTOLL long long int strtoll (char const *, char **, int); -# endif # endif #endif #ifdef UNSIGNED -# define Have_long_long HAVE_UNSIGNED_LONG_LONG_INT # define Int uintmax_t # define Strtoimax strtoumax # define Strtol strtoul # define Strtoll strtoull # define Unsigned unsigned #else -# define Have_long_long HAVE_LONG_LONG_INT # define Int intmax_t # define Strtoimax strtoimax # define Strtol strtol @@ -68,15 +62,11 @@ long long int strtoll (char const *, char **, int); Int Strtoimax (char const *ptr, char **endptr, int base) { -#if Have_long_long verify (sizeof (Int) == sizeof (Unsigned long int) || sizeof (Int) == sizeof (Unsigned long long int)); if (sizeof (Int) != sizeof (Unsigned long int)) return Strtoll (ptr, endptr, base); -#else - verify (sizeof (Int) == sizeof (Unsigned long int)); -#endif return Strtol (ptr, endptr, base); } diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4 index 9632279..deb6f7f 100644 --- a/m4/strtoimax.m4 +++ b/m4/strtoimax.m4 @@ -1,4 +1,4 @@ -# strtoimax.m4 serial 15 +# strtoimax.m4 serial 16 dnl Copyright (C) 2002-2004, 2006, 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, @@ -85,5 +85,4 @@ int main () # Prerequisites of lib/strtoimax.c. AC_DEFUN([gl_PREREQ_STRTOIMAX], [ AC_CHECK_DECLS([strtoll]) - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) ]) diff --git a/m4/strtoumax.m4 b/m4/strtoumax.m4 index 89b503f..6bafe53 100644 --- a/m4/strtoumax.m4 +++ b/m4/strtoumax.m4 @@ -1,4 +1,4 @@ -# strtoumax.m4 serial 12 +# strtoumax.m4 serial 13 dnl Copyright (C) 2002-2004, 2006, 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, @@ -24,5 +24,4 @@ AC_DEFUN([gl_FUNC_STRTOUMAX], # Prerequisites of lib/strtoumax.c. AC_DEFUN([gl_PREREQ_STRTOUMAX], [ AC_CHECK_DECLS([strtoull]) - AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) ]) diff --git a/modules/strtoimax b/modules/strtoimax index 36a96de..1cdd925 100644 --- a/modules/strtoimax +++ b/modules/strtoimax @@ -4,7 +4,6 @@ strtoimax() function: convert string to 'intmax_t'. Files: lib/strtoimax.c m4/strtoimax.m4 -m4/longlong.m4 Depends-on: inttypes-incomplete diff --git a/modules/strtoumax b/modules/strtoumax index 725f523..201332c 100644 --- a/modules/strtoumax +++ b/modules/strtoumax @@ -4,7 +4,6 @@ strtoumax() function: convert string to 'uintmax_t'. Files: lib/strtoimax.c lib/strtoumax.c -m4/longlong.m4 m4/strtoumax.m4 Depends-on: -- 2.7.4
>From 04ac8d921179273cd438cfb4c6eb0c039f4ee076 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 10:03:30 +0100 Subject: [PATCH 09/15] strtoull: Assume that the compiler supports 'long long'. * m4/strtoull.m4 (gl_FUNC_STRTOULL): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. * modules/strtoull (Files): Remove longlong.m4. --- ChangeLog | 5 +++++ m4/strtoull.m4 | 13 ++++--------- modules/strtoull | 1 - 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5b304b..5775d5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2019-12-22 Bruno Haible <[email protected]> + strtoull: Assume that the compiler supports 'long long'. + * m4/strtoull.m4 (gl_FUNC_STRTOULL): Don't require + AC_TYPE_UNSIGNED_LONG_LONG_INT. + * modules/strtoull (Files): Remove longlong.m4. + strtoimax, strtoumax: Assume that the compiler supports 'long long'. * lib/strtoimax.c: Assume HAVE_LONG_LONG_INT and HAVE_UNSIGNED_LONG_LONG_INT to be 1. diff --git a/m4/strtoull.m4 b/m4/strtoull.m4 index 532139c..6cc83d2 100644 --- a/m4/strtoull.m4 +++ b/m4/strtoull.m4 @@ -1,4 +1,4 @@ -# strtoull.m4 serial 7 +# strtoull.m4 serial 8 dnl Copyright (C) 2002, 2004, 2006, 2008-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, @@ -7,14 +7,9 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRTOULL], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - dnl We don't need (and can't compile) the replacement strtoull - dnl unless the type 'unsigned long long int' exists. - AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) - if test "$ac_cv_type_unsigned_long_long_int" = yes; then - AC_CHECK_FUNCS([strtoull]) - if test $ac_cv_func_strtoull = no; then - HAVE_STRTOULL=0 - fi + AC_CHECK_FUNCS([strtoull]) + if test $ac_cv_func_strtoull = no; then + HAVE_STRTOULL=0 fi ]) diff --git a/modules/strtoull b/modules/strtoull index 7f94bca..ff83b69 100644 --- a/modules/strtoull +++ b/modules/strtoull @@ -5,7 +5,6 @@ Files: lib/strtol.c lib/strtoul.c lib/strtoull.c -m4/longlong.m4 m4/strtoull.m4 Depends-on: -- 2.7.4
>From 0b018e2c609fd49ccce27d55225e145d5c982819 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 10:04:37 +0100 Subject: [PATCH 10/15] strtoll: Assume that the compiler supports 'long long'. * m4/strtoll.m4 (gl_FUNC_STRTOLL): Don't require AC_TYPE_LONG_LONG_INT. * modules/strtoll (Files): Remove longlong.m4. --- ChangeLog | 4 ++++ m4/strtoll.m4 | 13 ++++--------- modules/strtoll | 1 - 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5775d5f..2f053f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2019-12-22 Bruno Haible <[email protected]> + strtoll: Assume that the compiler supports 'long long'. + * m4/strtoll.m4 (gl_FUNC_STRTOLL): Don't require AC_TYPE_LONG_LONG_INT. + * modules/strtoll (Files): Remove longlong.m4. + strtoull: Assume that the compiler supports 'long long'. * m4/strtoull.m4 (gl_FUNC_STRTOULL): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT. diff --git a/m4/strtoll.m4 b/m4/strtoll.m4 index 3ba7e22..8018ffe 100644 --- a/m4/strtoll.m4 +++ b/m4/strtoll.m4 @@ -1,4 +1,4 @@ -# strtoll.m4 serial 7 +# strtoll.m4 serial 8 dnl Copyright (C) 2002, 2004, 2006, 2008-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, @@ -7,14 +7,9 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRTOLL], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - dnl We don't need (and can't compile) the replacement strtoll - dnl unless the type 'long long int' exists. - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) - if test "$ac_cv_type_long_long_int" = yes; then - AC_CHECK_FUNCS([strtoll]) - if test $ac_cv_func_strtoll = no; then - HAVE_STRTOLL=0 - fi + AC_CHECK_FUNCS([strtoll]) + if test $ac_cv_func_strtoll = no; then + HAVE_STRTOLL=0 fi ]) diff --git a/modules/strtoll b/modules/strtoll index 082d7f4..7b6d80c 100644 --- a/modules/strtoll +++ b/modules/strtoll @@ -4,7 +4,6 @@ strtoll() function: convert string to 'long long'. Files: lib/strtol.c lib/strtoll.c -m4/longlong.m4 m4/strtoll.m4 Depends-on: -- 2.7.4
>From 91b5a3c3e365de748d740e6a55d7b4ee7713eeef Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 10:06:04 +0100 Subject: [PATCH 11/15] atoll: Assume that the compiler supports 'long long'. * m4/atoll.m4 (gl_FUNC_ATOLL): Don't require AC_TYPE_LONG_LONG_INT. * modules/atoll (Files): Remove longlong.m4. --- ChangeLog | 4 ++++ m4/atoll.m4 | 13 ++++--------- modules/atoll | 1 - 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2f053f6..fa580b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2019-12-22 Bruno Haible <[email protected]> + atoll: Assume that the compiler supports 'long long'. + * m4/atoll.m4 (gl_FUNC_ATOLL): Don't require AC_TYPE_LONG_LONG_INT. + * modules/atoll (Files): Remove longlong.m4. + strtoll: Assume that the compiler supports 'long long'. * m4/strtoll.m4 (gl_FUNC_STRTOLL): Don't require AC_TYPE_LONG_LONG_INT. * modules/strtoll (Files): Remove longlong.m4. diff --git a/m4/atoll.m4 b/m4/atoll.m4 index c126d18..018aded 100644 --- a/m4/atoll.m4 +++ b/m4/atoll.m4 @@ -1,4 +1,4 @@ -# atoll.m4 serial 2 +# atoll.m4 serial 3 dnl Copyright (C) 2008-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, @@ -7,14 +7,9 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_ATOLL], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - dnl We don't need (and can't compile) the replacement strtoll - dnl unless the type 'long long int' exists. - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) - if test "$ac_cv_type_long_long_int" = yes; then - AC_CHECK_FUNCS([atoll]) - if test $ac_cv_func_atoll = no; then - HAVE_ATOLL=0 - fi + AC_CHECK_FUNCS([atoll]) + if test $ac_cv_func_atoll = no; then + HAVE_ATOLL=0 fi ]) diff --git a/modules/atoll b/modules/atoll index 35f6e04..69cda85 100644 --- a/modules/atoll +++ b/modules/atoll @@ -4,7 +4,6 @@ atoll() function: convert decimal string to 'long long'. Files: lib/atoll.c m4/atoll.m4 -m4/longlong.m4 Depends-on: strtoll [test $HAVE_ATOLL = 0] -- 2.7.4
>From f181860de413a26827602178f25593c9b14bc1e7 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 10:08:36 +0100 Subject: [PATCH 12/15] malloca: Assume that the compiler supports 'long long'. * lib/malloca.h: Assume HAVE_LONG_LONG_INT to be 1. * m4/malloca.m4 (gl_MALLOCA): Don't require AC_TYPE_LONG_LONG_INT. * modules/malloca (Files): Remove longlong.m4. * modules/relocatable-prog-wrapper (Files): Likewise. --- ChangeLog | 6 ++++++ lib/malloca.h | 4 ---- m4/malloca.m4 | 3 +-- modules/malloca | 1 - modules/relocatable-prog-wrapper | 1 - 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa580b5..40560e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2019-12-22 Bruno Haible <[email protected]> + malloca: Assume that the compiler supports 'long long'. + * lib/malloca.h: Assume HAVE_LONG_LONG_INT to be 1. + * m4/malloca.m4 (gl_MALLOCA): Don't require AC_TYPE_LONG_LONG_INT. + * modules/malloca (Files): Remove longlong.m4. + * modules/relocatable-prog-wrapper (Files): Likewise. + atoll: Assume that the compiler supports 'long long'. * m4/atoll.m4 (gl_FUNC_ATOLL): Don't require AC_TYPE_LONG_LONG_INT. * modules/atoll (Files): Remove longlong.m4. diff --git a/lib/malloca.h b/lib/malloca.h index 949db55..f2448f1 100644 --- a/lib/malloca.h +++ b/lib/malloca.h @@ -112,14 +112,10 @@ enum among all elementary types. */ sa_alignment_long = sa_alignof (long), sa_alignment_double = sa_alignof (double), -#if HAVE_LONG_LONG_INT sa_alignment_longlong = sa_alignof (long long), -#endif sa_alignment_longdouble = sa_alignof (long double), sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1) -#if HAVE_LONG_LONG_INT | (sa_alignment_longlong - 1) -#endif | (sa_alignment_longdouble - 1) ) + 1 }; diff --git a/m4/malloca.m4 b/m4/malloca.m4 index 820f40a..3033c70 100644 --- a/m4/malloca.m4 +++ b/m4/malloca.m4 @@ -1,4 +1,4 @@ -# malloca.m4 serial 1 +# malloca.m4 serial 2 dnl Copyright (C) 2003-2004, 2006-2007, 2009-2019 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -11,5 +11,4 @@ AC_DEFUN([gl_MALLOCA], dnl @ALLOCA@ and @LTALLOCA@. dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies. AC_REQUIRE([gl_EEMALLOC]) - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) ]) diff --git a/modules/malloca b/modules/malloca index 0ae3fe0..9b7a3db 100644 --- a/modules/malloca +++ b/modules/malloca @@ -6,7 +6,6 @@ lib/malloca.h lib/malloca.c m4/malloca.m4 m4/eealloc.m4 -m4/longlong.m4 Depends-on: alloca-opt diff --git a/modules/relocatable-prog-wrapper b/modules/relocatable-prog-wrapper index db451ef..d70d63e 100644 --- a/modules/relocatable-prog-wrapper +++ b/modules/relocatable-prog-wrapper @@ -29,7 +29,6 @@ m4/malloca.m4 m4/canonicalize.m4 m4/eealloc.m4 m4/environ.m4 -m4/longlong.m4 m4/readlink.m4 m4/relocatable-lib.m4 m4/setenv.m4 -- 2.7.4
>From 818ca1bcefc49a5c10a5b061431ee346cc00984a Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 10:12:54 +0100 Subject: [PATCH 13/15] inttypes-incomplete: Assume that the compiler supports 'long long'. * lib/inttypes.in.h (_PRI64_PREFIX, _PRIu64_PREFIX, _SCN64_PREFIX, _SCNu64_PREFIX): Assume HAVE_LONG_LONG_INT and HAVE_UNSIGNED_LONG_LONG_INT to be 1. * m4/inttypes.m4 (gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION): Assume HAVE_LONG_LONG_INT to be 1. * modules/inttypes-incomplete (Makefile.am): Don't substitute HAVE_LONG_LONG_INT, HAVE_UNSIGNED_LONG_LONG_INT. --- ChangeLog | 9 +++++++++ lib/inttypes.in.h | 8 ++++---- m4/inttypes.m4 | 6 ++---- modules/inttypes-incomplete | 2 -- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 40560e6..60d4c6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2019-12-22 Bruno Haible <[email protected]> + inttypes-incomplete: Assume that the compiler supports 'long long'. + * lib/inttypes.in.h (_PRI64_PREFIX, _PRIu64_PREFIX, _SCN64_PREFIX, + _SCNu64_PREFIX): Assume HAVE_LONG_LONG_INT and + HAVE_UNSIGNED_LONG_LONG_INT to be 1. + * m4/inttypes.m4 (gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION): Assume + HAVE_LONG_LONG_INT to be 1. + * modules/inttypes-incomplete (Makefile.am): Don't substitute + HAVE_LONG_LONG_INT, HAVE_UNSIGNED_LONG_LONG_INT. + malloca: Assume that the compiler supports 'long long'. * lib/malloca.h: Assume HAVE_LONG_LONG_INT to be 1. * m4/malloca.m4 (gl_MALLOCA): Don't require AC_TYPE_LONG_LONG_INT. diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h index 49bcbc1..1dcd440 100644 --- a/lib/inttypes.in.h +++ b/lib/inttypes.in.h @@ -189,7 +189,7 @@ # define _PRI64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _PRI64_PREFIX "I64" -# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# elif LONG_MAX >> 30 == 1 # define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif # if !defined PRId64 || @PRI_MACROS_BROKEN@ @@ -206,7 +206,7 @@ # define _PRIu64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _PRIu64_PREFIX "I64" -# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# elif ULONG_MAX >> 31 == 1 # define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif # if !defined PRIo64 || @PRI_MACROS_BROKEN@ @@ -682,7 +682,7 @@ # define _SCN64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _SCN64_PREFIX "I64" -# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# elif LONG_MAX >> 30 == 1 # define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif # if !defined SCNd64 || @PRI_MACROS_BROKEN@ @@ -699,7 +699,7 @@ # define _SCNu64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _SCNu64_PREFIX "I64" -# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# elif ULONG_MAX >> 31 == 1 # define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif # if !defined SCNo64 || @PRI_MACROS_BROKEN@ diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 index c58a1be..0199e01 100644 --- a/m4/inttypes.m4 +++ b/m4/inttypes.m4 @@ -1,4 +1,4 @@ -# inttypes.m4 serial 27 +# inttypes.m4 serial 28 dnl Copyright (C) 2006-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, @@ -113,10 +113,8 @@ AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION], #if $2 #define CONDITION ($3) - #elif HAVE_LONG_LONG_INT - #define CONDITION ($4) #else - #define CONDITION 0 + #define CONDITION ($4) #endif int test[CONDITION ? 1 : -1];]])], [gl_cv_test_$1=yes], diff --git a/modules/inttypes-incomplete b/modules/inttypes-incomplete index 394d48f..1b3f6f6 100644 --- a/modules/inttypes-incomplete +++ b/modules/inttypes-incomplete @@ -31,8 +31,6 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ - -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ - -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \ -- 2.7.4
>From be9dab63f71e2a9b7fdd78b11819939b2fd733b2 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 10:20:30 +0100 Subject: [PATCH 14/15] stdint: Assume that the compiler supports 'long long'. * lib/stdint.in.h (int64_t, uint64_t, intmax_t, uintmax_t, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C): Assume HAVE_LONG_LONG_INT and HAVE_UNSIGNED_LONG_LONG_INT to be 1. * m4/stdint.m4 (gl_STDINT_H): Don't require AC_TYPE_LONG_LONG_INT, AC_TYPE_UNSIGNED_LONG_LONG_INT. * modules/stdint (Files): Remove longlong.m4. (Makefile.am): Don't substitute HAVE_LONG_LONG_INT, HAVE_UNSIGNED_LONG_LONG_INT. --- ChangeLog | 10 ++++++++++ lib/stdint.in.h | 16 ++++++++-------- m4/stdint.m4 | 23 +++++++---------------- modules/stdint | 3 --- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60d4c6b..10adf32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2019-12-22 Bruno Haible <[email protected]> + stdint: Assume that the compiler supports 'long long'. + * lib/stdint.in.h (int64_t, uint64_t, intmax_t, uintmax_t, INT64_C, + UINT64_C, INTMAX_C, UINTMAX_C): Assume HAVE_LONG_LONG_INT and + HAVE_UNSIGNED_LONG_LONG_INT to be 1. + * m4/stdint.m4 (gl_STDINT_H): Don't require AC_TYPE_LONG_LONG_INT, + AC_TYPE_UNSIGNED_LONG_LONG_INT. + * modules/stdint (Files): Remove longlong.m4. + (Makefile.am): Don't substitute HAVE_LONG_LONG_INT, + HAVE_UNSIGNED_LONG_LONG_INT. + inttypes-incomplete: Assume that the compiler supports 'long long'. * lib/inttypes.in.h (_PRI64_PREFIX, _PRIu64_PREFIX, _SCN64_PREFIX, _SCNu64_PREFIX): Assume HAVE_LONG_LONG_INT and diff --git a/lib/stdint.in.h b/lib/stdint.in.h index 37c15fc..292359a 100644 --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -188,7 +188,7 @@ typedef long int gl_int64_t; typedef __int64 gl_int64_t; # define int64_t gl_int64_t # define GL_INT64_T -# elif @HAVE_LONG_LONG_INT@ +# else # undef int64_t typedef long long int gl_int64_t; # define int64_t gl_int64_t @@ -209,7 +209,7 @@ typedef unsigned long int gl_uint64_t; typedef unsigned __int64 gl_uint64_t; # define uint64_t gl_uint64_t # define GL_UINT64_T -# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# else # undef uint64_t typedef unsigned long long int gl_uint64_t; # define uint64_t gl_uint64_t @@ -333,7 +333,7 @@ typedef unsigned long int gl_uintptr_t; # ifndef INTMAX_MAX # undef INTMAX_C # undef intmax_t -# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# if LONG_MAX >> 30 == 1 typedef long long int gl_intmax_t; # define intmax_t gl_intmax_t # elif defined GL_INT64_T @@ -347,7 +347,7 @@ typedef long int gl_intmax_t; # ifndef UINTMAX_MAX # undef UINTMAX_C # undef uintmax_t -# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# if ULONG_MAX >> 31 == 1 typedef unsigned long long int gl_uintmax_t; # define uintmax_t gl_uintmax_t # elif defined GL_UINT64_T @@ -647,21 +647,21 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) # define INT64_C(x) x##L # elif defined _MSC_VER # define INT64_C(x) x##i64 -# elif @HAVE_LONG_LONG_INT@ +# else # define INT64_C(x) x##LL # endif # if ULONG_MAX >> 31 >> 31 >> 1 == 1 # define UINT64_C(x) x##UL # elif defined _MSC_VER # define UINT64_C(x) x##ui64 -# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# else # define UINT64_C(x) x##ULL # endif /* 7.18.4.2. Macros for greatest-width integer constants */ # ifndef INTMAX_C -# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# if LONG_MAX >> 30 == 1 # define INTMAX_C(x) x##LL # elif defined GL_INT64_T # define INTMAX_C(x) INT64_C(x) @@ -671,7 +671,7 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) # endif # ifndef UINTMAX_C -# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# if ULONG_MAX >> 31 == 1 # define UINTMAX_C(x) x##ULL # elif defined GL_UINT64_T # define UINTMAX_C(x) UINT64_C(x) diff --git a/m4/stdint.m4 b/m4/stdint.m4 index 11d8e8e..df4572a 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,4 +1,4 @@ -# stdint.m4 serial 53 +# stdint.m4 serial 54 dnl Copyright (C) 2001-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, @@ -17,21 +17,12 @@ AC_DEFUN_ONCE([gl_STDINT_H], AC_REQUIRE([gl_LIMITS_H]) AC_REQUIRE([gt_TYPE_WINT_T]) - dnl Check for long long int and unsigned long long int. - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) - if test $ac_cv_type_long_long_int = yes; then - HAVE_LONG_LONG_INT=1 - else - HAVE_LONG_LONG_INT=0 - fi - AC_SUBST([HAVE_LONG_LONG_INT]) - AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) - if test $ac_cv_type_unsigned_long_long_int = yes; then - HAVE_UNSIGNED_LONG_LONG_INT=1 - else - HAVE_UNSIGNED_LONG_LONG_INT=0 - fi - AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) + dnl For backward compatibility. Some packages may still be testing these + dnl macros. + AC_DEFINE([HAVE_LONG_LONG_INT], [1], + [Define to 1 if the system has the type 'long long int'.]) + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], + [Define to 1 if the system has the type 'unsigned long long int'.]) dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does. AC_CHECK_HEADERS_ONCE([wchar.h]) diff --git a/modules/stdint b/modules/stdint index d50b453..25b9d7f 100644 --- a/modules/stdint +++ b/modules/stdint @@ -11,7 +11,6 @@ Files: lib/stdint.in.h m4/stdint.m4 m4/wint_t.m4 -m4/longlong.m4 Depends-on: include_next @@ -43,8 +42,6 @@ stdint.h: stdint.in.h $(top_builddir)/config.status -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ - -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ - -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ -- 2.7.4
>From 35accbe61c103aca59ed8ee7c5ddc3fde795ed6d Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Sun, 22 Dec 2019 10:21:37 +0100 Subject: [PATCH 15/15] longlong: Mark module obsolete. * modules/longlong (Status, Notice): New sections. --- ChangeLog | 3 +++ modules/longlong | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 10adf32..89f7ad9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2019-12-22 Bruno Haible <[email protected]> + longlong: Mark module obsolete. + * modules/longlong (Status, Notice): New sections. + stdint: Assume that the compiler supports 'long long'. * lib/stdint.in.h (int64_t, uint64_t, intmax_t, uintmax_t, INT64_C, UINT64_C, INTMAX_C, UINTMAX_C): Assume HAVE_LONG_LONG_INT and diff --git a/modules/longlong b/modules/longlong index a5d2b70..714e2f2 100644 --- a/modules/longlong +++ b/modules/longlong @@ -1,6 +1,12 @@ Description: Define HAVE_LONG_LONG_INT if 'long long int' works. +Status: +obsolete + +Notice: +This module is obsolete. + Files: m4/longlong.m4 -- 2.7.4
