Skip to content

Commit 8ddf4da

Browse files
Don't use <intrin0.h> with Clang (#3285)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
1 parent 34b296f commit 8ddf4da

File tree

11 files changed

+14
-14
lines changed

11 files changed

+14
-14
lines changed

stl/inc/__msvc_int128.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <yvals_core.h>
1111
#if _STL_COMPILER_PREPROCESSOR
1212
#include <cstdint>
13-
#include <intrin.h> // TRANSITION, GH-2520
13+
#include _STL_INTRIN_HEADER
1414
#include <limits>
1515
#include <type_traits>
1616

stl/inc/bit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
_EMIT_STL_WARNING(STL4038, "The contents of <bit> are available only with C++20 or later.");
1313
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv
1414

15-
#include <intrin0.h>
15+
#include _STL_INTRIN_HEADER
1616
#include <isa_availability.h>
1717
#include <limits>
1818
#include <type_traits>

stl/inc/charconv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
_EMIT_STL_WARNING(STL4038, "The contents of <charconv> are available only with C++17 or later.");
1414
#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
1515
#include <cstring>
16-
#include <intrin0.h>
16+
#include _STL_INTRIN_HEADER
1717
#include <xbit_ops.h>
1818
#include <xcharconv.h>
1919
#include <xcharconv_ryu.h>

stl/inc/cmath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#endif // ^^^ intrinsics unavailable ^^^
2121

2222
#if _HAS_CMATH_INTRINSICS
23-
#include <intrin0.h>
23+
#include _STL_INTRIN_HEADER
2424
#endif // _HAS_CMATH_INTRINSICS
2525

2626
#if _HAS_CXX20

stl/inc/limits

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <cfloat>
1212
#include <climits>
1313
#include <cwchar>
14-
#include <intrin0.h>
14+
#include _STL_INTRIN_HEADER
1515
#include <isa_availability.h>
1616
#include <xstddef>
1717

stl/inc/xatomic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <yvals_core.h>
1010
#if _STL_COMPILER_PREPROCESSOR
1111

12-
#include <intrin0.h>
12+
#include _STL_INTRIN_HEADER
1313
#include <type_traits>
1414

1515
#pragma pack(push, _CRT_PACKING)

stl/inc/xbit_ops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#if _STL_COMPILER_PREPROCESSOR
1111

1212
#include <cstdint>
13-
#include <intrin0.h>
13+
#include _STL_INTRIN_HEADER
1414

1515
#pragma pack(push, _CRT_PACKING)
1616
#pragma warning(push, _STL_WARNING_LEVEL)

stl/inc/xcharconv_ryu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
#endif // ^^^ intrinsics unavailable ^^^
5353

5454
#if _HAS_CHARCONV_INTRINSICS
55-
#include <intrin0.h> // for _umul128() and __shiftright128()
55+
#include _STL_INTRIN_HEADER // for _umul128() and __shiftright128()
5656
#endif // ^^^ intrinsics available ^^^
5757

5858
#if !_HAS_CXX17

stl/inc/yvals_core.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,9 +1835,11 @@ compiler option, or define _ALLOW_RTCc_IN_STL to suppress this error.
18351835
#endif // __cpp_noexcept_function_type
18361836

18371837
#ifdef __clang__
1838-
#define _STL_UNREACHABLE __builtin_unreachable()
1838+
#define _STL_INTRIN_HEADER <intrin.h>
1839+
#define _STL_UNREACHABLE __builtin_unreachable()
18391840
#else // ^^^ clang / other vvv
1840-
#define _STL_UNREACHABLE __assume(false)
1841+
#define _STL_INTRIN_HEADER <intrin0.h>
1842+
#define _STL_UNREACHABLE __assume(false)
18411843
#endif // __clang__
18421844

18431845
#ifdef _ENABLE_STL_INTERNAL_CHECK

stl/src/vector_algorithms.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
#if (defined(_M_IX86) || defined(_M_X64)) && !defined(_M_ARM64EC)
1414

1515
#include <cstdint>
16-
#include <emmintrin.h>
17-
#include <immintrin.h>
18-
#include <intrin0.h>
16+
#include <intrin.h>
1917
#include <isa_availability.h>
2018

2119
extern "C" long __isa_enabled;

tests/std/tests/Dev11_1086953_call_once_overhaul/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <cstdlib>
88
#include <exception>
99
#include <functional>
10-
#include <intrin0.h>
10+
#include <intrin.h>
1111
#include <mutex>
1212
#include <stdexcept>
1313
#include <string>

0 commit comments

Comments
 (0)