[LC++]Producing a log of routine entry and exit

Vincent Penquerc'h Vincent.Penquerch at artworks.co.uk
Wed Sep 4 19:16:06 UTC 2002


> Just a couple of minor questions.  Is "sys.h" the best
> name for this file?  Ie, couldn't it be confused with
> /usr/include/linux/sys.h?  Perhaps "umbrella.h" would be
> a better name?  But on the other hand, maybe "sys.h"
> is the psuedo standard name for it???

Personally, my current project uses "system.h".
If you make sure your include paths are correct, the "" and <>
should take care of ambiguities between your files and the
system files.

> The other minor question is...  Is there any particular advantage
> in using 
> 
> > #ifndef MYAPP_HEADENAME_H
> > #define MYAPP_HEADENAME_H
> 
> rather than just
> 
> #ifndef HEADERNAME_H
> #define HEADERNAME_H
> 
> I guess it means it makes it clear which project the header is
> associated with.  But why not do the same with the filename?  Eg
> you could have "myapp_sys.h".

You could also make a script to create a header file, which would
create a random identifier using /dev/[u]random. The main point of
such directives is to make sure the contents of the file is not
preprocessed twice, so the most information you can put in it, the
better, I think. Also, probably don't put the project name if you
think you'll refactor this file in a lib afterwards :)

-- 
Vincent Penquerc'h 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/tuxcpprogramming/attachments/20020904/174e9ec7/attachment.htm 


More information about the tuxCPProgramming mailing list