From owner-freebsd-net Sat Oct 7 17: 9:31 2000 Delivered-To: freebsd-net@freebsd.org Received: from coconut.itojun.org (coconut.itojun.org [210.160.95.97]) by hub.freebsd.org (Postfix) with ESMTP id 0E3D137B681; Sat, 7 Oct 2000 17:05:55 -0700 (PDT) Received: from kiwi.itojun.org (localhost.itojun.org [127.0.0.1]) by coconut.itojun.org (8.9.3+3.2W/3.7W) with ESMTP id JAA06053; Sun, 8 Oct 2000 09:05:49 +0900 (JST) To: Archie Cobbs Cc: freebsd-net@freebsd.org, developers@freebsd.org In-reply-to: archie's message of Sat, 07 Oct 2000 11:25:38 MST. <200010071825.e97IPcE01449@bubba.whistle.com> X-Template-Reply-To: itojun@itojun.org X-Template-Return-Receipt-To: itojun@itojun.org X-PGP-Fingerprint: F8 24 B4 2C 8C 98 57 FD 90 5F B4 60 79 54 16 E2 Subject: Re: header bogosity in From: itojun@iijlab.net Date: Sun, 08 Oct 2000 09:05:49 +0900 Message-ID: <6051.970963549@coconut.itojun.org> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >In 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