mcel: port to uClibc-ng
[gnulib.git] / m4 / imaxdiv.m4
blob6b967081f07c3a11566cec733d938d40b62f3408
1 # imaxdiv.m4
2 # serial 7
3 dnl Copyright (C) 2006, 2009-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_FUNC_IMAXDIV],
10   AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
12   dnl On OSF/1 5.1 with cc, this function is declared but not defined.
13   gl_CHECK_FUNCS_ANDROID([imaxdiv], [[#include <inttypes.h>]])
14   if test $ac_cv_func_imaxdiv = no; then
15     HAVE_IMAXDIV=0
16     case "$gl_cv_onwards_func_imaxdiv" in
17       future*) REPLACE_IMAXDIV=1 ;;
18     esac
19   fi
20   AC_CHECK_DECLS_ONCE([imaxdiv])
21   if test "$ac_cv_have_decl_imaxdiv" != yes; then
22     HAVE_DECL_IMAXDIV=0
23   fi
25   AC_CACHE_CHECK([whether <inttypes.h> defines imaxdiv_t],
26     [gl_cv_type_imaxdiv_t],
27     [dnl Assume that if imaxdiv is declared, imaxdiv_t is defined.
28      if test $ac_cv_have_decl_imaxdiv = yes; then
29        gl_cv_type_imaxdiv_t=yes
30      else
31        AC_COMPILE_IFELSE(
32          [AC_LANG_PROGRAM(
33             [[#include <inttypes.h>
34               imaxdiv_t x;
35             ]])
36          ],
37          [gl_cv_type_imaxdiv_t=yes],
38          [gl_cv_type_imaxdiv_t=no])
39      fi
40     ])
41   if test $gl_cv_type_imaxdiv_t = no; then
42     HAVE_IMAXDIV_T=0
43   fi
46 # Prerequisites of lib/imaxdiv.c.
47 AC_DEFUN([gl_PREREQ_IMAXDIV], [:])