/cln-1.3.2/m4/longlong.m4
m4 | 42 lines | 34 code | 3 blank | 5 comment | 0 complexity | 4b94282f904f916c7bebdf402b509564 MD5 | raw file
Possible License(s): GPL-2.0
- dnl -*- Autoconf -*-
- dnl Copyright (C) 1993-2006 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.
- dnl From Bruno Haible, Marcus Daniels, Sam Steingold, Paul Eggert.
- AC_PREREQ(2.57)
- AC_DEFUN([CL_LONGLONG],
- [AC_CACHE_CHECK(for long long type, cl_cv_c_longlong, [
- AC_TRY_RUN([
- #include <stdlib.h>
- int main()
- {
- /* long longs don't work right with gcc-2.7.2 on m68k */
- /* long longs don't work right with gcc-2.7.2 on rs6000: avcall/tests.c gets
- miscompiled. */
- #if defined(__m68k__) || (defined(_IBMR2) || defined(__powerpc))
- #if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)
- exit(1);
- #endif
- #endif
- { long x = 944938507; long y = 737962842; long z = 162359677;
- exit(!(((long long) x)*((long long) y)>>32 == z));
- }
- }],
- cl_cv_c_longlong=yes, cl_cv_c_longlong=no, [
- dnl When cross-compiling, use the test from gnulib.
- 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;],
- cl_cv_c_longlong=yes,
- cl_cv_c_longlong=no)])
- ])
- if test $cl_cv_c_longlong = yes; then
- AC_DEFINE(HAVE_LONGLONG,,[compiler supports the `long long' type])
- fi
- ])