~ubuntu-branches/ubuntu/trusty/tcpreen/trusty

« back to all changes in this revision

Viewing changes to m4/intdiv0.m4

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Capella Silva
  • Date: 2010-09-04 21:47:45 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100904214745-zbmkgvzjpx3e9lzc
Tags: 1.4.4-1
* New upstream release
* New maintainer. Closes: #581386.
* Switch to dpkg-source 3.0 (quilt) format.
* Upadate debian/watch.
* Standard-Versions updated to 3.9.1.
* debian/control, debian/compat: bump to DH7.
* debian/copyright updated to DEP5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# intdiv0.m4 serial 1 (gettext-0.11.3)
2
 
dnl Copyright (C) 2002 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 Bruno Haible.
8
 
 
9
 
AC_DEFUN([gt_INTDIV0],
10
 
[
11
 
  AC_REQUIRE([AC_PROG_CC])dnl
12
 
  AC_REQUIRE([AC_CANONICAL_HOST])dnl
13
 
 
14
 
  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
15
 
    gt_cv_int_divbyzero_sigfpe,
16
 
    [
17
 
      AC_TRY_RUN([
18
 
#include <stdlib.h>
19
 
#include <signal.h>
20
 
 
21
 
static void
22
 
#ifdef __cplusplus
23
 
sigfpe_handler (int sig)
24
 
#else
25
 
sigfpe_handler (sig) int sig;
26
 
#endif
27
 
{
28
 
  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
29
 
  exit (sig != SIGFPE);
30
 
}
31
 
 
32
 
int x = 1;
33
 
int y = 0;
34
 
int z;
35
 
int nan;
36
 
 
37
 
int main ()
38
 
{
39
 
  signal (SIGFPE, sigfpe_handler);
40
 
/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
41
 
#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
42
 
  signal (SIGTRAP, sigfpe_handler);
43
 
#endif
44
 
/* Linux/SPARC yields signal SIGILL.  */
45
 
#if defined (__sparc__) && defined (__linux__)
46
 
  signal (SIGILL, sigfpe_handler);
47
 
#endif
48
 
 
49
 
  z = x / y;
50
 
  nan = y / y;
51
 
  exit (1);
52
 
}
53
 
], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
54
 
        [
55
 
          # Guess based on the CPU.
56
 
          case "$host_cpu" in
57
 
            alpha* | i[34567]86 | m68k | s390*)
58
 
              gt_cv_int_divbyzero_sigfpe="guessing yes";;
59
 
            *)
60
 
              gt_cv_int_divbyzero_sigfpe="guessing no";;
61
 
          esac
62
 
        ])
63
 
    ])
64
 
  case "$gt_cv_int_divbyzero_sigfpe" in
65
 
    *yes) value=1;;
66
 
    *) value=0;;
67
 
  esac
68
 
  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
69
 
    [Define if integer division by zero raises signal SIGFPE.])
70
 
])