Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #17931

Re: macro prototype

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> (permalink)
Date Sat, 25 Feb 2012 10:44:39 -0500
From pete <pfiland@mindspring.com>
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

Show key headers only | View raw


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

Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

macro prototype ashu <ashutosh.ghildiyal@gmail.com> - 2012-02-24 02:36 -0800
  Re: macro prototype Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-24 03:34 -0800
  Re: macro prototype Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-02-24 11:38 +0000
  Re: macro prototype Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-02-24 07:49 -0500
    Re: macro prototype ashu <ashutosh.ghildiyal@gmail.com> - 2012-02-24 08:31 -0800
  Re: macro prototype Ya Shou <shouyatf@gmail.com> - 2012-02-25 05:52 -0800
  Re: macro prototype pete <pfiland@mindspring.com> - 2012-02-25 10:44 -0500

csiph-web