]> Savannah Git Hosting - gnulib.git/commitdiff
stdlib: Fix compilation error on OpenIndiana.
authorBruno Haible <bruno@clisp.org>
Sat, 3 Feb 2018 13:05:45 +0000 (14:05 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 3 Feb 2018 13:05:45 +0000 (14:05 +0100)
* 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.

ChangeLog
lib/stdlib.in.h
m4/getloadavg.m4
m4/stdlib_h.m4

index 2bcb82c3c01e325863ffacaebbae3a30bf71453f..56b7de8f97b928df5e83c216cedfbd628e8ee97f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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.
index b9701d5b287e38ee9eae5069ce4d801efb2c85ce..c8a5d0d0c61179b77c882e3be6f33799fa5e228a 100644 (file)
@@ -47,6 +47,9 @@
 
 /* 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
 
index acc266531ed7e5670c092631a86ace3596c84fc5..7b6a09a5c5b6aaf390f7b52c4a1705b4ac02d29a 100644 (file)
@@ -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: <sys/time.h> must be included before
+       <sys/loadavg.h>.  */
+    # include <sys/time.h>
     # include <sys/loadavg.h>
     #endif
     #include <stdlib.h>]])
index eff6f9e685b1eed9211d2b0b9f85e7e0d9b8ff1b..49dc5d59cbe197b698c2792ff74780f4a56ada27 100644 (file)
@@ -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 <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