Skip to content
Snippets Groups Projects
  • Jonathan Wakely's avatar
    7ddcd26e
    libstdc++: Remove GLIBCXX_CHECK_INT64_T checks · 7ddcd26e
    Jonathan Wakely authored
    
    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: default avatarDavid 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.
    7ddcd26e
    History
    libstdc++: Remove GLIBCXX_CHECK_INT64_T checks
    Jonathan Wakely authored
    
    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: default avatarDavid 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.