#ifdef vs #if for feature checks

Tor Lillqvist tml at iki.fi
Mon Mar 18 03:23:27 PDT 2013


> Sounds great to me too; though of course I'd prefer to keep the diff
> smaller and not replace all the header guards:
>
> #ifndef INCLUDED_OOXML_FAST_CONTEXT_HANDLER_HXX
> #define INCLUDED_OOXML_FAST_CONTEXT_HANDLER_HXX

Oh the other hand, it would be nice if the header guards were
consistently named... and didn't start with an underscore (such
identifiers are supposed to be reserved for the language and/or OS
implementation, unless I am mistaken). Somebody just needs to come up
with a consistent naming style and do it (with some nice script). (The
style of above example would be fine with me.)

Currently many of the header guards have names that indicate an
obsolete location of the header file, like _SV_SALGDI_HXX even though
the file in question is not in any "sv" folder but in vcl/inc.

Yeah, I guess such cosmetic changes can be seen as totally pointless
and a waste of time... on the other hand, if a hundred developers all
get annoyed for a few seconds once a week when they see some such
"only cosmetic" inconsistency, it all adds up, too;) Style *is*
important to make the code nicer to look at.

--tml


More information about the LibreOffice mailing list