comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pogner.demon.co.uk>
Subject: Re: Package spec and body in C.
Date: 1997/09/30
Date: 1997-09-30T00:00:00+00:00	[thread overview]
Message-ID: <x7viuvih8pu.fsf@pogner.demon.co.uk> (raw)
In-Reply-To: 342BB433.15C6@admin.tc.faa.gov


Ron Thompson <thompsor@admin.tc.faa.gov> writes:

> J. M. Rayas wrote:
> I have done this to a variety of degrees.  The main trick is to have
> each header(.h) declare itself first thing.  That way other headers
> and bodies can simply ask 
> if(!thing_declared)
> 	#include thing.h;

The normal technique for this is to put the condition in the header
file (that stops the user having to worry about getting it right):

/* foo.h */
#ifndef __FOO_H__
#define __FOO_H__
...stuff...
#endif /* __FOO_H__ */

(actually, there are some rules to do with reserved names (names
starting with an underscore and a capital letter, or starting with
double underscore being reserved: I guess I should change to eg
_foo_h_ or something like that.)

-- 
Simon Wright                        Work Email: simon.j.wright@gecm.com
GEC-Marconi Radar & Defence Systems            Voice: +44(0)1705-701778
Command & Information Systems Divsion            FAX: +44(0)1705-701800




  reply	other threads:[~1997-09-30  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-25  0:00 Package spec and body in C J. M. Rayas
1997-09-26  0:00 ` Ron Thompson
1997-09-30  0:00   ` Simon Wright [this message]
1997-09-29  0:00 ` Eric W. Nikitin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox