From fc9ab7b4c0c1b54407d3ad4f3219014c6f5e3414 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 6 Aug 2008 12:25:00 +0000 Subject: acinclude.m4 ([GLIBCXX_CHECK_INT64_T]): Also check whether int64_t is actually a typedef to long or long long. 2008-08-06 Paolo Carlini * 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 unnecessarily. * configure: Regenerate. * config.h.in: Likewise. From-SVN: r138797 --- libstdc++-v3/acinclude.m4 | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'libstdc++-v3/acinclude.m4') diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 0a669c9..50f207c 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 , 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 .]) + 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 + template struct same { enum { value = -1 }; }; + template struct same { enum { value = 1 }; }; + int array[same::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 + template struct same { enum { value = -1 }; }; + template struct same { enum { value = 1 }; }; + int array[same::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 ]) -- cgit v1.1