+2018-02-03 Bruno Haible <bruno@clisp.org>
+
+ stdlib: Fix compilation error on OpenIndiana.
+ * lib/stdlib.in.h: Before including <sys/loadavg.h>, include
+ <sys/time.h>.
+ * m4/stdlib_h.m4 (gl_STDLIB_H): Likewise.
+ * m4/getloadavg.m4 (gl_GETLOADAVG): Likewise.
+
2018-02-03 Bruno Haible <bruno@clisp.org>
host-cpu-c-abi: Avoid use of 'grep -E' on OpenIndiana.
/* Solaris declares getloadavg() in <sys/loadavg.h>. */
#if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
+/* OpenIndiana has a bug: <sys/time.h> must be included before
+ <sys/loadavg.h>. */
+# include <sys/time.h>
# include <sys/loadavg.h>
#endif
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-#serial 6
+#serial 7
# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
# New applications should use gl_GETLOADAVG instead.
fi
AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0],
[[#if HAVE_SYS_LOADAVG_H
+ /* OpenIndiana has a bug: <sys/time.h> must be included before
+ <sys/loadavg.h>. */
+ # include <sys/time.h>
# include <sys/loadavg.h>
#endif
#include <stdlib.h>]])
-# stdlib_h.m4 serial 44
+# stdlib_h.m4 serial 45
dnl Copyright (C) 2007-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,
dnl guaranteed by C89.
gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
#if HAVE_SYS_LOADAVG_H
+/* OpenIndiana has a bug: <sys/time.h> must be included before
+ <sys/loadavg.h>. */
+# include <sys/time.h>
# include <sys/loadavg.h>
#endif
#if HAVE_RANDOM_H