summaryrefslogtreecommitdiff
path: root/libstdc++-v3/acinclude.m4
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-17 23:53:26 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-17 23:53:26 +0000
commita3ee70c2b70b4e1d423dcfab6b494536bb2e0e02 (patch)
treec3c3bbc697c8eb502283f26c846f130bab407130 /libstdc++-v3/acinclude.m4
parent010db245e57d351bb70b49660187f8a52dc18ef2 (diff)
downloadgcc-a3ee70c2b70b4e1d423dcfab6b494536bb2e0e02.tar.gz
2011-09-17 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/50441 * acinclude.m4 ([GLIBCXX_ENABLE_INT128_FLOAT128]): Add. * configure.ac: Call it. * include/std/type_traits (__is_integral_helper<__int128_t>, __is_integral_helper<__uint128_t>, __is_floating_point_helper<__float128>, __make_unsigned<__int128_t>, __make_signed<__uint128_t>): Add. * testsuite/20_util/make_signed/requirements/typedefs-1.cc: Extend. * testsuite/20_util/make_signed/requirements/typedefs-2.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Likewise. * testsuite/20_util/is_signed/value.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise. * testsuite/20_util/is_integral/value.cc: Likewise. * testsuite/20_util/is_floating_point/value.cc: New. * testsuite/20_util/is_floating_point/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_floating_point/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error line numbers. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/declval/requirements/1_neg.cc: Likewise. * configure: Regenerate. * config.h.in: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178933 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r--libstdc++-v3/acinclude.m476
1 files changed, 76 insertions, 0 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index a3e059864d1..543f684f458 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2419,6 +2419,82 @@ EOF
])
dnl
+dnl Check for GNU 128-bit integer and floating point types.
+dnl
+dnl Note: also checks that the types aren't standard types.
+dnl
+dnl Defines:
+dnl _GLIBCXX_USE_INT128
+dnl _GLIBCXX_USE_FLOAT128
+dnl
+AC_DEFUN([GLIBCXX_ENABLE_INT128_FLOAT128], [
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ # Fake what AC_TRY_COMPILE does, without linking as this is
+ # unnecessary for this test.
+
+ cat > conftest.$ac_ext << EOF
+[#]line __oline__ "configure"
+template<typename T1, typename T2>
+ struct same
+ { typedef T2 type; };
+
+template<typename T>
+ struct same<T, T>;
+
+int main()
+{
+ typename same<long, __int128_t>::type i1;
+ typename same<unsigned long, __uint128_t>::type u1;
+ typename same<long long, __int128_t>::type i2;
+ typename same<unsigned long long, __uint128_t>::type u2;
+}
+EOF
+
+ AC_MSG_CHECKING([for __int128_t and __uint128_t])
+ if AC_TRY_EVAL(ac_compile); then
+ AC_DEFINE(_GLIBCXX_USE_INT128, 1,
+ [Define if __int128_t and __uint128_t types are supported on this host.])
+ enable_int128=yes
+ else
+ enable_int128=no
+ fi
+ AC_MSG_RESULT($enable_int128)
+ rm -f conftest*
+
+ cat > conftest.$ac_ext << EOF
+[#]line __oline__ "configure"
+template<typename T1, typename T2>
+ struct same
+ { typedef T2 type; };
+
+template<typename T>
+ struct same<T, T>;
+
+int main()
+{
+ typename same<double, __float128>::type f1;
+ typename same<long double, __float128>::type f2;
+}
+EOF
+
+ AC_MSG_CHECKING([for __float128])
+ if AC_TRY_EVAL(ac_compile); then
+ AC_DEFINE(_GLIBCXX_USE_FLOAT128, 1,
+ [Define if __float128 is supported on this host.])
+ enable_float128=yes
+ else
+ enable_float128=no
+ fi
+ AC_MSG_RESULT($enable_float128)
+ rm -f conftest*
+
+ AC_LANG_RESTORE
+])
+
+dnl
dnl Check for template specializations for the 'wchar_t' type.
dnl
dnl --enable-wchar_t defines _GLIBCXX_USE_WCHAR_T