Six module interfaces carry windows.h in their fragment, and a fragment's
include guard does not cross the boundary, so a unit that imported first
and included the SDK afterwards parsed it twice: clang reports it as
conflicting redeclarations of BroadcastSystemMessageEx and mismatched
uuids all through the SDK. Same shape as the basic_filebuf failure, one
level further out - the header arrives through d3d12.h, not directly.
Thirty units get a guarded windows.h ahead of everything; on Linux it is
a no-op. Vendored single-header libraries are left alone, and the block
goes after a BOM rather than before it.
The template-header propagation only walked files with a module
declaration, so EU07.cpp, windows.cpp, export_e3d_standalone.cpp and
every betterRenderer source were outside it - including the file with
main(). They reach cParser and friends through eu07.simcore and
instantiate their templates without the headers those bodies name.
Adds audit_modules.py, which checks the whole tree for the seven classes
this migration hit; all seven are clean now.
Ordering them before the imports in the same file was not enough: a
project header on line 1 can import a module several levels down whose
global module fragment already pulled in the same standard header, and
that include guard does not cross the module boundary. Putting them
first means the guard is set before anything can import.
Skips vendored single-header libraries and anything inside an #if.
The previous pass dropped imports into the middle of HR_RETURN's
line continuations, breaking nvrenderer_d3d12.cpp, and its scan gave up
on the first line of any file with a BOM - which is why nvtexture.cpp
still had five includes sitting after its imports. Rewritten to skip
macro continuations, tolerate a BOM, and insert only immediately before
the first import.
A header first pulled in through an imported module's global module
fragment leaves no include guard in the importing unit - macros do not
cross a module boundary - so a later textual include parses it again and
MSVC rejects the redefinition. Redoes the betterRenderer sweep with
placement that stays out of #if blocks, which is where the previous one
dropped <fstream> and broke nvrenderer_d3d12.cpp.
Its sources reached the standard library through the project headers they
included; those are imports now. 178 headers across 56 files, plus 18 C
library headers elsewhere for memcpy/printf and friends. MSVC's STL does
not supply these transitively the way libstdc++ does.
The module file set moves to its own eu07_modules library: a target can
only consume C++20 modules by linking the target that owns them, and
betterRenderer is a separate add_library. Its project includes become
imports.
CXX_EXTENSIONS must match across the two - a BMI built with -std=c++20
is refused by a unit compiled with -std=gnu++20.