Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Header Guard: Sanitize File Name #62

Open
hattesen opened this issue Dec 3, 2022 · 0 comments
Open

Generate Header Guard: Sanitize File Name #62

hattesen opened this issue Dec 3, 2022 · 0 comments

Comments

@hattesen
Copy link

hattesen commented Dec 3, 2022

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-HEADER_H, but it should be MY_HEADER_H`, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant