From 10f0c3a06d70fea2879724f08604aafda3bb8735 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 7 Apr 2023 12:25:41 -0700 Subject: [PATCH] Build the import lib with `_ENFORCE_ONLY_CORE_HEADERS` (#3621) --- stl/CMakeLists.txt | 2 +- stl/src/locale0.cpp | 2 ++ stl/src/nothrow.cpp | 8 +++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/stl/CMakeLists.txt b/stl/CMakeLists.txt index ca28a3de6..b3297579e 100644 --- a/stl/CMakeLists.txt +++ b/stl/CMakeLists.txt @@ -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}) diff --git a/stl/src/locale0.cpp b/stl/src/locale0.cpp index 62d0fc647..42c67242c 100644 --- a/stl/src/locale0.cpp +++ b/stl/src/locale0.cpp @@ -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, should be a core header + #include #include #include diff --git a/stl/src/nothrow.cpp b/stl/src/nothrow.cpp index d12dcdcf3..9124a1585 100644 --- a/stl/src/nothrow.cpp +++ b/stl/src/nothrow.cpp @@ -11,8 +11,10 @@ #undef MRTDLL #endif -#include -_STD_BEGIN +#include -const nothrow_t nothrow = nothrow_t(); // define nothrow +#include + +_STD_BEGIN +const nothrow_t nothrow = nothrow_t(); _STD_END