When generating the header guard macro, the contents of the pattern string (including the resolved {FILE} variable) should be sanitized by replacing all non-alphanumeric characters by an underscore character (_).
Currently, a header file my-header.h' causes a header guard macro like:_MY-HEADERH, but it should be_MY_HEADERH`, ensuring a valid macro identifier.
Similarly, it would be nice to have a variable holding the header file name extension (e.g. {EXT}), allowing header guard macros to match the header file extension (.h, .hh, hpp, 'hxx), rather than the current hardcoded (_H`) to ensure unique header guards where multiple header files exist which differ only by file name extension.
I would be happy to submit a pull request for this feature-change.
When generating the header guard macro, the contents of the pattern string (including the resolved
{FILE}
variable) should be sanitized by replacing all non-alphanumeric characters by an underscore character (_
).Currently, a header file
my-header.h' causes a header guard macro like:
_MY-HEADERH, but it should be
_MY_HEADERH`, ensuring a valid macro identifier.Similarly, it would be nice to have a variable holding the header file name extension (e.g.
{EXT}
), allowing header guard macros to match the header file extension (.h
,.hh
,hpp
, 'hxx), rather than the current hardcoded (
_H`) to ensure unique header guards where multiple header files exist which differ only by file name extension.I would be happy to submit a pull request for this feature-change.