Skip to content

Commit 3962ebf

Browse files
committed
More wasm fixes. Was breaking throw() declaration
1 parent 72d1a86 commit 3962ebf

64 files changed

Lines changed: 299 additions & 298 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

include/msgpack/adaptor/tr1/unordered_map.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace adaptor {
4747
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
4848
struct convert<MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> > {
4949
msgpack::object const& operator()(msgpack::object const& o, MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>& v) const {
50-
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
50+
if(o.type != msgpack::type::MAP) { THROW msgpack::type_error(); }
5151
msgpack::object_kv* p(o.via.map.ptr);
5252
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
5353
MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc> tmp;
@@ -103,7 +103,7 @@ struct object_with_zone<MSGPACK_STD_TR1::unordered_map<K, V, Hash, Pred, Alloc>
103103
template <typename K, typename V, typename Hash, typename Pred, typename Alloc>
104104
struct convert<MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> > {
105105
msgpack::object const& operator()(msgpack::object const& o, MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc>& v) const {
106-
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
106+
if(o.type != msgpack::type::MAP) { THROW msgpack::type_error(); }
107107
msgpack::object_kv* p(o.via.map.ptr);
108108
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
109109
MSGPACK_STD_TR1::unordered_multimap<K, V, Hash, Pred, Alloc> tmp;

include/msgpack/adaptor/tr1/unordered_set.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace adaptor {
4747
template <typename T, typename Hash, typename Compare, typename Alloc>
4848
struct convert<MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc> > {
4949
msgpack::object const& operator()(msgpack::object const& o, MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc>& v) const {
50-
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
50+
if(o.type != msgpack::type::ARRAY) { THROW msgpack::type_error(); }
5151
msgpack::object* p = o.via.array.ptr + o.via.array.size;
5252
msgpack::object* const pbegin = o.via.array.ptr;
5353
MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc> tmp;
@@ -101,7 +101,7 @@ struct object_with_zone<MSGPACK_STD_TR1::unordered_set<T, Hash, Compare, Alloc>
101101
template <typename T, typename Hash, typename Compare, typename Alloc>
102102
struct convert<MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc> > {
103103
msgpack::object const& operator()(msgpack::object const& o, MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc>& v) const {
104-
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
104+
if(o.type != msgpack::type::ARRAY) { THROW msgpack::type_error(); }
105105
msgpack::object* p = o.via.array.ptr + o.via.array.size;
106106
msgpack::object* const pbegin = o.via.array.ptr;
107107
MSGPACK_STD_TR1::unordered_multiset<T, Hash, Compare, Alloc> tmp;

include/msgpack/assert.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ struct AbortStream {
3030
std::abort();
3131
}
3232
};
33-
#define throw AbortStream() <<
33+
#define THROW AbortStream() <<
3434
#define try if (true)
3535
#define catch(...) if (false)
36-
#define RETHROW
36+
#define RETHROW
3737
#else
38-
#define RETHROW throw
38+
#define THROW throw
39+
#define RETHROW THROW
3940
#endif
4041

4142
#endif // MSGPACK_ASSERT_HPP

include/msgpack/v1/adaptor/array_ref.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ namespace adaptor {
154154
template <typename T>
155155
struct convert<msgpack::type::array_ref<T> > {
156156
msgpack::object const& operator()(msgpack::object const& o, msgpack::type::array_ref<T>& v) const {
157-
if (!v.data) { throw msgpack::type_error(); }
158-
if (o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
159-
if (v.size() < o.via.bin.size) { throw msgpack::type_error(); }
157+
if (!v.data) { THROW msgpack::type_error(); }
158+
if (o.type != msgpack::type::ARRAY) { THROW msgpack::type_error(); }
159+
if (v.size() < o.via.bin.size) { THROW msgpack::type_error(); }
160160
if (o.via.array.size > 0) {
161161
msgpack::object* p = o.via.array.ptr;
162162
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;
@@ -174,9 +174,9 @@ struct convert<msgpack::type::array_ref<T> > {
174174
template <typename T, std::size_t N>
175175
struct convert<msgpack::type::array_ref<T[N]> > {
176176
msgpack::object const& operator()(msgpack::object const& o, msgpack::type::array_ref<T[N]>& v) const {
177-
if (!v.data) { throw msgpack::type_error(); }
178-
if (o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
179-
if (v.size() < o.via.bin.size) { throw msgpack::type_error(); }
177+
if (!v.data) { THROW msgpack::type_error(); }
178+
if (o.type != msgpack::type::ARRAY) { THROW msgpack::type_error(); }
179+
if (v.size() < o.via.bin.size) { THROW msgpack::type_error(); }
180180
if (o.via.array.size > 0) {
181181
msgpack::object* p = o.via.array.ptr;
182182
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;
@@ -194,8 +194,8 @@ struct convert<msgpack::type::array_ref<T[N]> > {
194194
template <typename T>
195195
struct convert<msgpack::type::array_ref<std::vector<T> > > {
196196
msgpack::object const& operator()(msgpack::object const& o, msgpack::type::array_ref<std::vector<T> >& v) const {
197-
if (!v.data) { throw msgpack::type_error(); }
198-
if (o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
197+
if (!v.data) { THROW msgpack::type_error(); }
198+
if (o.type != msgpack::type::ARRAY) { THROW msgpack::type_error(); }
199199
v.data->resize(o.via.bin.size);
200200
if (o.via.array.size > 0) {
201201
msgpack::object* p = o.via.array.ptr;
@@ -215,7 +215,7 @@ template <typename T>
215215
struct pack<msgpack::type::array_ref<T> > {
216216
template <typename Stream>
217217
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const msgpack::type::array_ref<T>& v) const {
218-
if (!v.data) { throw msgpack::type_error(); }
218+
if (!v.data) { THROW msgpack::type_error(); }
219219
uint32_t size = checked_get_container_size(v.size());
220220
o.pack_array(size);
221221
for (typename T::const_iterator it(v.data->begin()), it_end(v.data->end());
@@ -230,7 +230,7 @@ template <typename T, std::size_t N>
230230
struct pack<msgpack::type::array_ref<T[N]> > {
231231
template <typename Stream>
232232
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const msgpack::type::array_ref<T[N]>& v) const {
233-
if (!v.data) { throw msgpack::type_error(); }
233+
if (!v.data) { THROW msgpack::type_error(); }
234234
uint32_t size = checked_get_container_size(v.size());
235235
o.pack_array(size);
236236
for (T const* it = v.data;
@@ -244,7 +244,7 @@ struct pack<msgpack::type::array_ref<T[N]> > {
244244
template <typename T>
245245
struct object_with_zone<msgpack::type::array_ref<T> > {
246246
void operator()(msgpack::object::with_zone& o, const msgpack::type::array_ref<T>& v) const {
247-
if (!v.data) { throw msgpack::type_error(); }
247+
if (!v.data) { THROW msgpack::type_error(); }
248248
o.type = msgpack::type::ARRAY;
249249
if (v.data->empty()) {
250250
o.via.array.ptr = MSGPACK_NULLPTR;
@@ -277,7 +277,7 @@ struct object_with_zone<msgpack::type::array_ref<T> > {
277277
template <typename T, std::size_t N>
278278
struct object_with_zone<msgpack::type::array_ref<T[N]> > {
279279
void operator()(msgpack::object::with_zone& o, const msgpack::type::array_ref<T[N]>& v) const {
280-
if (!v.data) { throw msgpack::type_error(); }
280+
if (!v.data) { THROW msgpack::type_error(); }
281281
o.type = msgpack::type::ARRAY;
282282
uint32_t size = checked_get_container_size(v.size());
283283
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*size, MSGPACK_ZONE_ALIGNOF(msgpack::object)));

include/msgpack/v1/adaptor/bool.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace adaptor {
2525
template <>
2626
struct convert<bool> {
2727
msgpack::object const& operator()(msgpack::object const& o, bool& v) const {
28-
if(o.type != msgpack::type::BOOLEAN) { throw msgpack::type_error(); }
28+
if(o.type != msgpack::type::BOOLEAN) { THROW msgpack::type_error(); }
2929
v = o.via.boolean;
3030
return o;
3131
}

include/msgpack/v1/adaptor/boost/fusion.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ struct as<
112112
>::type
113113
> {
114114
T operator()(msgpack::object const& o) const {
115-
if (o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
115+
if (o.type != msgpack::type::ARRAY) { THROW msgpack::type_error(); }
116116
if (o.via.array.size != checked_get_container_size(boost::mpl::size<T>::value)) {
117-
throw msgpack::type_error();
117+
THROW msgpack::type_error();
118118
}
119119
using tuple_t = decltype(to_tuple(std::declval<T>(), gen_seq<boost::mpl::size<T>::value>()));
120120
return to_t(
@@ -140,9 +140,9 @@ struct as<
140140
template <typename T>
141141
struct convert<T, typename msgpack::enable_if<detail::is_seq_no_pair_no_tuple<T>::value>::type > {
142142
msgpack::object const& operator()(msgpack::object const& o, T& v) const {
143-
if (o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
143+
if (o.type != msgpack::type::ARRAY) { THROW msgpack::type_error(); }
144144
if (o.via.array.size != checked_get_container_size(boost::fusion::size(v))) {
145-
throw msgpack::type_error();
145+
THROW msgpack::type_error();
146146
}
147147
uint32_t index = 0;
148148
boost::fusion::for_each(v, convert_imp(o, index));

include/msgpack/v1/adaptor/boost/msgpack_variant.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ struct object_imp : boost::static_visitor<void> {
403403
}
404404
template <typename T>
405405
void operator()(T const&) const {
406-
throw msgpack::type_error();
406+
THROW msgpack::type_error();
407407
}
408408
object_imp(msgpack::object& o):o_(o) {}
409409
msgpack::object& o_;

include/msgpack/v1/adaptor/boost/string_ref.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct convert<boost::string_ref> {
3939
v = boost::string_ref(o.via.str.ptr, o.via.str.size);
4040
break;
4141
default:
42-
throw msgpack::type_error();
42+
THROW msgpack::type_error();
4343
break;
4444
}
4545
return o;

include/msgpack/v1/adaptor/boost/string_view.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct convert<boost::string_view> {
3939
v = boost::string_view(o.via.str.ptr, o.via.str.size);
4040
break;
4141
default:
42-
throw msgpack::type_error();
42+
THROW msgpack::type_error();
4343
break;
4444
}
4545
return o;

include/msgpack/v1/adaptor/carray.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ namespace adaptor {
2626
template <typename T, std::size_t N>
2727
struct convert<T[N]> {
2828
msgpack::object const& operator()(msgpack::object const& o, T* v) const {
29-
if (o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
30-
if (o.via.array.size > N) { throw msgpack::type_error(); }
29+
if (o.type != msgpack::type::ARRAY) { THROW msgpack::type_error(); }
30+
if (o.via.array.size > N) { THROW msgpack::type_error(); }
3131
msgpack::object* p = o.via.array.ptr;
3232
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;
3333
do {
@@ -44,16 +44,16 @@ struct convert<char[N]> {
4444
msgpack::object const& operator()(msgpack::object const& o, char(&v)[N]) const {
4545
switch (o.type) {
4646
case msgpack::type::BIN:
47-
if (o.via.bin.size > N) { throw msgpack::type_error(); }
47+
if (o.via.bin.size > N) { THROW msgpack::type_error(); }
4848
std::memcpy(v, o.via.bin.ptr, o.via.bin.size);
4949
break;
5050
case msgpack::type::STR:
51-
if (o.via.str.size > N) { throw msgpack::type_error(); }
51+
if (o.via.str.size > N) { THROW msgpack::type_error(); }
5252
std::memcpy(v, o.via.str.ptr, o.via.str.size);
5353
if (o.via.str.size < N) v[o.via.str.size] = '\0';
5454
break;
5555
default:
56-
throw msgpack::type_error();
56+
THROW msgpack::type_error();
5757
break;
5858
}
5959
return o;
@@ -65,16 +65,16 @@ struct convert<unsigned char[N]> {
6565
msgpack::object const& operator()(msgpack::object const& o, unsigned char(&v)[N]) const {
6666
switch (o.type) {
6767
case msgpack::type::BIN:
68-
if (o.via.bin.size > N) { throw msgpack::type_error(); }
68+
if (o.via.bin.size > N) { THROW msgpack::type_error(); }
6969
std::memcpy(v, o.via.bin.ptr, o.via.bin.size);
7070
break;
7171
case msgpack::type::STR:
72-
if (o.via.str.size > N) { throw msgpack::type_error(); }
72+
if (o.via.str.size > N) { THROW msgpack::type_error(); }
7373
std::memcpy(v, o.via.str.ptr, o.via.str.size);
7474
if (o.via.str.size < N) v[o.via.str.size] = '\0';
7575
break;
7676
default:
77-
throw msgpack::type_error();
77+
THROW msgpack::type_error();
7878
break;
7979
}
8080
return o;

0 commit comments

Comments
 (0)