2016-09-24 Paul Eggert <eggert@cs.ucla.edu>
+ sched: port to GCC 6.2.1 on macOS Sierra
+ Problem reported by Denis Davydov in:
+ http://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00056.html
+ * lib/sched.in.h [HAVE_SYS_CDEFS_H]:
+ Include <sys/cdefs.h> before <sched.h>.
+ * m4/nproc.m4 (gl_PREREQ_NPROC): Include errno.h before sched.h,
+ so that we needn’t worry about the sched.h include bug here.
+ * m4/sched_h.m4 (gl_SCHED_H): Check for sys/cdefs.h,
+ and include it before <sched.h> if it exists, when
+ checking for <sched.h>.
+
tests/init.sh: port Alpine fix to AIX 7.1
* tests/init.sh (compare_): When attempting to use diff -U3,
prefer diff -u to -U3 to -c to plain diff. Do not insist on
-/* Replacement <sched.h> for platforms that lack it.
+/* A GNU-like <sched.h>.
Copyright (C) 2008-2016 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
/* The include_next requires a split double-inclusion guard. */
#if @HAVE_SCHED_H@
+# if @HAVE_SYS_CDEFS_H@
+# include <sys/cdefs.h>
+# endif
# @INCLUDE_NEXT@ @NEXT_SCHED_H@
#endif
-# nproc.m4 serial 4
+# nproc.m4 serial 5
dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
[gl_cv_func_sched_getaffinity3],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
- [[#include <sched.h>]],
+ [[#include <errno.h>
+ #include <sched.h>]],
[[sched_getaffinity (0, 0, (cpu_set_t *) 0);]])],
[gl_cv_func_sched_getaffinity3=yes],
[gl_cv_func_sched_getaffinity3=no])
-# sched_h.m4 serial 7
+# sched_h.m4 serial 8
dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_SCHED_H],
[
+ AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <sched.h>
]])],
[SCHED_H=''],
[SCHED_H='sched.h'
+ AC_CHECK_HEADERS([sched.h], [], [],
+ [[#if HAVE_SYS_CDEFS_H
+ #include <sys/cdefs.h>
+ #endif
+ ]])
+ gl_NEXT_HEADERS([sched.h])
- gl_CHECK_NEXT_HEADERS([sched.h])
-
- if test $ac_cv_header_sched_h = yes; then
+ if test "$ac_cv_header_sched_h" = yes; then
HAVE_SCHED_H=1
else
HAVE_SCHED_H=0
if test "$HAVE_SCHED_H" = 1; then
AC_CHECK_TYPE([struct sched_param],
[HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
- [#include <sched.h>])
+ [[#if HAVE_SYS_CDEFS_H
+ #include <sys/cdefs.h>
+ #endif
+ #include <sched.h>
+ ]])
else
dnl On OS/2 kLIBC, struct sched_param is in spawn.h.
AC_CHECK_TYPE([struct sched_param],