DragonFly BSD
DragonFly commits List (threaded) for 2004-12
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/sys/net


From: YONETANI Tomokazu <qhwt+dfly@xxxxxxxxxx>
Date: Thu, 16 Dec 2004 12:30:31 +0900

On Tue, Dec 14, 2004 at 11:32:26PM -0800, Jeffrey Hsu wrote:
> hsu         2004/12/14 23:32:26 PST
> 
> DragonFly src repository
> 
>   Modified files:
>     sys/net              radix.h 
>   Log:
>   Patch up user/kernel space difference with boolean types.
>   
>   Reported by:  Simon 'corecode' Schubert <corecode@xxxxxxxxxxxx>
>   
>   Revision  Changes    Path
>   1.7       +2 -0      src/sys/net/radix.h
> 
> 
> http://www.dragonflybsd.org/cvsweb/src/sys/net/radix.h.diff?r1=1.6&r2=1.7&f=u

<stdbool.h> has an ugly side-effect of defining a macro
  #define bool	_Bool
and this breaks the following place in src/usr.sbin/mrouted/kern.c:

  void
  k_hdr_include(int bool)

So I'd rather suggest rolling your own boolean_t in radix.h(provided
you can't move boolean_t out of `#ifdef _KERNEL' conditional
in /sys/sys/types.h) for !_KERNEL case.

Index: radix.h
===================================================================
RCS file: /dragonfly/cvs/src/sys/net/radix.h,v
retrieving revision 1.7
diff -u -r1.7 radix.h
--- radix.h	15 Dec 2004 07:32:26 -0000	1.7
+++ radix.h	16 Dec 2004 03:21:44 -0000
@@ -150,10 +150,9 @@
 };
 
 #ifndef _KERNEL
-#include <stdbool.h>
-#define boolean_t bool
 #define R_Malloc(p, t, n) (p = (t) malloc((n)))
 #define Free(p) free(p);
+typedef int boolean_t;
 #else
 #define R_Malloc(p, t, n) (p = (t) malloc((n), M_RTABLE, M_INTWAIT | M_NULLOK))
 #define Free(p) free(p, M_RTABLE);



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]