11/* Provides SG-10 feature checking for all C++ compilers
2- (C) 2014-2017 Niall Douglas <http://www.nedproductions.biz/> (13 commits)
2+ (C) 2014-2024 Niall Douglas <http://www.nedproductions.biz/> (13 commits)
33File Created: Nov 2014
44
55
@@ -25,6 +25,17 @@ Distributed under the Boost Software License, Version 1.0.
2525#ifndef QUICKCPPLIB_HAS_FEATURE_H
2626#define QUICKCPPLIB_HAS_FEATURE_H
2727
28+ // Completely disable this file if on C++ 20 or later, or if compiler is new enough
29+ #if __cplusplus >= 202002L || _HAS_CXX20
30+
31+ #include < version>
32+
33+ #elif _MSC_VER >= 1920 || __GNUC__ >= 12 || __clang_major__ >= 17
34+
35+ #include < ciso646>
36+
37+ #else
38+
2839#if __cplusplus >= 201103L
2940
3041// Some of these macros ended up getting removed by ISO standards,
@@ -105,15 +116,15 @@ Distributed under the Boost Software License, Version 1.0.
105116#define __cpp_delegating_constructors 190000
106117#endif
107118
108- #if !defined(__cpp_explicit_conversion) // // renamed from __cpp_explicit_conversions
119+ #if !defined(__cpp_explicit_conversion) // // renamed from __cpp_explicit_conversions
109120#define __cpp_explicit_conversion 190000
110121#endif
111122
112123#if !defined(__cpp_inheriting_constructors)
113124#define __cpp_inheriting_constructors 190000
114125#endif
115126
116- #if !defined(__cpp_initializer_lists) // // NEW
127+ #if !defined(__cpp_initializer_lists) // // NEW
117128#define __cpp_initializer_lists 190000
118129#endif
119130
@@ -125,15 +136,15 @@ Distributed under the Boost Software License, Version 1.0.
125136#define __cpp_nsdmi 190000 // // NEW
126137#endif
127138
128- #if !defined(__cpp_range_based_for) // // renamed from __cpp_range_for
139+ #if !defined(__cpp_range_based_for) // // renamed from __cpp_range_for
129140#define __cpp_range_based_for 190000
130141#endif
131142
132143#if !defined(__cpp_raw_strings)
133144#define __cpp_raw_strings 190000
134145#endif
135146
136- #if !defined(__cpp_ref_qualifiers) // // renamed from __cpp_reference_qualified_functions
147+ #if !defined(__cpp_ref_qualifiers) // // renamed from __cpp_reference_qualified_functions
137148#define __cpp_ref_qualifiers 190000
138149#endif
139150
@@ -145,7 +156,7 @@ Distributed under the Boost Software License, Version 1.0.
145156#define __cpp_static_assert 190000
146157#endif
147158
148- #if !defined(__cpp_unicode_characters) // // NEW
159+ #if !defined(__cpp_unicode_characters) // // NEW
149160#define __cpp_unicode_characters 190000
150161#endif
151162
@@ -205,7 +216,7 @@ Distributed under the Boost Software License, Version 1.0.
205216#define __cpp_return_type_deduction 190000
206217#endif
207218
208- #if !defined(__cpp_sized_deallocation)
219+ #if !defined(__cpp_sized_deallocation) && !defined(__clang__)
209220#define __cpp_sized_deallocation 190000
210221#endif
211222
@@ -294,9 +305,9 @@ Distributed under the Boost Software License, Version 1.0.
294305#define __cpp_static_assert 190000
295306#endif
296307
297- // #if !defined(__cpp_unicode_literals)
298- // # define __cpp_unicode_literals 190000
299- // #endif
308+ // #if !defined(__cpp_unicode_literals)
309+ // # define __cpp_unicode_literals 190000
310+ // #endif
300311
301312#if !defined(__cpp_user_defined_literals) && _MSC_VER >= 1900
302313#define __cpp_user_defined_literals 190000
@@ -309,9 +320,9 @@ Distributed under the Boost Software License, Version 1.0.
309320
310321// C++ 14
311322
312- // #if !defined(__cpp_aggregate_nsdmi)
313- // #define __cpp_aggregate_nsdmi 190000
314- // #endif
323+ // #if !defined(__cpp_aggregate_nsdmi)
324+ // #define __cpp_aggregate_nsdmi 190000
325+ // #endif
315326
316327#if !defined(__cpp_binary_literals) && _MSC_VER >= 1900
317328#define __cpp_binary_literals 190000
@@ -562,3 +573,5 @@ Distributed under the Boost Software License, Version 1.0.
562573#endif // clang
563574
564575#endif
576+
577+ #endif
0 commit comments