Open datadiode opened 1 month ago
It is not possible to use C++11 since simplecpp still needs to support C++03.
Also using std::regex
is highly discouraged because it is so slow that is essentially unusable in any production code.
I guess it is sure to say that any third-party dependency is out of the question.
That seems plausible.
Then I'd rather go for a simplistic wildcard match, preferably by reusing the fnmatch()
from https://compressionratings.com/d_archiver_template.html.
This implements the idea behind https://github.com/danmar/simplecpp/issues/159#issuecomment-506986341 in a generic way. It works by allowing #pragma once to take a wildcard expression to sort out the unwanted include files.
Example from some project of mine, to prevent some inclusions which would otherwise cause cppcheck to abort prematurely:
Going with Cppcheck's --include option is particularly convenient for the purpose.