home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!bnrgate!bcrka451!bcrki65!sjm
- From: sjm@bcrki65.bnr.ca (Stuart MacMartin)
- Subject: Re: Multiple Header Files Problem
- Message-ID: <1992Nov11.141658.11191@bcrka451.bnr.ca>
- Sender: 5E00 Corkstown News Server
- Organization: Bell-Northern Research Ltd., Ottawa, Canada
- References: <rmartin.721442494@thor> <1992Nov11.015747.20842@fcom.cc.utah.edu>
- Date: Wed, 11 Nov 1992 14:16:58 GMT
- Lines: 45
-
- In article <1992Nov11.015747.20842@fcom.cc.utah.edu> swillden@icarus.weber.edu writes:
- >rmartin@thor.Rational.COM (Bob Martin) writes:
- >: reindorf@us-es.sel.de (Charles Reindorf) writes:
- >:
- >: |In article <rmartin.721359424@thor>, rmartin@thor.Rational.COM (Bob Martin) writes:
- >: ||> A more interesting variation on this issue is the problem of "circular
- >: |It is usual, in header files, to structure them so :
- >:
- >: || # ifndef <HeaderFileName>_h
- >: || # define <HeaderFileName>_h
- >: || ... body of include file ...
- >: || # endif
- >:
- >
- >#ifndef SOMEFILE_H
- >#include "somefile.h"
- >#endif
- >
-
- ...and others have mentioned _A_H and _a_h, a_inc. I have also seen
- HEADERFILENAME with no _H. This lack of standard makes it difficult to
- follow one poster's suggestion of wrapping the #include with a test
- (but I see no real reason to do that anyway). It also makes it difficult
- when trying to test if a system include file has been included (which I
- sometimes have to do due to platform differences): every workstation
- seems to have a different convention for wrapping their include files!
-
- On the other hand, everyone has used
-
- # ifndef
-
- and nobody has used
-
- # if !defined
-
- Just curious: I have always used #if defined and #if !defined, having
- noted the ANSI recommendations even many years ago, and all of our C
- compilers have always supported this. Weren't #ifdef and #ifndef supposed to
- go the way of the dodo (in new code, if not in compilers)?
-
- Stuart
- --
- : Stuart MacMartin email: sjm@bnr.ca :
- : Bell-Northern Research phone: (613) 763-5625 :
- : PO Box 3511, Stn C, Ottawa, K1Y-4H7, CANADA Standard disclaimers apply. :
-