Skip to content

Commit 9fc46f5

Browse files
committed
🐛 [pph] Fix sml.hpp generation
Problem: - `sml.hpp` generation using `tools/pph.sh` is out of date with `sml.hpp`. Solution: - Update files in sml/ folder to fix the generated `sml.hpp`.
1 parent 1e74038 commit 9fc46f5

File tree

13 files changed

+50
-45
lines changed

13 files changed

+50
-45
lines changed

.github/workflows/pph-checker.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pph Checker
1+
name: PPH checker
22

33
on:
44
push:
@@ -8,9 +8,17 @@ on:
88

99
jobs:
1010
build:
11-
12-
runs-on: ubuntu-latest
13-
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
name: [
15+
ubuntu-18.04-clang-4.0
16+
]
17+
include:
18+
- name: ubuntu-18.04-clang-4.0
19+
os: ubuntu-18.04
20+
compiler: clang
21+
version: "4.0"
1422
steps:
1523
- uses: actions/checkout@v2
1624
- name: Run pph

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/build*/
12
/BUILD*/
23
/*.log
34
*.out

include/boost/sml.hpp

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@
66
//
77
#ifndef BOOST_SML_HPP
88
#define BOOST_SML_HPP
9-
#if defined(_MSC_VER) && !defined(__clang__)
10-
#define COMPILING_WITH_MSVC
11-
#endif
129
#if (__cplusplus < 201305L && _MSC_VER < 1900)
1310
#error "[Boost].SML requires C++14 support (Clang-3.4+, GCC-5.1+, MSVC-2015+)"
1411
#else
15-
#define BOOST_SML_VERSION 1'1'0
12+
#define BOOST_SML_VERSION 1'1'1
1613
#define BOOST_SML_NAMESPACE_BEGIN \
1714
namespace boost { \
1815
namespace sml { \
19-
inline namespace v1_1_0 {
16+
inline namespace v1_1_1 {
2017
#define BOOST_SML_NAMESPACE_END \
2118
} \
2219
} \
@@ -44,15 +41,15 @@
4441
#define __BOOST_SML_TEMPLATE_KEYWORD template
4542
#pragma GCC diagnostic push
4643
#pragma GCC diagnostic ignored "-Wpedantic"
47-
#elif defined(COMPILING_WITH_MSVC)
44+
#elif defined(_MSC_VER) && !defined(__clang__)
4845
#define __BOOST_SML_DEFINED_HAS_BUILTIN
4946
#define __has_builtin(...) __has_builtin##__VA_ARGS__
5047
#define __has_builtin__make_integer_seq(...) 1
5148
#define __BOOST_SML_UNUSED
5249
#define __BOOST_SML_VT_INIT
5350
#define __BOOST_SML_ZERO_SIZE_ARRAY(...)
5451
#define __BOOST_SML_ZERO_SIZE_ARRAY_CREATE(...) __VA_ARGS__ ? __VA_ARGS__ : 1
55-
#if (defined(COMPILING_WITH_MSVC) && _MSC_VER >= 1910) // MSVC 2017
52+
#if defined(_MSC_VER) && !defined(__clang__) && _MSC_VER >= 1910 // MSVC 2017
5653
#define __BOOST_SML_TEMPLATE_KEYWORD template
5754
#else
5855
#define __BOOST_SML_TEMPLATE_KEYWORD
@@ -125,7 +122,7 @@ struct is_same : false_type {};
125122
template <class T>
126123
struct is_same<T, T> : true_type {};
127124
template <class T, class U>
128-
#if defined(COMPILING_WITH_MSVC)
125+
#if defined(_MSC_VER) && !defined(__clang__)
129126
struct is_base_of : integral_constant<bool, __is_base_of(T, U)> {
130127
};
131128
#else
@@ -136,7 +133,7 @@ decltype(T(declval<TArgs>()...), true_type{}) test_is_constructible(int);
136133
template <class, class...>
137134
false_type test_is_constructible(...);
138135
template <class T, class... TArgs>
139-
#if defined(COMPILING_WITH_MSVC)
136+
#if defined(_MSC_VER) && !defined(__clang__)
140137
struct is_constructible : decltype(test_is_constructible<T, TArgs...>(0)) {
141138
};
142139
#else
@@ -341,7 +338,7 @@ struct missing_ctor_parameter {
341338
operator U() {
342339
return {};
343340
}
344-
#if !defined(COMPILING_WITH_MSVC)
341+
#if !defined(_MSC_VER) && !defined(__clang__)
345342
template <class TMissing, __BOOST_SML_REQUIRES(!aux::is_base_of<pool_type_base, TMissing>::value)>
346343
operator TMissing &() const {
347344
static_assert(missing_ctor_parameter<TMissing>::value,
@@ -414,7 +411,7 @@ template <template <class...> class T, class... Ts>
414411
struct size<T<Ts...>> {
415412
static constexpr auto value = sizeof...(Ts);
416413
};
417-
#if defined(COMPILING_WITH_MSVC)
414+
#if defined(_MSC_VER) && !defined(__clang__)
418415
constexpr int max_impl() { return 0; }
419416
constexpr int max_impl(int r) { return r; }
420417
constexpr int max_impl(int r, int i) { return r > i ? r : i; }
@@ -461,7 +458,7 @@ auto get_type_name(const char *ptr, index_sequence<Ns...>) {
461458
}
462459
template <class T>
463460
const char *get_type_name() {
464-
#if defined(COMPILING_WITH_MSVC)
461+
#if defined(_MSC_VER) && !defined(__clang__)
465462
return detail::get_type_name<T, 34>(__FUNCSIG__, make_index_sequence<sizeof(__FUNCSIG__) - 34 - 8>{});
466463
#elif defined(__clang__)
467464
return detail::get_type_name<T, 58>(__PRETTY_FUNCTION__, make_index_sequence<sizeof(__PRETTY_FUNCTION__) - 58 - 2>{});
@@ -523,7 +520,6 @@ class queue_event {
523520
}
524521
queue_event &operator=(queue_event &&other) {
525522
dtor(data);
526-
527523
id = other.id;
528524
dtor = other.dtor;
529525
move = other.move;
@@ -1201,7 +1197,7 @@ TPolicy get_policy(aux::pair<T, TPolicy> *);
12011197
template <class SM, class... TPolicies>
12021198
struct sm_policy {
12031199
static_assert(aux::is_same<aux::remove_reference_t<SM>, SM>::value, "SM type can't have qualifiers");
1204-
#if defined(COMPILING_WITH_MSVC)
1200+
#if defined(_MSC_VER) && !defined(__clang__)
12051201
using default_dispatch_policy = policies::jump_table;
12061202
#elif defined(__clang__)
12071203
using default_dispatch_policy = policies::jump_table;
@@ -1994,7 +1990,7 @@ template <template <class...> class T>
19941990
using defer_queue = back::policies::defer_queue<T>;
19951991
template <template <class...> class T>
19961992
using process_queue = back::policies::process_queue<T>;
1997-
#if defined(COMPILING_WITH_MSVC)
1993+
#if defined(_MSC_VER) && !defined(__clang__)
19981994
template <class T, class... TPolicies, class T__ = aux::remove_reference_t<decltype(aux::declval<T>())>>
19991995
using sm = back::sm<back::sm_policy<T__, TPolicies...>>;
20001996
#else
@@ -2122,7 +2118,7 @@ struct state<TState(history_state)> : state_impl<state<TState(history_state)>> {
21222118
return transition<T, state>{t, *this};
21232119
}
21242120
};
2125-
#if defined(COMPILING_WITH_MSVC)
2121+
#if defined(_MSC_VER) && !defined(__clang__)
21262122
template <class T, class T__ = aux::remove_reference_t<decltype(aux::declval<T>())>, class = void>
21272123
struct state_sm {
21282124
using type = state<T>;
@@ -2593,7 +2589,7 @@ struct transition<state<internal>, state<S2>, front::event<E>, always, none> {
25932589
};
25942590
}
25952591
using _ = back::_;
2596-
#if !defined(COMPILING_WITH_MSVC)
2592+
#if !defined(_MSC_VER) && !defined(__clang__)
25972593
template <class TEvent>
25982594
constexpr front::event<TEvent> event{};
25992595
#else
@@ -2610,15 +2606,15 @@ template <class T>
26102606
front::event<back::exception<T>> exception __BOOST_SML_VT_INIT;
26112607
using anonymous = back::anonymous;
26122608
using initial = back::initial;
2613-
#if !defined(COMPILING_WITH_MSVC)
2609+
#if !defined(_MSC_VER) && !defined(__clang__)
26142610
template <class T>
26152611
constexpr typename front::state_sm<T>::type state{};
26162612
#else
26172613
template <class T>
26182614
typename front::state_sm<T>::type state __BOOST_SML_VT_INIT;
26192615
#endif
26202616
inline namespace literals {
2621-
#if !defined(COMPILING_WITH_MSVC)
2617+
#if !defined(_MSC_VER) && !defined(__clang__)
26222618
template <class T, T... Chrs>
26232619
constexpr auto operator""_s() {
26242620
return front::state<aux::string<T, Chrs...>>{};
@@ -2649,10 +2645,9 @@ BOOST_SML_NAMESPACE_END
26492645
#elif defined(__GNUC__) && defined(__BOOST_SML_DEFINED_HAS_BUILTIN)
26502646
#undef __has_builtin
26512647
#pragma GCC diagnostic pop
2652-
#elif defined(COMPILING_WITH_MSVC) && defined(__BOOST_SML_DEFINED_HAS_BUILTIN)
2648+
#elif defined(_MSC_VER) && !defined(__clang__) && defined(__BOOST_SML_DEFINED_HAS_BUILTIN)
26532649
#undef __has_builtin
26542650
#undef __has_builtin__make_integer_seq
26552651
#endif
2656-
#undef COMPILING_WITH_MSVC
26572652
#endif
26582653
#endif

include/boost/sml/aux_/type_traits.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ template <class T>
8383
struct is_same<T, T> : true_type {};
8484

8585
template <class T, class U>
86-
#if defined(_MSC_VER) // __pph__
86+
#if defined(_MSC_VER) && !defined(__clang__) // __pph__
8787
struct is_base_of : integral_constant<bool, __is_base_of(T, U)> {
8888
};
8989
#else // __pph__
@@ -95,7 +95,7 @@ decltype(T(declval<TArgs>()...), true_type{}) test_is_constructible(int);
9595
template <class, class...>
9696
false_type test_is_constructible(...);
9797
template <class T, class... TArgs>
98-
#if defined(_MSC_VER) // __pph__
98+
#if defined(_MSC_VER) && !defined(__clang__) // __pph__
9999
struct is_constructible : decltype(test_is_constructible<T, TArgs...>(0)) {
100100
};
101101
#else // __pph__

include/boost/sml/aux_/utility.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ struct missing_ctor_parameter {
160160
return {};
161161
}
162162

163-
#if !defined(_MSC_VER) // __pph__
163+
#if !defined(_MSC_VER) && !defined(__clang__) // __pph__
164164
template <class TMissing, __BOOST_SML_REQUIRES(!aux::is_base_of<pool_type_base, TMissing>::value)>
165165
operator TMissing &() const {
166166
static_assert(missing_ctor_parameter<TMissing>::value,
@@ -253,7 +253,7 @@ struct size<T<Ts...>> {
253253
static constexpr auto value = sizeof...(Ts);
254254
};
255255

256-
#if defined(_MSC_VER) // __pph__
256+
#if defined(_MSC_VER) && !defined(__clang__) // __pph__
257257
constexpr int max_impl() { return 0; }
258258
constexpr int max_impl(int r) { return r; }
259259
constexpr int max_impl(int r, int i) { return r > i ? r : i; }
@@ -306,7 +306,7 @@ auto get_type_name(const char *ptr, index_sequence<Ns...>) {
306306

307307
template <class T>
308308
const char *get_type_name() {
309-
#if defined(_MSC_VER) // __pph__
309+
#if defined(_MSC_VER) && !defined(__clang__) // __pph__
310310
return detail::get_type_name<T, 34>(__FUNCSIG__, make_index_sequence<sizeof(__FUNCSIG__) - 34 - 8>{});
311311
#elif defined(__clang__) // __pph__
312312
return detail::get_type_name<T, 58>(__PRETTY_FUNCTION__, make_index_sequence<sizeof(__PRETTY_FUNCTION__) - 58 - 2>{});

include/boost/sml/back/policies.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ template <class SM, class... TPolicies>
3939
struct sm_policy {
4040
static_assert(aux::is_same<aux::remove_reference_t<SM>, SM>::value, "SM type can't have qualifiers");
4141

42-
#if defined(_MSC_VER) // __pph__
42+
#if defined(_MSC_VER) && !defined(__clang__) // __pph__
4343
using default_dispatch_policy = policies::jump_table;
4444
#elif defined(__clang__) // __pph__
4545
using default_dispatch_policy = policies::jump_table;

include/boost/sml/back/state_machine.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ struct sm_impl : aux::conditional_t<aux::is_empty<typename TSM::sm>::value, aux:
174174
__BOOST_SML_REQUIRES(aux::is_base_of<get_generic_t<TEvent>, events_ids_t>::value)>
175175
bool process_internal_generic_event(const TEvent &event, TDeps &deps, TSubs &subs, state_t &current_state) {
176176
policies::log_process_event<sm_t>(aux::type<logger_t>{}, deps, event);
177-
#if BOOST_SML_DISABLE_EXCEPTIONS
177+
#if BOOST_SML_DISABLE_EXCEPTIONS // __pph__
178178
return process_event_impl<get_event_mapping_t<get_generic_t<TEvent>, mappings>>(event, deps, subs, states_t{},
179179
current_state);
180-
#else
180+
#else // __pph__
181181
return process_event_noexcept<get_event_mapping_t<get_generic_t<TEvent>, mappings>>(event, deps, subs, current_state,
182182
has_exceptions{});
183-
#endif
183+
#endif // __pph__
184184
}
185185

186186
template <class TEvent, class TDeps, class TSubs,

include/boost/sml/front/actions/process.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct process {
1919
explicit process_impl(const TEvent& event) : event(event) {}
2020

2121
template <class T, class TSM, class TDeps, class TSubs>
22-
void operator()(const T&, TSM&, TDeps&, TSubs&) {
22+
void operator()(const T&, TSM&, TDeps&, TSubs& subs) {
2323
aux::get<get_root_sm_t<TSubs>>(subs).process_.push(event);
2424
}
2525

include/boost/sml/front/state.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ struct state<TState(history_state)> : state_impl<state<TState(history_state)>> {
101101
}
102102
};
103103

104-
#if defined(_MSC_VER) // __pph__
104+
#if defined(_MSC_VER) && !defined(__clang__) // __pph__
105105
template <class T, class T__ = aux::remove_reference_t<decltype(aux::declval<T>())>, class = void>
106106
struct state_sm {
107107
using type = state<T>;

include/boost/sml/state_machine.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using process_queue = back::policies::process_queue<T>;
2727

2828
/// state machine
2929

30-
#if defined(_MSC_VER) // __pph__
30+
#if defined(_MSC_VER) && !defined(__clang__) // __pph__
3131
template <class T, class... TPolicies, class T__ = aux::remove_reference_t<decltype(aux::declval<T>())>>
3232
using sm = back::sm<back::sm_policy<T__, TPolicies...>>;
3333
#else // __pph__

0 commit comments

Comments
 (0)