From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5f748ee50b1a42ac X-Google-Attributes: gid103376,public From: Simon Wright Subject: Re: Package spec and body in C. Date: 1997/09/30 Message-ID: #1/1 X-Deja-AN: 276834364 X-NNTP-Posting-Host: pogner.demon.co.uk [158.152.70.98] References: <342AC9A5.7CAECFA6@jpl.nasa.gov> <342BB433.15C6@admin.tc.faa.gov> Organization: At Home Newsgroups: comp.lang.ada Date: 1997-09-30T00:00:00+00:00 List-Id: Ron Thompson 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