Skip to content

Various source cleanups, especially ushMEOW.cpp and fiopen.cpp - #2801

Merged
Stephan T. Lavavej (StephanTLavavej) merged 8 commits into
microsoft:mainfrom
StephanTLavavej:various-src-cleanups
Jun 20, 2022
Merged

Stephan T. Lavavej (StephanTLavavej) merged 8 commits into
microsoft:mainfrom
StephanTLavavej:various-src-cleanups

Conversation

@StephanTLavavej

Copy link
Copy Markdown
Member

This is structured as a series of commits for easier reviewing.

  • stl/src is always built with real wchar_t, so we don't need to test #ifdef _NATIVE_WCHAR_T_DEFINED.
  • ushMEOW.cpp cleanups:
    • Only the ushMEOW.cpp files #define wistream, so we don't need to test #ifndef wistream.
    • Each ushMEOW.cpp only needs to macroize its corresponding _Init_wMEOW and init_wMEOW.
    • Consistency: ushMEOW.cpp should #define _Winit last (as ushcerr.cpp already did).
    • Each wMEOW.cpp already includes , so ushMEOW.cpp doesn't need to do so explicitly.
    • Fix copy-pasted comments in ushMEOW.cpp (only ushcerr.cpp was correct).
  • fiopen.cpp cleanups:
    • fiopen.cpp doesn't need to include at all.
    • Move fiopen.cpp helpers into an unnamed namespace.
      • Ignore whitespace when viewing this commit.
      • Precedent for the using-declaration:

        STL/stl/src/syserror.cpp

        Lines 17 to 18 in ea32e86

        namespace {
        using _STD errc;
      • These helpers were neither dllexported nor mentioned by stl/inc, so they're safe to move into an unnamed namespace. (This makes it clear that they're internal helpers that aren't needed by other source files, and slightly helps static linking by avoiding symbols with external linkage that no user code will ever need to look for.)

@StephanTLavavej

Copy link
Copy Markdown
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants