File: acx_std_abs.m4

package info (click to toggle)
madness 0.10.1%2Bgit20200818.eee5fd9f-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 34,980 kB
  • sloc: cpp: 280,841; ansic: 12,626; python: 4,961; fortran: 4,245; xml: 1,053; makefile: 714; sh: 276; perl: 244; yacc: 227; lex: 188; asm: 141; csh: 55
file content (27 lines) | stat: -rw-r--r-- 857 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
AC_DEFUN([ACX_STD_ABS], [
    AC_MSG_CHECKING([std::abs(long)])
    AC_LANG_PUSH([C++])
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <cmath>
#include <cstdlib>
long (*absptr)(long) = &std::abs; 
long a = -1;  
long b = std::abs(a);
]])],
                   [AC_DEFINE(HAVE_STD_ABS_LONG,[1],[Define if have std::abs(long)]) have_abs_long=yes],
                   [have_abs_long=no])
    AC_MSG_RESULT([$have_abs_long])
    if test X"$have_abs_long" = Xno; then
        AC_MSG_CHECKING([std::labs(long)])
        AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <cmath>
#include <cstdlib>
long (*labsptr)(long) = &std::labs; 
long a = -1l;  
long b = labs(a);
]])],
                       [AC_DEFINE(HAVE_LABS,[1],[Define if have std::labs(long)]) have_std_labs=yes],
                       [have_std_labs=no])
        AC_MSG_RESULT([$have_std_labs])
    fi
])