~ubuntu-branches/ubuntu/gutsy/m4/gutsy

« back to all changes in this revision

Viewing changes to m4/longlong.m4

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2006-09-25 19:20:30 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060925192030-x9s2i4h7wlvsx7dy
Tags: 1.4.7-1
New upstream release. See the NEWS file for details.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# longlong.m4 serial 7
 
2
dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
 
3
dnl This file is free software; the Free Software Foundation
 
4
dnl gives unlimited permission to copy and/or distribute it,
 
5
dnl with or without modifications, as long as this notice is preserved.
 
6
 
 
7
dnl From Paul Eggert.
 
8
 
 
9
# Define HAVE_LONG_LONG_INT if 'long long int' works.
 
10
# This fixes a bug in Autoconf 2.60, but can be removed once we
 
11
# assume 2.61 everywhere.
 
12
 
 
13
AC_DEFUN([AC_TYPE_LONG_LONG_INT],
 
14
[
 
15
  AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
 
16
    [AC_LINK_IFELSE(
 
17
       [AC_LANG_PROGRAM(
 
18
          [[long long int ll = 9223372036854775807ll;
 
19
            long long int nll = -9223372036854775807LL;
 
20
            typedef int a[((-9223372036854775807LL < 0
 
21
                            && 0 < 9223372036854775807ll)
 
22
                           ? 1 : -1)];
 
23
            int i = 63;]],
 
24
          [[long long int llmax = 9223372036854775807ll;
 
25
            return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
 
26
                    | (llmax / ll) | (llmax % ll));]])],
 
27
       [ac_cv_type_long_long_int=yes],
 
28
       [ac_cv_type_long_long_int=no])])
 
29
  if test $ac_cv_type_long_long_int = yes; then
 
30
    AC_DEFINE([HAVE_LONG_LONG_INT], 1,
 
31
      [Define to 1 if the system has the type `long long int'.])
 
32
  fi
 
33
])
 
34
 
 
35
# This macro is obsolescent and should go away soon.
 
36
AC_DEFUN([gl_AC_TYPE_LONG_LONG],
 
37
[
 
38
  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
 
39
  ac_cv_type_long_long=$ac_cv_type_long_long_int
 
40
  if test $ac_cv_type_long_long = yes; then
 
41
    AC_DEFINE(HAVE_LONG_LONG, 1,
 
42
      [Define if you have the 'long long' type.])
 
43
  fi
 
44
])