~ubuntu-branches/ubuntu/lucid/mpop/lucid

« back to all changes in this revision

Viewing changes to gnulib/m4/longlong.m4

  • Committer: Bazaar Package Importer
  • Author(s): Julien Louis
  • Date: 2007-04-22 11:10:07 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070422111007-zxauoipdhkj9lasp
Tags: 1.0.9-1
New upstream release which include a fix for for CVE2007-1558.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# longlong.m4 serial 8
 
1
# longlong.m4 serial 10
2
2
dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
11
11
# assume 2.61 everywhere.
12
12
 
13
13
# Note: If the type 'long long int' exists but is only 32 bits large
14
 
# (as on some very old compilers), AC_TYPE_LONG_LONG_INT will not be
 
14
# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
15
15
# defined. In this case you can treat 'long long int' like 'long int'.
16
16
 
17
17
AC_DEFUN([AC_TYPE_LONG_LONG_INT],
28
28
          [[long long int llmax = 9223372036854775807ll;
29
29
            return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
30
30
                    | (llmax / ll) | (llmax % ll));]])],
31
 
       [ac_cv_type_long_long_int=yes],
 
31
       [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
 
32
        dnl If cross compiling, assume the bug isn't important, since
 
33
        dnl nobody cross compiles for this platform as far as we know.
 
34
        AC_RUN_IFELSE(
 
35
          [AC_LANG_PROGRAM(
 
36
             [[@%:@include <limits.h>
 
37
               @%:@ifndef LLONG_MAX
 
38
               @%:@ define HALF \
 
39
                        (1LL << (sizeof (long long int) * CHAR_BIT - 2))
 
40
               @%:@ define LLONG_MAX (HALF - 1 + HALF)
 
41
               @%:@endif]],
 
42
             [[long long int n = 1;
 
43
               int i;
 
44
               for (i = 0; ; i++)
 
45
                 {
 
46
                   long long int m = n << i;
 
47
                   if (m >> i != n)
 
48
                     return 1;
 
49
                   if (LLONG_MAX / 2 < m)
 
50
                     break;
 
51
                 }
 
52
               return 0;]])],
 
53
          [ac_cv_type_long_long_int=yes],
 
54
          [ac_cv_type_long_long_int=no],
 
55
          [ac_cv_type_long_long_int=yes])],
32
56
       [ac_cv_type_long_long_int=no])])
33
57
  if test $ac_cv_type_long_long_int = yes; then
34
58
    AC_DEFINE([HAVE_LONG_LONG_INT], 1,