Skip to content

Commit 0a34acc

Browse files
committed
Add new macro BOOST_PARSER_GCC that is defined in config.hpp only for real
(non-Clang-emulated) GCC builds; replace relevant uses of the __GNUC__ macro with BOOST_PARSER_GCC. See discussion in PR #211.
1 parent 56c81c0 commit 0a34acc

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

include/boost/parser/config.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@
7373

7474
#endif
7575

76+
// Follows logic in boost/config/detail/select_compiler_config.hpp.
77+
#if defined(__clang__) && !defined(__ibmxl__) && !defined(__CODEGEARC__)
78+
#elif defined(__GNUC__) && !defined(__ibmxl__)
79+
#define BOOST_PARSER_GCC
80+
#endif
81+
7682
#if defined(__cpp_lib_constexpr_algorithms)
7783
# define BOOST_PARSER_ALGO_CONSTEXPR constexpr
7884
#else

include/boost/parser/detail/stl_interfaces/view_adaptor.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
#define BOOST_PARSER_USE_CPP23_STD_RANGE_ADAPTOR_CLOSURE 0
2525
#endif
2626

27-
#if !BOOST_PARSER_USE_CPP23_STD_RANGE_ADAPTOR_CLOSURE && \
28-
BOOST_PARSER_DETAIL_STL_INTERFACES_USE_CONCEPTS && defined(__GNUC__) && 12 <= __GNUC__
27+
#if !BOOST_PARSER_USE_CPP23_STD_RANGE_ADAPTOR_CLOSURE && \
28+
BOOST_PARSER_DETAIL_STL_INTERFACES_USE_CONCEPTS && \
29+
defined(BOOST_PARSER_GCC) && 12 <= __GNUC__
2930
#define BOOST_PARSER_USE_LIBSTDCPP_GCC12_RANGE_ADAPTOR_CLOSURE 1
3031
#else
3132
#define BOOST_PARSER_USE_LIBSTDCPP_GCC12_RANGE_ADAPTOR_CLOSURE 0

include/boost/parser/detail/text/detail/all_t.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ namespace boost::parser::detail::text::detail {
4242
template<typename R>
4343
constexpr bool view =
4444
#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS || \
45-
(defined(__cpp_lib_concepts) && (!defined(__GNUC__) || 12 <= __GNUC__))
45+
(defined(__cpp_lib_concepts) && \
46+
(!defined(BOOST_PARSER_GCC) || 12 <= __GNUC__))
4647
std::ranges::view<R>
4748
#else
4849
range_<R> && !container_<R> &&

include/boost/parser/transform_replace.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
#include <boost/parser/replace.hpp>
55

66
#if (!defined(_MSC_VER) || BOOST_PARSER_USE_CONCEPTS) && \
7-
(!defined(__GNUC__) || 12 <= __GNUC__ || !BOOST_PARSER_USE_CONCEPTS)
7+
(!defined(BOOST_PARSER_GCC) || 12 <= __GNUC__ || \
8+
!BOOST_PARSER_USE_CONCEPTS)
89

910

1011
namespace boost::parser {

0 commit comments

Comments
 (0)