From owner-freebsd-net Mon Mar 6 1:23:59 2000 Delivered-To: freebsd-net@freebsd.org Received: from relay.wplus.net (relay.wplus.net [195.131.52.179]) by hub.freebsd.org (Postfix) with ESMTP id AB46B37BC88 for ; Mon, 6 Mar 2000 01:23:39 -0800 (PST) (envelope-from dms@woland.wplus.net) Received: from woland.wplus.net (woland.wplus.net [195.131.0.39]) by relay.wplus.net (8.9.1/8.9.1/wplus.2) with ESMTP id MAA88035; Mon, 6 Mar 2000 12:21:54 +0300 (MSK) X-Real-To: freebsd-net@FreeBSD.ORG Received: (from dms@localhost) by woland.wplus.net (8.9.3/8.9.1/wplus.2) id MAA71825; Mon, 6 Mar 2000 12:23:18 +0300 (MSK) Message-ID: X-Mailer: XFMail 1.4.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Mon, 06 Mar 2000 12:23:17 +0300 (MSK) From: Dmitry Samersoff To: gbnaidu , gbnaidu@sasi.com Subject: RE: How do I do this...? Cc: freebsd-net@FreeBSD.ORG Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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