>From be9dab63f71e2a9b7fdd78b11819939b2fd733b2 Mon Sep 17 00:00:00 2001 From: Bruno Haible 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 + 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 , 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