Bruno Haible wrote:
> KO Myung-Hun posted:
>> 0001-sched-check-struct-sched_param-in-spawn.h-as-well.patch
> 
> Thanks. This looks much better now. Just two small improvements I'd like
> to ask for:
> 
> - In m4/sched_h.m4, can you bump the marker "sched_h.m4 serial 6"
>   to "sched_h.m4 serial 7"?
> 

No problem.

> - In lib/sched.in.h: We try to put all #includes before all type definitions
>   and variable/function declarations. (Otherwise the overriding of function
>   declarations may not work well in the long run.) Can you move the
>   #ifdef ... / # include <spawn.h>
>   near the #include <sys/types.h>, that is, before the
>   #if !@HAVE_STRUCT_SCHED_PARAM@
> 

Like this ?

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr

>From e3235540bbced75333c6b571dc8f71814c70a3be Mon Sep 17 00:00:00 2001
From: KO Myung-Hun <k...@chollian.net>
Date: Sat, 27 Apr 2013 15:33:09 +0900
Subject: [PATCH] sched: check struct sched_param in spawn.h as well

On OS/2 kLIBC, struct sched_param is in spawn.h. So without this a
redefinition error occurs when sched.h is inclued by spawn.h.

* lib/sched.in.h: Include spawn.h on kLIBC.
* lib/sched_h.m4: Check struct sched_param in spawn.h as well.
---
 lib/sched.in.h |  7 +++++++
 m4/sched_h.m4  | 15 +++++++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/lib/sched.in.h b/lib/sched.in.h
index edebf81..7be6761 100644
--- a/lib/sched.in.h
+++ b/lib/sched.in.h
@@ -35,6 +35,13 @@
    and Mac OS X 10.5.  */
 #include <sys/types.h>
 
+#ifdef __KLIBC__
+
+/* On OS/2 kLIBC, struct sched_param is in spawn.h */
+# include <spawn.h>
+
+#endif
+
 #if !@HAVE_STRUCT_SCHED_PARAM@
 
 # if !GNULIB_defined_struct_sched_param
diff --git a/m4/sched_h.m4 b/m4/sched_h.m4
index 329af35..49c10cc 100644
--- a/m4/sched_h.m4
+++ b/m4/sched_h.m4
@@ -1,4 +1,4 @@
-# sched_h.m4 serial 6
+# sched_h.m4 serial 7
 dnl Copyright (C) 2008-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -27,9 +27,16 @@ AC_DEFUN([gl_SCHED_H],
      fi
      AC_SUBST([HAVE_SCHED_H])
 
-     AC_CHECK_TYPE([struct sched_param],
-       [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
-       [#include <sched.h>])
+     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>])
+     else
+       dnl On OS/2 kLIBC, struct sched_param is in spawn.h.
+       AC_CHECK_TYPE([struct sched_param],
+         [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
+         [#include <spawn.h>])
+     fi
      AC_SUBST([HAVE_STRUCT_SCHED_PARAM])
 
      dnl Ensure the type pid_t gets defined.
-- 
1.8.5.2

Reply via email to