diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-06 12:25:00 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-06 12:25:00 +0000 |
commit | e061cb0f9d166c0a04b7753cbdb4548d7831a69a (patch) | |
tree | c017003f10aa30deb666f6a595b74f5885f3917e /libstdc++-v3/acinclude.m4 | |
parent | a6090c119ec004ea2c30ebe04d13e8dd0c096199 (diff) | |
download | gcc-e061cb0f9d166c0a04b7753cbdb4548d7831a69a.tar.gz |
2008-08-06 Paolo Carlini <paolo.carlini@oracle.com>
* acinclude.m4 ([GLIBCXX_CHECK_INT64_T]): Also check whether int64_t
is actually a typedef to long or long long.
* include/bits/postypes.h: If int64_t is actually a typedef for
long or long long don't include <stdint.h> unnecessarily.
* configure: Regenerate.
* config.h.in: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138797 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 0a669c9a7fa..50f207c2382 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -466,8 +466,13 @@ AC_DEFUN([GLIBCXX_CHECK_WRITEV], [ dnl dnl Check whether int64_t is available in <stdint.h>, and define HAVE_INT64_T. +dnl Also check whether int64_t is actually a typedef to long or long long. dnl AC_DEFUN([GLIBCXX_CHECK_INT64_T], [ + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_MSG_CHECKING([for int64_t]) AC_CACHE_VAL(glibcxx_cv_INT64_T, [ AC_TRY_COMPILE( @@ -476,10 +481,43 @@ AC_DEFUN([GLIBCXX_CHECK_INT64_T], [ [glibcxx_cv_INT64_T=yes], [glibcxx_cv_INT64_T=no]) ]) + if test $glibcxx_cv_INT64_T = yes; then AC_DEFINE(HAVE_INT64_T, 1, [Define if int64_t is available in <stdint.h>.]) + AC_MSG_RESULT($glibcxx_cv_INT64_T) + + AC_MSG_CHECKING([for int64_t as long]) + AC_CACHE_VAL(glibcxx_cv_int64_t_long, [ + AC_TRY_COMPILE( + [#include <stdint.h> + template<typename, typename> struct same { enum { value = -1 }; }; + template<typename Tp> struct same<Tp, Tp> { enum { value = 1 }; }; + int array[same<int64_t, long>::value];], [], + [glibcxx_cv_int64_t_long=yes], [glibcxx_cv_int64_t_long=no]) + ]) + + if test $glibcxx_cv_int64_t_long = yes; then + AC_DEFINE(HAVE_INT64_T_LONG, 1, [Define if int64_t is a long.]) + AC_MSG_RESULT($glibcxx_cv_int64_t_long) + fi + + AC_MSG_CHECKING([for int64_t as long long]) + AC_CACHE_VAL(glibcxx_cv_int64_t_long_long, [ + AC_TRY_COMPILE( + [#include <stdint.h> + template<typename, typename> struct same { enum { value = -1 }; }; + template<typename Tp> struct same<Tp, Tp> { enum { value = 1 }; }; + int array[same<int64_t, long long>::value];], [], + [glibcxx_cv_int64_t_long_long=yes], [glibcxx_cv_int64_t_long_long=no]) + ]) + + if test $glibcxx_cv_int64_t_long_long = yes; then + AC_DEFINE(HAVE_INT64_T_LONG_LONG, 1, [Define if int64_t is a long long.]) + AC_MSG_RESULT($glibcxx_cv_int64_t_long_long) + fi fi - AC_MSG_RESULT($glibcxx_cv_INT64_T) + + AC_LANG_RESTORE ]) |