home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16088 < prev    next >
Encoding:
Text File  |  1992-11-11  |  2.1 KB  |  57 lines

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