+2018-05-13 Bruno Haible <bruno@clisp.org>
+
+ imaxdiv: Fix compilation error on Android.
+ * m4/imaxdiv.m4 (gl_FUNC_IMAXDIV): Set HAVE_IMAXDIV_T to 0 if imaxdiv_t
+ is not defined.
+ * lib/inttypes.in.h (imaxdiv_t): Define if HAVE_IMAXDIV_T, not
+ HAVE_DECL_IMAXDIV, is 0.
+ * m4/inttypes.m4 (gl_INTTYPES_H_DEFAULTS): Initialize HAVE_IMAXDIV_T.
+ * modules/inttypes-incomplete (Makefile.am): Substitute HAVE_IMAXDIV_T.
+
2018-05-13 Bruno Haible <bruno@clisp.org>
Support selective inclusion mechanism of recent mingw.org header files.
#endif
#if @GNULIB_IMAXDIV@
-# if !@HAVE_DECL_IMAXDIV@
+# if !@HAVE_IMAXDIV_T@
# if !GNULIB_defined_imaxdiv_t
typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
# define GNULIB_defined_imaxdiv_t 1
# endif
+# endif
+# if !@HAVE_DECL_IMAXDIV@
extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
# endif
#elif defined GNULIB_POSIXCHECK
-# imaxdiv.m4 serial 4
+# imaxdiv.m4 serial 5
dnl Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
if test "$ac_cv_have_decl_imaxdiv" != yes; then
HAVE_DECL_IMAXDIV=0
fi
+
+ AC_CACHE_CHECK([whether <inttypes.h> defines imaxdiv_t],
+ [gl_cv_type_imaxdiv_t],
+ [dnl Assume that if imaxdiv is declared, imaxdiv_t is defined.
+ if test $ac_cv_have_decl_imaxdiv = yes; then
+ gl_cv_type_imaxdiv_t=yes
+ else
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <inttypes.h>
+ imaxdiv_t x;
+ ]])
+ ],
+ [gl_cv_type_imaxdiv_t=yes],
+ [gl_cv_type_imaxdiv_t=no])
+ fi
+ ])
+ if test $gl_cv_type_imaxdiv_t = no; then
+ HAVE_IMAXDIV_T=0
+ fi
])
# Prerequisites of lib/imaxdiv.c.
-# inttypes.m4 serial 26
+# inttypes.m4 serial 27
dnl Copyright (C) 2006-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV])
HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
+ HAVE_IMAXDIV_T=1; AC_SUBST([HAVE_IMAXDIV_T])
REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX])
REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX])
INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
-e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
-e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
-e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
+ -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
-e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
-e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
-e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \