libstdc++: Remove GLIBCXX_CHECK_INT64_T checks
authorJonathan Wakely <jwakely@redhat.com>
Fri, 30 Apr 2021 14:54:14 +0000 (15:54 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 30 Apr 2021 19:30:46 +0000 (20:30 +0100)
commit7ddcd26ebb60a8a4b57330442631115cabb6ec22
treee797c6b35100d8a67d310fb1327ae5c337cc3347
parentd8d291f3367230fdfdacc9868b0aa01de1dabb13
libstdc++: Remove GLIBCXX_CHECK_INT64_T checks

This simplifies the definition of std::streamoff by using the predefined
__INT64_TYPE__ macro, instead of the _GLIBCXX_HAVE_INT64_T_LONG,
_GLIBCXX_HAVE_INT64_T_LONG_LONG and _GLIBCXX_HAVE_INT64_T macros defined
by configure.

By using the __INT64_TYPE__ macro (which all of GCC, Clang and Intel
define) we do not need to determine the type of int64_t in configure, we
can just use that type directly.

The background for the change was explained by David Edelsohn:

  Currently the type of streamoff is determined at libstdc++ configure
  time, chosen by the definitions of _GLIBCXX_HAVE_INT64_T_LONG and
  _GLIBCXX_HAVE_INT64_T_LONG_LONG.  For a multilib configuration, the
  difference is encoded in the different multilib header file paths.
  For "FAT" library targets that package 32 bit and 64 bit libraries
  together, G++ also expects a single header file directory hierarchy,
  causing an incorrect value for streamoff in some situations.

And in a subsequent mail:

  Most of the libstdc++ headers are architecture-neutral, OS neutral and
  ABI neutral.  The differences are localized in bits/c++config.h.  And
  most of c++config.h is identical for 32 bit AIX and 64 bit AIX.  The
  only differences that matter are __int128 and __int64_t.

This change removes some of those differences. With the only uses of the
INT64_T configure macros removed, the configure checks themselves can
also be removed.

Co-authored-by: David Edelsohn <dje.gcc@gmail.com>
libstdc++-v3/ChangeLog:

* acinclude.m4 (GLIBCXX_CHECK_INT64_T): Delete.
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Do not use GLIBCXX_CHECK_INT64_T.
* include/bits/postypes.h: Remove include of <stdint.h> and
definition/undefinition of the __STDC_LIMIT_MACROS and
__STDC_CONSTANT_MACROS macros.
(streamoff): Use __INT64_TYPE__ if defined.
libstdc++-v3/acinclude.m4
libstdc++-v3/config.h.in
libstdc++-v3/configure
libstdc++-v3/configure.ac
libstdc++-v3/include/bits/postypes.h