Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Oct 2000 11:25:38 -0700 (PDT)
From:      Archie Cobbs <archie@whistle.com>
To:        freebsd-net@freebsd.org, developers@freebsd.org
Subject:   header bogosity in <net/radix.h>
Message-ID:  <200010071825.e97IPcE01449@bubba.whistle.com>

next 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?

Thanks,
-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com


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?200010071825.e97IPcE01449>