Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 08 Oct 2000 09:05:49 +0900
From:      itojun@iijlab.net
To:        Archie Cobbs <archie@whistle.com>
Cc:        freebsd-net@freebsd.org, developers@freebsd.org
Subject:   Re: header bogosity in <net/radix.h>
Message-ID:  <6051.970963549@coconut.itojun.org>
In-Reply-To: archie's message of Sat, 07 Oct 2000 11:25:38 MST. <200010071825.e97IPcE01449@bubba.whistle.com>

next in thread | previous in thread | raw e-mail | index | archive | help

>In <net/radix.h> the following appears:
>
>  #ifndef _KERNEL
>  #define Bcmp(a, b, n) bcmp(((char *)(a)), ((char *)(b)), (n))
>  #define Bcopy(a, b, n) bcopy(((char *)(a)), ((char *)(b)), (unsigned)(n))
>  #define Bzero(p, n) bzero((char *)(p), (int)(n));
>  #define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n)))
>  #define Free(p) free((char *)p);
>  #else
>  #define Bcmp(a, b, n) bcmp(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n))
>  #define Bcopy(a, b, n) bcopy(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n))
>  #define Bzero(p, n) bzero((caddr_t)(p), (unsigned)(n));
>  #define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_DONTWAIT))
>  #define Free(p) free((caddr_t)p, M_RTABLE);
>  #endif /* _KERNEL */
>
>Isn't this bogus? For example, it conflicts with any program that
>#defines Free() for itself. Apparenly some of these C files
>(sys/net/radix.c, sys/net/route.c, sys/net/rtsock.c) are used in
>both kernel and userland compilation.
>
>What is the correct way to do this?

	I had the same problem with compiling with openssl headers, on netbsd.

	if i were you, i'd remove "!_KERNEL" case, and define those in kernel
	compilation only.

itoj


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6051.970963549>