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
16 case "$gl_cv_onwards_func_imaxdiv" in
17 future*) REPLACE_IMAXDIV=1 ;;
20 AC_CHECK_DECLS_ONCE([imaxdiv])
21 if test "$ac_cv_have_decl_imaxdiv" != yes; then
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
33 [[#include <inttypes.h>
37 [gl_cv_type_imaxdiv_t=yes],
38 [gl_cv_type_imaxdiv_t=no])
41 if test $gl_cv_type_imaxdiv_t = no; then
46 # Prerequisites of lib/imaxdiv.c.
47 AC_DEFUN([gl_PREREQ_IMAXDIV], [:])