Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 25 Feb 2012 09:44:33 -0600 Message-ID: <4F4901E7.5DFD@mindspring.com> Date: Sat, 25 Feb 2012 10:44:39 -0500 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: macro prototype References: <8eb7078a-779c-4baa-92aa-0bacac4885ff@r1g2000yqk.googlegroups.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 23 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.222.31 X-Trace: sv3-mWDPFHUSO+R9p1MumbOx/lESlH38ExJDSnLr5RbwCpsOW78N4a6bLWIUEw4UN79ipgSDN14llCSSY03!Zxfhes1FAlm3P0+Gqr0R95SzUoQA1DORt5DiHzww/ZvI0Rar8qohBJdPb0tPil/+GjJgHJINHgQ/!TkKc2q0LNQ== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1811 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:17931 ashu wrote: > > Hi all, > I want to use a macro which I want to define in a .c(lets call it > macro.c) file instead of a .h(macro.h) file because it uses some local > variables which are defined in the .c file. However I want this macro > to be visible to other files which will include the > corresponding .h(macro.h) file. > > The problem here is since the macro is defined in the macro.c file and > there is no way I can declare a prototype of the macro in the macro.h > file, this macro cannot be invoked by other files since the other > files simply include the macro.h file. > > Is there anyway I can get around this problem ? Declare the local variables as "extern" in the macro.h file and define the macro in macro.h also. -- pete