tools: add check for directives styling
Updated the C++ linter to check for preprocessor directive styling and updated files to conform to the new styling rules. The chosen styling rules are as follows;
- No space between # and the directive.
- Use one whitespace between define and the identifier.
- No space between defined and the open parenthesis in #if defined(XYZ).
- Use one whitespace between undef and the identifier.
- Consistent indentation in if/ifdef/ifndef blocks
Fixes: https://github.com/nodejs/node/issues/28605
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes (https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines)