Skip to content

Commit f3e452e

Browse files
committed
Fix issue #61 by disabling cpp_feature.h on new enough compilers.
1 parent 2f68cf6 commit f3e452e

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

include/quickcpplib/cpp_feature.h

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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)
33
File 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

include/quickcpplib/revision.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time
2-
#define QUICKCPPLIB_PREVIOUS_COMMIT_REF 1875add409aee9e7aad75526cfefb3d571351095
3-
#define QUICKCPPLIB_PREVIOUS_COMMIT_DATE "2024-11-19 15:28:11 +00:00"
4-
#define QUICKCPPLIB_PREVIOUS_COMMIT_UNIQUE 1875add4
2+
#define QUICKCPPLIB_PREVIOUS_COMMIT_REF 2f68cf6e9ef10b4613a9e4aaa4ce07175495a69a
3+
#define QUICKCPPLIB_PREVIOUS_COMMIT_DATE "2024-12-05 20:08:56 +00:00"
4+
#define QUICKCPPLIB_PREVIOUS_COMMIT_UNIQUE 2f68cf6e

0 commit comments

Comments
 (0)