Skip to content

Commit

Permalink
Build the import lib with _ENFORCE_ONLY_CORE_HEADERS (#3621)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanTLavavej committed Apr 7, 2023
1 parent 8a652e6 commit 10f0c3a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ function(add_stl_dlls D_SUFFIX REL_OR_DBG)

# import library 'statics'
add_library(msvcp${D_SUFFIX}_implib_objects OBJECT ${IMPLIB_SOURCES})
target_compile_definitions(msvcp${D_SUFFIX}_implib_objects PRIVATE _DLL)
target_compile_definitions(msvcp${D_SUFFIX}_implib_objects PRIVATE _DLL _ENFORCE_ONLY_CORE_HEADERS)
target_compile_options(msvcp${D_SUFFIX}_implib_objects PRIVATE /EHsc) # No /GL!
target_stl_compile_options(msvcp${D_SUFFIX}_implib_objects ${REL_OR_DBG})

Expand Down
2 changes: 2 additions & 0 deletions stl/src/locale0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// MAJOR LIMITATIONS apply to what can be included here!
// Before editing this file, read: /docs/import_library.md

#undef _ENFORCE_ONLY_CORE_HEADERS // TRANSITION, <xfacet> should be a core header

#include <crtdbg.h>
#include <internal_shared.h>
#include <xatomic.h>
Expand Down
8 changes: 5 additions & 3 deletions stl/src/nothrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
#undef MRTDLL
#endif

#include <new>
_STD_BEGIN
#include <yvals_core.h>

#include <vcruntime_new.h>

const nothrow_t nothrow = nothrow_t(); // define nothrow
_STD_BEGIN
const nothrow_t nothrow = nothrow_t();
_STD_END

0 comments on commit 10f0c3a

Please sign in to comment.