Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Mar 2000 12:23:17 +0300 (MSK)
From:      Dmitry Samersoff <dms@wplus.net>
To:        gbnaidu <gbnaidu@my-Deja.com>, gbnaidu@sasi.com
Cc:        freebsd-net@FreeBSD.ORG
Subject:   RE: How do I do this...?
Message-ID:  <XFMail.20000306122317.dms@wplus.net>
In-Reply-To: <AHDLHFIDNMHFDCAA@my-deja.com>

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

On 06-Mar-2000 gbnaidu wrote:
> Hi 
> 
> I have some requirement like this:
> 
> I have two sets of files. Assume A and B. The function names are same in both
> sets but their implementation is different. If I want to compile/call
> functions from one set(A) depending on a macro of sort: #ifdef A, how do I
> compile these files in kernel?
> 
> Can somebosdy give me some idea of how to compile these files conditionally?

One method is:
 name your functions _A_funcname(),_B_funcname()
 
and define macro

#ifdef A
# define function _A_funcname()
#else
# define function _B_funcname()
#endif

Anothe method is:

stube.c:
#ifdef A
# include "A_functions.c"
#else
# include "B_functions.c"
#endif


-- 
Dmitry Samersoff, dms@wplus.net, ICQ:3161705
http://devnull.wplus.net
* There will come soft rains ...


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?XFMail.20000306122317.dms>