From 75e9bc812ff78cd4b631c7eb3a63ec44997acd8e Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 26 Oct 2020 20:46:07 -0700 Subject: [PATCH 1/7] Don't need to include intrin.h anymore. --- stl/inc/xatomic.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/stl/inc/xatomic.h b/stl/inc/xatomic.h index 3298d828ae..af41c5af67 100644 --- a/stl/inc/xatomic.h +++ b/stl/inc/xatomic.h @@ -11,9 +11,6 @@ #include #include -#if defined(_WIN64) && (_MSC_FULL_VER <= 192829213) // TRANSITION -#include // Visual Studio 2019 to define 128-bit CAS in -#endif // defined(_WIN64) && (_MSC_FULL_VER <= 192829213), TRANSITION #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) From 0078d9bbb22de6c633c8c8d4fa25285182e7f8f7 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 26 Oct 2020 20:57:50 -0700 Subject: [PATCH 2/7] Include in product code. --- stl/inc/__msvc_system_error_abi.hpp | 2 +- stl/inc/atomic | 6 +++--- stl/inc/barrier | 2 +- stl/inc/charconv | 4 ++-- stl/inc/chrono | 2 +- stl/inc/experimental/coroutine | 2 +- stl/inc/experimental/resumable | 2 +- stl/inc/latch | 2 +- stl/inc/mutex | 2 +- stl/inc/random | 2 +- stl/inc/ratio | 2 +- stl/inc/semaphore | 2 +- stl/inc/xatomic_wait.h | 2 +- stl/inc/xcharconv.h | 2 +- stl/inc/xcharconv_ryu.h | 2 +- stl/inc/xcharconv_ryu_tables.h | 2 +- stl/inc/xfilesystem_abi.h | 2 +- stl/inc/xlocinfo.h | 8 ++++---- stl/inc/xthreads.h | 2 +- stl/inc/xtimec.h | 2 +- 20 files changed, 26 insertions(+), 26 deletions(-) diff --git a/stl/inc/__msvc_system_error_abi.hpp b/stl/inc/__msvc_system_error_abi.hpp index d6744adf1f..d95b458cf5 100644 --- a/stl/inc/__msvc_system_error_abi.hpp +++ b/stl/inc/__msvc_system_error_abi.hpp @@ -8,7 +8,7 @@ #define __MSVC_SYSTEM_ERROR_ABI_HPP #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/atomic b/stl/inc/atomic index 78820eb37b..2a5d8c836f 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -13,9 +13,9 @@ #error is not supported when compiling with /clr:pure. #endif // _M_CEE_PURE -#include // for size_t -#include -#include +#include +#include +#include #include #if _HAS_CXX20 #include diff --git a/stl/inc/barrier b/stl/inc/barrier index 2258cfe26d..fc0eb1df2c 100644 --- a/stl/inc/barrier +++ b/stl/inc/barrier @@ -18,7 +18,7 @@ #else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv #include -#include +#include #include #include diff --git a/stl/inc/charconv b/stl/inc/charconv index ae2cbb5cac..0cb824a03c 100644 --- a/stl/inc/charconv +++ b/stl/inc/charconv @@ -12,9 +12,9 @@ #if !_HAS_CXX17 #pragma message("The contents of are available only with C++17 or later.") #else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv -#include +#include +#include #include -#include #include #include #include diff --git a/stl/inc/chrono b/stl/inc/chrono index 8405b26be5..9c1968e922 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -8,9 +8,9 @@ #define _CHRONO_ #include #if _STL_COMPILER_PREPROCESSOR +#include #include #include -#include #include #include diff --git a/stl/inc/experimental/coroutine b/stl/inc/experimental/coroutine index c6ed2a2a29..062973090b 100644 --- a/stl/inc/experimental/coroutine +++ b/stl/inc/experimental/coroutine @@ -16,7 +16,7 @@ #if _HAS_EXCEPTIONS #include #endif -#include +#include #include #pragma pack(push, _CRT_PACKING) diff --git a/stl/inc/experimental/resumable b/stl/inc/experimental/resumable index 7f308dd3ec..0991c7c20d 100644 --- a/stl/inc/experimental/resumable +++ b/stl/inc/experimental/resumable @@ -15,8 +15,8 @@ #if _HAS_EXCEPTIONS #include #endif +#include #include -#include #include #pragma pack(push, _CRT_PACKING) diff --git a/stl/inc/latch b/stl/inc/latch index 3743af7648..16eea8b0fe 100644 --- a/stl/inc/latch +++ b/stl/inc/latch @@ -18,7 +18,7 @@ #else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv #include -#include +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/mutex b/stl/inc/mutex index 501fa02c01..5d781ceff8 100644 --- a/stl/inc/mutex +++ b/stl/inc/mutex @@ -14,7 +14,7 @@ #endif // _M_CEE_PURE #include -#include +#include #include #include #include diff --git a/stl/inc/random b/stl/inc/random index 1854b1f234..af9a36b5a6 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -11,8 +11,8 @@ #if _STL_COMPILER_PREPROCESSOR #include #include +#include #include -#include #include #include #include diff --git a/stl/inc/ratio b/stl/inc/ratio index d290147f24..0a1b09f761 100644 --- a/stl/inc/ratio +++ b/stl/inc/ratio @@ -8,7 +8,7 @@ #define _RATIO_ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #include #pragma pack(push, _CRT_PACKING) diff --git a/stl/inc/semaphore b/stl/inc/semaphore index 0845bdf00f..79d2760603 100644 --- a/stl/inc/semaphore +++ b/stl/inc/semaphore @@ -19,7 +19,7 @@ #include #include -#include +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/xatomic_wait.h b/stl/inc/xatomic_wait.h index caeb3fdaf9..42378ea39d 100644 --- a/stl/inc/xatomic_wait.h +++ b/stl/inc/xatomic_wait.h @@ -9,7 +9,7 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #include #pragma pack(push, _CRT_PACKING) diff --git a/stl/inc/xcharconv.h b/stl/inc/xcharconv.h index 9305de5505..ecd69b6d02 100644 --- a/stl/inc/xcharconv.h +++ b/stl/inc/xcharconv.h @@ -9,7 +9,7 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #include #include diff --git a/stl/inc/xcharconv_ryu.h b/stl/inc/xcharconv_ryu.h index def634d227..1b2b95a8e0 100644 --- a/stl/inc/xcharconv_ryu.h +++ b/stl/inc/xcharconv_ryu.h @@ -38,7 +38,7 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #include #include diff --git a/stl/inc/xcharconv_ryu_tables.h b/stl/inc/xcharconv_ryu_tables.h index cea6fd2b5a..508d3479fd 100644 --- a/stl/inc/xcharconv_ryu_tables.h +++ b/stl/inc/xcharconv_ryu_tables.h @@ -38,7 +38,7 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #if !_HAS_CXX17 #error The contents of are only available with C++17. (Also, you should not include this internal header.) diff --git a/stl/inc/xfilesystem_abi.h b/stl/inc/xfilesystem_abi.h index 7991c1d522..52f8c8f740 100644 --- a/stl/inc/xfilesystem_abi.h +++ b/stl/inc/xfilesystem_abi.h @@ -9,7 +9,7 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #include #pragma pack(push, _CRT_PACKING) diff --git a/stl/inc/xlocinfo.h b/stl/inc/xlocinfo.h index 9891775d16..f3e36738c9 100644 --- a/stl/inc/xlocinfo.h +++ b/stl/inc/xlocinfo.h @@ -9,10 +9,10 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include -#include -#include // TRANSITION, VSO-661721 -#include +#include +#include +#include // TRANSITION, VSO-661721 +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/xthreads.h b/stl/inc/xthreads.h index f2d95ff63d..c8c8880057 100644 --- a/stl/inc/xthreads.h +++ b/stl/inc/xthreads.h @@ -8,7 +8,7 @@ #define _THR_XTHREADS_H #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #include #pragma pack(push, _CRT_PACKING) diff --git a/stl/inc/xtimec.h b/stl/inc/xtimec.h index 67b75522d1..64741469db 100644 --- a/stl/inc/xtimec.h +++ b/stl/inc/xtimec.h @@ -9,7 +9,7 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) From 9b2983817f78d2fac593ccbc2d8f767351d734fd Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 29 Oct 2020 23:46:10 -0700 Subject: [PATCH 3/7] Change most C wrapper headers to be core headers. These are now core: cassert, cctype, cerrno, cfenv, cinttypes, clocale, csetjmp, csignal, cstdarg, cstring, ctime, cuchar, cwctype. We need to change xstoul.cpp and xstoull.cpp because they're now including only core C wrapper headers, yet they're using the DLL export macro. Therefore, they should directly include yvals.h. --- stl/inc/cassert | 4 ++-- stl/inc/cctype | 4 ++-- stl/inc/cerrno | 4 ++-- stl/inc/cfenv | 4 ++-- stl/inc/cinttypes | 4 ++-- stl/inc/clocale | 4 ++-- stl/inc/csetjmp | 4 ++-- stl/inc/csignal | 4 ++-- stl/inc/cstdarg | 4 ++-- stl/inc/cstring | 4 ++-- stl/inc/ctime | 4 ++-- stl/inc/cuchar | 4 ++-- stl/inc/cwctype | 4 ++-- stl/src/xstoul.cpp | 2 ++ stl/src/xstoull.cpp | 2 ++ 15 files changed, 30 insertions(+), 26 deletions(-) diff --git a/stl/inc/cassert b/stl/inc/cassert index 18b2f2b777..cf8f3cef25 100644 --- a/stl/inc/cassert +++ b/stl/inc/cassert @@ -1,9 +1,9 @@ -// cassert standard header +// cassert standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // NOTE: no include guard -#include +#include #include diff --git a/stl/inc/cctype b/stl/inc/cctype index d9980f4f33..cc6c49fe7b 100644 --- a/stl/inc/cctype +++ b/stl/inc/cctype @@ -1,4 +1,4 @@ -// cctype standard header +// cctype standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CCTYPE_ #define _CCTYPE_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cerrno b/stl/inc/cerrno index efc14b6672..1b5a470c32 100644 --- a/stl/inc/cerrno +++ b/stl/inc/cerrno @@ -1,4 +1,4 @@ -// cerrno standard header +// cerrno standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CERRNO_ #define _CERRNO_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cfenv b/stl/inc/cfenv index 778dd014a8..c78b983724 100644 --- a/stl/inc/cfenv +++ b/stl/inc/cfenv @@ -1,4 +1,4 @@ -// cfenv standard header +// cfenv standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CFENV_ #define _CFENV_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cinttypes b/stl/inc/cinttypes index 2b13057079..d1f07e10a5 100644 --- a/stl/inc/cinttypes +++ b/stl/inc/cinttypes @@ -1,4 +1,4 @@ -// cinttypes standard header +// cinttypes standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CINTTYPES_ #define _CINTTYPES_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/clocale b/stl/inc/clocale index f725ad9df6..bfc5a0aacf 100644 --- a/stl/inc/clocale +++ b/stl/inc/clocale @@ -1,4 +1,4 @@ -// clocale standard header +// clocale standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CLOCALE_ #define _CLOCALE_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/csetjmp b/stl/inc/csetjmp index 3c25d00993..802ff156e6 100644 --- a/stl/inc/csetjmp +++ b/stl/inc/csetjmp @@ -1,4 +1,4 @@ -// csetjmp standard header +// csetjmp standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CSETJMP_ #define _CSETJMP_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/csignal b/stl/inc/csignal index 077056161e..fc88191d7d 100644 --- a/stl/inc/csignal +++ b/stl/inc/csignal @@ -1,4 +1,4 @@ -// csignal standard header +// csignal standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CSIGNAL_ #define _CSIGNAL_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cstdarg b/stl/inc/cstdarg index af09a4fa7d..f9897bcb17 100644 --- a/stl/inc/cstdarg +++ b/stl/inc/cstdarg @@ -1,4 +1,4 @@ -// cstdarg standard header +// cstdarg standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CSTDARG_ #define _CSTDARG_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cstring b/stl/inc/cstring index 8c714e9db0..a0140aa307 100644 --- a/stl/inc/cstring +++ b/stl/inc/cstring @@ -1,4 +1,4 @@ -// cstring standard header +// cstring standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CSTRING_ #define _CSTRING_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/ctime b/stl/inc/ctime index a6f3ddc01a..94ed91c49c 100644 --- a/stl/inc/ctime +++ b/stl/inc/ctime @@ -1,4 +1,4 @@ -// ctime standard header +// ctime standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CTIME_ #define _CTIME_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cuchar b/stl/inc/cuchar index 86119e20f8..fc8feb0be8 100644 --- a/stl/inc/cuchar +++ b/stl/inc/cuchar @@ -1,4 +1,4 @@ -// cuchar standard header +// cuchar standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CUCHAR_ #define _CUCHAR_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cwctype b/stl/inc/cwctype index 567d6642ae..cfcbe9040e 100644 --- a/stl/inc/cwctype +++ b/stl/inc/cwctype @@ -1,4 +1,4 @@ -// cwctype standard header +// cwctype standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CWCTYPE_ #define _CWCTYPE_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/src/xstoul.cpp b/stl/src/xstoul.cpp index 48f48489b2..6531f9dfa0 100644 --- a/stl/src/xstoul.cpp +++ b/stl/src/xstoul.cpp @@ -3,6 +3,8 @@ // _Stoul function +#include + #include #include #include diff --git a/stl/src/xstoull.cpp b/stl/src/xstoull.cpp index 8a29d7ab26..3deaf903e6 100644 --- a/stl/src/xstoull.cpp +++ b/stl/src/xstoull.cpp @@ -3,6 +3,8 @@ // _Stoull function +#include + #include #include #include From 0d56be8bae71e5cc5254ccc57f5bdd3385091d54 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 29 Oct 2020 23:51:41 -0700 Subject: [PATCH 4/7] Test core headers. --- stl/inc/__msvc_all_public_headers.hpp | 81 +++++++++++-------- tests/std/test.lst | 1 + .../std/tests/GH_001411_core_headers/env.lst | 4 + .../std/tests/GH_001411_core_headers/test.cpp | 18 +++++ 4 files changed, 71 insertions(+), 33 deletions(-) create mode 100644 tests/std/tests/GH_001411_core_headers/env.lst create mode 100644 tests/std/tests/GH_001411_core_headers/test.cpp diff --git a/stl/inc/__msvc_all_public_headers.hpp b/stl/inc/__msvc_all_public_headers.hpp index 912896ed2d..99b2c5d54f 100644 --- a/stl/inc/__msvc_all_public_headers.hpp +++ b/stl/inc/__msvc_all_public_headers.hpp @@ -37,18 +37,52 @@ #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING #define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS +// Core STL Headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Core C Wrapper Headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef _EXCLUDE_NON_CORE_HEADERS + +// Non-Core STL Headers #include #include #include -#include #include #include #include #include -#include #include -#include -#include #include #include #include @@ -57,28 +91,24 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include @@ -92,16 +122,13 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include -#include #ifndef _M_CEE_PURE #include @@ -120,32 +147,15 @@ #include #endif // _M_CEE -#include +// Non-Core C Wrapper Headers #include -#include -#include -#include -#include -#include #include -#include -#include #include -#include -#include #include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include + +// Non-Core Experimental Headers #include #include #include @@ -157,9 +167,10 @@ #include #include +#endif // _EXCLUDE_NON_CORE_HEADERS + #ifndef _MSVC_TESTING_NVCC #include -#include #include #include #include @@ -181,7 +192,6 @@ #include #include #include -#include #include #include #include @@ -207,6 +217,11 @@ #include #include +#ifndef _EXCLUDE_NON_CORE_HEADERS +#include +#include +#endif // _EXCLUDE_NON_CORE_HEADERS + #ifndef _M_CEE_PURE #include #endif // _M_CEE_PURE diff --git a/tests/std/test.lst b/tests/std/test.lst index 61b46da09d..93ec8be427 100644 --- a/tests/std/test.lst +++ b/tests/std/test.lst @@ -169,6 +169,7 @@ tests\GH_001059_hyperbolic_truncation tests\GH_001086_partial_sort_copy tests\GH_001103_countl_zero_correctness tests\GH_001123_random_cast_out_of_range +tests\GH_001411_core_headers tests\LWG2597_complex_branch_cut tests\LWG3018_shared_ptr_function tests\P0019R8_atomic_ref diff --git a/tests/std/tests/GH_001411_core_headers/env.lst b/tests/std/tests/GH_001411_core_headers/env.lst new file mode 100644 index 0000000000..642f530ffa --- /dev/null +++ b/tests/std/tests/GH_001411_core_headers/env.lst @@ -0,0 +1,4 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +RUNALL_INCLUDE ..\usual_latest_matrix.lst diff --git a/tests/std/tests/GH_001411_core_headers/test.cpp b/tests/std/tests/GH_001411_core_headers/test.cpp new file mode 100644 index 0000000000..add2fb210c --- /dev/null +++ b/tests/std/tests/GH_001411_core_headers/test.cpp @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#define _EXCLUDE_NON_CORE_HEADERS + +#include <__msvc_all_public_headers.hpp> + +#ifdef _YVALS +#error Core headers should not include . +#endif + +#include + +#ifndef _YVALS +#error Non-core headers like should include . +#endif + +int main() {} // COMPILE-ONLY From ef3adea387da3801fc120fdfca5dfa605e22104c Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 29 Oct 2020 23:54:25 -0700 Subject: [PATCH 5/7] doesn't need to include . It doesn't mention anything that provides. provides uses_allocator and allocator_arg. --- stl/inc/tuple | 1 - 1 file changed, 1 deletion(-) diff --git a/stl/inc/tuple b/stl/inc/tuple index ee6f40fb1e..7060e6968b 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -8,7 +8,6 @@ #define _TUPLE_ #include #if _STL_COMPILER_PREPROCESSOR -#include #include #include From 018ba4595e4508fe6f4387e6201ea19b31069f84 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 30 Oct 2020 00:09:16 -0700 Subject: [PATCH 6/7] Small cleanups in xstol.cpp, xstoll.cpp, xstoul.cpp. xstol.cpp doesn't need xmath.hpp, which is for floating-point. xstoll.cpp doesn't need xmath.hpp either, but will need yvals.h. xstoul.cpp had a leftover "macros" comment. Also, remove an empty line and move the "valid digits" comment to be more consistent with xstoull.cpp. --- stl/src/xstol.cpp | 2 -- stl/src/xstoll.cpp | 4 ++-- stl/src/xstoul.cpp | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/stl/src/xstol.cpp b/stl/src/xstol.cpp index 3cd73becd6..0e5f94ba00 100644 --- a/stl/src/xstol.cpp +++ b/stl/src/xstol.cpp @@ -10,8 +10,6 @@ #include #include -#include "xmath.hpp" - _EXTERN_C_UNLESS_PURE _CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoulx(const char*, char**, int, int*); diff --git a/stl/src/xstoll.cpp b/stl/src/xstoll.cpp index 63ad80e149..4bddd4e19c 100644 --- a/stl/src/xstoll.cpp +++ b/stl/src/xstoll.cpp @@ -3,13 +3,13 @@ // _Stoll function +#include + #include #include #include #include -#include "xmath.hpp" - _EXTERN_C_UNLESS_PURE _CRTIMP2_PURE unsigned long long __CLRCALL_PURE_OR_CDECL _Stoullx(const char*, char**, int, int*); diff --git a/stl/src/xstoul.cpp b/stl/src/xstoul.cpp index 6531f9dfa0..9dd8385b8d 100644 --- a/stl/src/xstoul.cpp +++ b/stl/src/xstoul.cpp @@ -12,15 +12,12 @@ #include #include - _EXTERN_C_UNLESS_PURE -// macros constexpr int _Base_max = 36; // largest valid base // static data -static const char digits[] = // valid digits - "0123456789abcdefghijklmnopqrstuvwxyz"; +static const char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; // valid digits // 32-bits! static const char ndigs[_Base_max + 1] = {0, 0, 33, 21, 17, 14, 13, 12, 11, 11, 10, 10, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, From b5cfc5b0c0c5642cdb91b58916bf95206db033fb Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 30 Oct 2020 17:08:31 -0700 Subject: [PATCH 7/7] Code review feedback. --- stl/inc/__msvc_all_public_headers.hpp | 8 ++++---- tests/std/tests/GH_001411_core_headers/env.lst | 2 +- tests/std/tests/GH_001411_core_headers/test.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stl/inc/__msvc_all_public_headers.hpp b/stl/inc/__msvc_all_public_headers.hpp index 99b2c5d54f..b238fdb760 100644 --- a/stl/inc/__msvc_all_public_headers.hpp +++ b/stl/inc/__msvc_all_public_headers.hpp @@ -72,7 +72,7 @@ #include #include -#ifndef _EXCLUDE_NON_CORE_HEADERS +#ifndef _CORE_HEADERS_ONLY // Non-Core STL Headers #include @@ -167,7 +167,7 @@ #include #include -#endif // _EXCLUDE_NON_CORE_HEADERS +#endif // _CORE_HEADERS_ONLY #ifndef _MSVC_TESTING_NVCC #include @@ -217,10 +217,10 @@ #include #include -#ifndef _EXCLUDE_NON_CORE_HEADERS +#ifndef _CORE_HEADERS_ONLY #include #include -#endif // _EXCLUDE_NON_CORE_HEADERS +#endif // _CORE_HEADERS_ONLY #ifndef _M_CEE_PURE #include diff --git a/tests/std/tests/GH_001411_core_headers/env.lst b/tests/std/tests/GH_001411_core_headers/env.lst index 642f530ffa..19f025bd0e 100644 --- a/tests/std/tests/GH_001411_core_headers/env.lst +++ b/tests/std/tests/GH_001411_core_headers/env.lst @@ -1,4 +1,4 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -RUNALL_INCLUDE ..\usual_latest_matrix.lst +RUNALL_INCLUDE ..\usual_matrix.lst diff --git a/tests/std/tests/GH_001411_core_headers/test.cpp b/tests/std/tests/GH_001411_core_headers/test.cpp index add2fb210c..5a45bd6568 100644 --- a/tests/std/tests/GH_001411_core_headers/test.cpp +++ b/tests/std/tests/GH_001411_core_headers/test.cpp @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#define _EXCLUDE_NON_CORE_HEADERS +#define _CORE_HEADERS_ONLY #include <__msvc_all_public_headers.hpp> @@ -9,10 +9,10 @@ #error Core headers should not include . #endif -#include +#include #ifndef _YVALS -#error Non-core headers like should include . +#error Non-core headers like should include . #endif int main() {} // COMPILE-ONLY