]> Dogcows Code - chaz/tar/blob - m4/xstrtoimax.m4
(file_count_links): do nothing if hard_dereference_option is set.
[chaz/tar] / m4 / xstrtoimax.m4
1 #serial 2
2 dnl Cloned from xstrtoumax.m4. Keep these files in sync.
3
4 # autoconf tests required for use of xstrtoimax.c
5
6 AC_DEFUN([jm_AC_PREREQ_XSTRTOIMAX],
7 [
8 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
9 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
10 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
11 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
12 AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoimax, strtoumax])
13 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
14
15 AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro],
16 jm_cv_func_strtoimax_macro,
17 AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h>
18 #ifdef strtoimax
19 inttypes_h_defines_strtoimax
20 #endif],
21 jm_cv_func_strtoimax_macro=yes,
22 jm_cv_func_strtoimax_macro=no))
23
24 if test "$jm_cv_func_strtoimax_macro" != yes; then
25 AC_REPLACE_FUNCS(strtoimax)
26 fi
27
28 dnl Only the replacement strtoimax invokes strtol and strtoll,
29 dnl so we need the replacements only if strtoimax does not exist.
30 case "$jm_cv_func_strtoimax_macro,$ac_cv_func_strtoimax" in
31 no,no)
32 AC_REPLACE_FUNCS(strtol)
33
34 dnl We don't need (and can't compile) the replacement strtoll
35 dnl unless the type `long long' exists.
36 if test "$ac_cv_type_long_long" = yes; then
37 AC_REPLACE_FUNCS(strtoll)
38 fi
39 ;;
40 esac
41 ])
This page took 0.037839 seconds and 4 git commands to generate.