aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/acinclude.m4
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2008-08-06 12:25:00 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2008-08-06 12:25:00 +0000
commitfc9ab7b4c0c1b54407d3ad4f3219014c6f5e3414 (patch)
treec017003f10aa30deb666f6a595b74f5885f3917e /libstdc++-v3/acinclude.m4
parent753b34d777ee581aeb7efba828f8a509abe7e899 (diff)
downloadgcc-fc9ab7b4c0c1b54407d3ad4f3219014c6f5e3414.zip
gcc-fc9ab7b4c0c1b54407d3ad4f3219014c6f5e3414.tar.gz
gcc-fc9ab7b4c0c1b54407d3ad4f3219014c6f5e3414.tar.bz2
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 <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. From-SVN: r138797
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r--libstdc++-v3/acinclude.m440
1 files changed, 39 insertions, 1 deletions
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 <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
])