summaryrefslogtreecommitdiff
path: root/m4/longlong.m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-07-02 07:08:50 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-07-02 07:08:50 +0000
commit047839ffb4fea7a632be0a3f66e174b3ac5c4004 (patch)
tree7117d6f5f183736d5b76d73d67d769cf65425c83 /m4/longlong.m4
parent31acf81fa092fabe5fde9b3f23d564ff2f0b02a3 (diff)
downloadcoreutils-047839ffb4fea7a632be0a3f66e174b3ac5c4004.tar.xz
Sync stdint module from gnulib.
Diffstat (limited to 'm4/longlong.m4')
-rw-r--r--m4/longlong.m439
1 files changed, 30 insertions, 9 deletions
diff --git a/m4/longlong.m4 b/m4/longlong.m4
index 7b399e012..ea7c485c3 100644
--- a/m4/longlong.m4
+++ b/m4/longlong.m4
@@ -1,21 +1,42 @@
-# longlong.m4 serial 5
-dnl Copyright (C) 1999-2004 Free Software Foundation, Inc.
+# longlong.m4 serial 6
+dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert.
-# Define HAVE_LONG_LONG if 'long long' works.
+# Define HAVE_LONG_LONG_INT if 'long long int' works.
+# This fixes a bug in Autoconf 2.60, but can be removed once we
+# assume 2.61 everywhere.
+AC_DEFUN([AC_TYPE_LONG_LONG_INT],
+[
+ AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ typedef int a[((-9223372036854775807LL < 0
+ && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ int i = 63;]],
+ [[long long int llmax = 9223372036854775807ll;
+ return (ll << 63 | ll >> 63 | ll < i | ll > i
+ | llmax / ll | llmax % ll);]])],
+ [ac_cv_type_long_long_int=yes],
+ [ac_cv_type_long_long_int=no])])
+ if test $ac_cv_type_long_long_int = yes; then
+ AC_DEFINE([HAVE_LONG_LONG_INT], 1,
+ [Define to 1 if the system has the type `long long int'.])
+ fi
+])
+
+# This macro is obsolescent and should go away soon.
AC_DEFUN([gl_AC_TYPE_LONG_LONG],
[
- AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
- [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
- [long long llmax = (long long) -1;
- return ll << i | ll >> i | llmax / ll | llmax % ll;],
- ac_cv_type_long_long=yes,
- ac_cv_type_long_long=no)])
+ AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
+ ac_cv_type_long_long=$ac_cv_type_long_long_int
if test $ac_cv_type_long_long = yes; then
AC_DEFINE(HAVE_LONG_LONG, 1,
[Define if you have the 'long long' type.])