X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=m4%2Flonglong.m4;h=3716c09f6caf562c8b70eb0c8ff498f3e210c6b7;hb=f04c7711b0eb15c64a2e3166476fe506ebaa45e6;hp=d7d7350b3f53bc18f92ee82cb501a8819e0c28d0;hpb=b02093873e853ba0caabae0451b51a2a119e7379;p=lyx.git diff --git a/m4/longlong.m4 b/m4/longlong.m4 index d7d7350b3f..3716c09f6c 100644 --- a/m4/longlong.m4 +++ b/m4/longlong.m4 @@ -1,23 +1,46 @@ -# longlong.m4 serial 4 -dnl Copyright (C) 1999-2003 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. +# longlong.m4 serial 8 +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([jm_AC_TYPE_LONG_LONG], +# Note: If the type 'long long int' exists but is only 32 bits large +# (as on some very old compilers), AC_TYPE_LONG_LONG_INT will not be +# defined. In this case you can treat 'long long int' like 'long int'. + +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.])