home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 17941 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.4 KB  |  47 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!uunet.ca!ohrd!twriter
  3. From: twriter@rd.hydro.on.ca (Timothy Writer)
  4. Subject: Re: Survey: File Extension
  5. Message-ID: <1992Dec14.211010.10318@rd.hydro.on.ca>
  6. Reply-To: twriter@rd.hydro.on.ca
  7. Organization: "Ontario Hydro - Research Division"
  8. References: <1gb1h0INNle2@tsavo.hks.com> <78146@hydra.gatech.EDU>     <stanleyr.724172017@kramden> <Bz80Bu.HI4@knot.ccs.queensu.ca> <WARSAW.92Dec14101955@anthem.nlm.nih.gov>
  9. Date: Mon, 14 Dec 92 21:10:10 GMT
  10. Lines: 35
  11.  
  12. warsaw@nlm.nih.gov (Barry A. Warsaw) writes:
  13.  
  14.  
  15. >Should the .h file extension matter?  Do compilers supporting
  16. >pre-compiled headers need to know the extension for header files?
  17. >Just wondering 'cause we use .cc and .hh
  18.  
  19. Is there a good reason for having separate extensions for C and C++
  20. header files?  Why not share header files between C and C++ like so:
  21.  
  22.     #ifdef __cplusplus
  23.         // C++ interface
  24.     extern "C" {
  25.     #else
  26.         // C interface
  27.     #endif
  28.     #ifdef __cplusplus
  29.     }
  30.     #endif
  31.  
  32. One situation where I have found it useful to have separate extensions
  33. is for editors which choose a mode based on the extension.  However, I
  34. get around this with GNU emacs using file local variables e.g.
  35.  
  36.     // Local Variables:
  37.     // mode: c++
  38.     // End:
  39.  
  40. Tim
  41.  
  42. -- 
  43. Tim Writer                 phone:  (416) 231-4111 ext. 6990
  44. Ontario Hydro Research Division         fax:    (416) 237-9285
  45. Toronto, Ontario             e-mail: twriter@rd.hydro.on.ca
  46. CANADA
  47.