home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!uunet.ca!ohrd!twriter
- From: twriter@rd.hydro.on.ca (Timothy Writer)
- Subject: Re: Survey: File Extension
- Message-ID: <1992Dec14.211010.10318@rd.hydro.on.ca>
- Reply-To: twriter@rd.hydro.on.ca
- Organization: "Ontario Hydro - Research Division"
- References: <1gb1h0INNle2@tsavo.hks.com> <78146@hydra.gatech.EDU> <stanleyr.724172017@kramden> <Bz80Bu.HI4@knot.ccs.queensu.ca> <WARSAW.92Dec14101955@anthem.nlm.nih.gov>
- Date: Mon, 14 Dec 92 21:10:10 GMT
- Lines: 35
-
- warsaw@nlm.nih.gov (Barry A. Warsaw) writes:
-
-
- >Should the .h file extension matter? Do compilers supporting
- >pre-compiled headers need to know the extension for header files?
- >Just wondering 'cause we use .cc and .hh
-
- Is there a good reason for having separate extensions for C and C++
- header files? Why not share header files between C and C++ like so:
-
- #ifdef __cplusplus
- // C++ interface
- extern "C" {
- #else
- // C interface
- #endif
- #ifdef __cplusplus
- }
- #endif
-
- One situation where I have found it useful to have separate extensions
- is for editors which choose a mode based on the extension. However, I
- get around this with GNU emacs using file local variables e.g.
-
- // Local Variables:
- // mode: c++
- // End:
-
- Tim
-
- --
- Tim Writer phone: (416) 231-4111 ext. 6990
- Ontario Hydro Research Division fax: (416) 237-9285
- Toronto, Ontario e-mail: twriter@rd.hydro.on.ca
- CANADA
-