From ab4b1f3d4e517a0948fce56d6c0ac0995fd5133b Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 3 Feb 2018 14:05:45 +0100 Subject: [PATCH] stdlib: Fix compilation error on OpenIndiana. * lib/stdlib.in.h: Before including , include . * m4/stdlib_h.m4 (gl_STDLIB_H): Likewise. * m4/getloadavg.m4 (gl_GETLOADAVG): Likewise. --- ChangeLog | 8 ++++++++ lib/stdlib.in.h | 3 +++ m4/getloadavg.m4 | 5 ++++- m4/stdlib_h.m4 | 5 ++++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2bcb82c3c0..56b7de8f97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2018-02-03 Bruno Haible + + stdlib: Fix compilation error on OpenIndiana. + * lib/stdlib.in.h: Before including , include + . + * m4/stdlib_h.m4 (gl_STDLIB_H): Likewise. + * m4/getloadavg.m4 (gl_GETLOADAVG): Likewise. + 2018-02-03 Bruno Haible host-cpu-c-abi: Avoid use of 'grep -E' on OpenIndiana. diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index b9701d5b28..c8a5d0d0c6 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -47,6 +47,9 @@ /* Solaris declares getloadavg() in . */ #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@ +/* OpenIndiana has a bug: must be included before + . */ +# include # include #endif diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 index acc266531e..7b6a09a5c5 100644 --- a/m4/getloadavg.m4 +++ b/m4/getloadavg.m4 @@ -7,7 +7,7 @@ # 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. @@ -92,6 +92,9 @@ else fi AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0], [[#if HAVE_SYS_LOADAVG_H + /* OpenIndiana has a bug: must be included before + . */ + # include # include #endif #include ]]) diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index eff6f9e685..49dc5d59cb 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,4 +1,4 @@ -# 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, @@ -14,6 +14,9 @@ AC_DEFUN([gl_STDLIB_H], dnl guaranteed by C89. gl_WARN_ON_USE_PREPARE([[#include #if HAVE_SYS_LOADAVG_H +/* OpenIndiana has a bug: must be included before + . */ +# include # include #endif #if HAVE_RANDOM_H -- 2.39.5