summaryrefslogtreecommitdiff
path: root/m4/ax_int128.m4
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2019-05-16 22:12:25 +0100
committerReuben Thomas <rrt@sc3d.org>2019-05-16 22:12:25 +0100
commit19e02953b3eb27778a7c3961a16883ec16207c24 (patch)
treed2b46ab6d8c11c12a961f880a1282539b190e021 /m4/ax_int128.m4
parent92aa35374c4925056289515997d14af100280348 (diff)
downloadautoconf-archive-19e02953b3eb27778a7c3961a16883ec16207c24.tar.gz
ax_int128.m4: new macro AX_HAVE_INT128
Diffstat (limited to 'm4/ax_int128.m4')
-rw-r--r--m4/ax_int128.m444
1 files changed, 44 insertions, 0 deletions
diff --git a/m4/ax_int128.m4 b/m4/ax_int128.m4
new file mode 100644
index 0000000..a6c848a
--- /dev/null
+++ b/m4/ax_int128.m4
@@ -0,0 +1,44 @@
+# =============================================================
+# https://www.gnu.org/software/autoconf-archive/ax_int128.html
+# =============================================================
+#
+# SYNOPSIS
+#
+# AX_HAVE_INT128
+#
+# DESCRIPTION
+#
+# Check whether the compiler provides __int128. If so, define HAVE_INT128.
+#
+# Works with GCC >= 4.6.
+#
+# TODO: Provide int128[u]_t.
+# TODO: Work with other compilers.
+#
+# LICENSE
+#
+# Copyright (c) 2019 Reuben Thomas <rrt@sc3d.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 1
+
+AC_DEFUN([AX_HAVE_INT128],
+[
+ dnl First test whether we already found it.
+ AC_CACHE_CHECK([for __int128], [ax_cv_int128], [
+ ax_cv_int128=
+ AC_EGREP_CPP([Found it], [
+#ifdef __SIZEOF_INT128__
+Found it
+#endif
+], [ax_cv_int128=yes])
+ ])
+ if test "$ax_cv_int128" = yes; then
+ AC_DEFINE([HAVE_INT128], [1],
+ [Define to 1 if you have the type __int128.])
+ fi
+])