|
Packit Service |
f629e6 |
# ulonglong.m4 serial 6
|
|
Packit Service |
f629e6 |
dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
|
|
Packit Service |
f629e6 |
dnl This file is free software; the Free Software Foundation
|
|
Packit Service |
f629e6 |
dnl gives unlimited permission to copy and/or distribute it,
|
|
Packit Service |
f629e6 |
dnl with or without modifications, as long as this notice is preserved.
|
|
Packit Service |
f629e6 |
|
|
Packit Service |
f629e6 |
dnl From Paul Eggert.
|
|
Packit Service |
f629e6 |
|
|
Packit Service |
f629e6 |
# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
|
|
Packit Service |
f629e6 |
# This fixes a bug in Autoconf 2.60, but can be removed once we
|
|
Packit Service |
f629e6 |
# assume 2.61 everywhere.
|
|
Packit Service |
f629e6 |
|
|
Packit Service |
f629e6 |
# Note: If the type 'unsigned long long int' exists but is only 32 bits
|
|
Packit Service |
f629e6 |
# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
|
|
Packit Service |
f629e6 |
# will not be defined. In this case you can treat 'unsigned long long int'
|
|
Packit Service |
f629e6 |
# like 'unsigned long int'.
|
|
Packit Service |
f629e6 |
|
|
Packit Service |
f629e6 |
AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
|
|
Packit Service |
f629e6 |
[
|
|
Packit Service |
f629e6 |
AC_CACHE_CHECK([for unsigned long long int],
|
|
Packit Service |
f629e6 |
[ac_cv_type_unsigned_long_long_int],
|
|
Packit Service |
f629e6 |
[AC_LINK_IFELSE(
|
|
Packit Service |
f629e6 |
[AC_LANG_PROGRAM(
|
|
Packit Service |
f629e6 |
[[unsigned long long int ull = 18446744073709551615ULL;
|
|
Packit Service |
f629e6 |
typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1
|
|
Packit Service |
f629e6 |
? 1 : -1)];
|
|
Packit Service |
f629e6 |
int i = 63;]],
|
|
Packit Service |
f629e6 |
[[unsigned long long int ullmax = 18446744073709551615ull;
|
|
Packit Service |
f629e6 |
return (ull << 63 | ull >> 63 | ull << i | ull >> i
|
|
Packit Service |
f629e6 |
| ullmax / ull | ullmax % ull);]])],
|
|
Packit Service |
f629e6 |
[ac_cv_type_unsigned_long_long_int=yes],
|
|
Packit Service |
f629e6 |
[ac_cv_type_unsigned_long_long_int=no])])
|
|
Packit Service |
f629e6 |
if test $ac_cv_type_unsigned_long_long_int = yes; then
|
|
Packit Service |
f629e6 |
AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1,
|
|
Packit Service |
f629e6 |
[Define to 1 if the system has the type `unsigned long long int'.])
|
|
Packit Service |
f629e6 |
fi
|
|
Packit Service |
f629e6 |
])
|
|
Packit Service |
f629e6 |
|
|
Packit Service |
f629e6 |
# This macro is obsolescent and should go away soon.
|
|
Packit Service |
f629e6 |
AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG],
|
|
Packit Service |
f629e6 |
[
|
|
Packit Service |
f629e6 |
AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
|
|
Packit Service |
f629e6 |
ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int
|
|
Packit Service |
f629e6 |
if test $ac_cv_type_unsigned_long_long = yes; then
|
|
Packit Service |
f629e6 |
AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
|
|
Packit Service |
f629e6 |
[Define if you have the 'unsigned long long' type.])
|
|
Packit Service |
f629e6 |
fi
|
|
Packit Service |
f629e6 |
])
|