Move machinery from inc/ymath.h
to src/xmath.hpp
#2828
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While looking at the STL's separately compiled machinery for modules, I noticed that
inc/ymath.h
was declaring a bunch of stuff that isn't needed by any other header ininc
. We can move this tosrc/xmath.hpp
(which is being included by everything insrc
that needs it) without disrupting users or affecting ABI. (That is, the exported machinery insrc
will still be exported; there's no reason to declare it as imported ininc
if we aren't going to use it there.)This is theoretically an extremely slight throughput improvement (fewer things being declared), but realistically it just makes the codebase easier to understand - fewer spurious connections between
inc
andsrc
.I'm changing one thing while moving this from
inc
tosrc
: changing_CRTIMP2_PURE_IMPORT
to_CRTIMP2_PURE
. Withinsrc
, they are exactly identical (and we don't use_CRTIMP2_PURE_IMPORT
except for_Yarn
- that one is trying to match the header stylistically, although it could be changed).Click to expand macro definitions:
STL/stl/inc/yvals.h
Lines 281 to 297 in ad80eb7
<crtdefs.h>
:STL/stl/inc/yvals.h
Lines 265 to 271 in ad80eb7
The only difference between
_CRTIMP2_PURE_IMPORT
and_CRTIMP2_PURE
is when building user code using the STL as a DLL (/MD
and/MDd
), in which case the former expands to__declspec(dllimport)
. That's impossible forstl/src
, and we don't need to match any other declarations, so we should use plain_CRTIMP2_PURE
like everything else.We have export validation in the internal build, but I also verified this manually.
First, notice that
_Feraise
wasn't marked_CRTIMP2_PURE
, so it wasn't being imported/exported at all! Withmain
, it doesn't appear in the export surface:With this PR, everything else is still being exported: