Skip to content

Commit 8fbfc62

Browse files
committed
Removed arx libs and replaced some c++11 ifdefs
1 parent 428b9e2 commit 8fbfc62

File tree

3 files changed

+34
-30
lines changed

3 files changed

+34
-30
lines changed

src/MsgPack/Packer.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#ifndef HT_SERIAL_MSGPACK_PACKER_H
33
#define HT_SERIAL_MSGPACK_PACKER_H
44

5-
#include <ArxTypeTraits.h>
6-
#include <ArxContainer.h>
7-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
5+
#define HAVE_LIBSTDCPP11
6+
7+
#ifdef HAVE_LIBSTDCPP11
88
#include <vector>
99
#include <array>
1010
#include <deque>
@@ -205,7 +205,7 @@ namespace msgpack {
205205
packBinary(bin.data(), bin.size());
206206
}
207207

208-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
208+
#ifdef HAVE_LIBSTDCPP11
209209

210210
template <size_t N>
211211
void pack(const std::array<char, N>& bin) {
@@ -247,7 +247,7 @@ namespace msgpack {
247247
packArrayContainer(arr);
248248
}
249249

250-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
250+
#ifdef HAVE_LIBSTDCPP11
251251

252252
template <typename T, size_t N>
253253
auto pack(const std::array<T, N>& arr) ->
@@ -279,7 +279,7 @@ namespace msgpack {
279279
template <size_t I = 0, typename... Ts>
280280
auto pack(const std::tuple<Ts...>&) -> typename std::enable_if<I == sizeof...(Ts)>::type {}
281281

282-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
282+
#ifdef HAVE_LIBSTDCPP11
283283

284284
template <typename T>
285285
void pack(const std::list<T>& arr) {
@@ -327,7 +327,7 @@ namespace msgpack {
327327
packMapContainer(mp);
328328
}
329329

330-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
330+
#ifdef HAVE_LIBSTDCPP11
331331

332332
template <typename T, typename U>
333333
void pack(const std::multimap<T, U>& mp) {
@@ -648,7 +648,7 @@ namespace msgpack {
648648
}
649649

650650
void packFloat64(const double value) {
651-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
651+
#ifdef HAVE_LIBSTDCPP11
652652
packRawByte(Type::FLOAT64);
653653
packRawReversed(value);
654654
++n_indices;

src/MsgPack/Types.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,18 @@ static constexpr uint8_t INT5 = INT5_TEMP_VALUE;
2222
#define INT5 INT5
2323
#endif
2424

25-
#include <ArxTypeTraits.h>
26-
#include <ArxContainer.h>
25+
#define HAVE_LIBSTDCPP11
26+
27+
#ifdef HAVE_LIBSTDCPP11
28+
#include <vector>
29+
#include <array>
30+
#include <map>
31+
#endif
2732

2833
namespace arduino {
2934
namespace msgpack {
3035

31-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
32-
36+
#ifdef HAVE_LIBSTDCPP11
3337
using idx_t = std::vector<size_t>;
3438
template <typename T>
3539
using arr_t = std::vector<T>;

src/MsgPack/Unpacker.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#ifndef HT_SERIAL_MSGPACK_UNPACKER_H
33
#define HT_SERIAL_MSGPACK_UNPACKER_H
44

5-
#include <ArxTypeTraits.h>
6-
#include <ArxContainer.h>
7-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
5+
#define HAVE_LIBSTDCPP11
6+
7+
#ifdef HAVE_LIBSTDCPP11
88
#include <vector>
99
#include <array>
1010
#include <deque>
@@ -238,7 +238,7 @@ namespace msgpack {
238238
// - std::array<char>
239239
// - std::array<unsigned char>
240240

241-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
241+
#ifdef HAVE_LIBSTDCPP11
242242

243243
template <typename T>
244244
auto unpack(bin_t<T>& bin) ->
@@ -258,7 +258,7 @@ namespace msgpack {
258258

259259
#endif // Do not have libstdc++11
260260

261-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
261+
#ifdef HAVE_LIBSTDCPP11
262262

263263
template <typename T, size_t N>
264264
auto unpack(std::array<T, N>& bin) ->
@@ -292,7 +292,7 @@ namespace msgpack {
292292
return b_decode_success;
293293
}
294294

295-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
295+
#ifdef HAVE_LIBSTDCPP11
296296

297297
template <typename T, size_t N>
298298
auto unpack(std::array<T, N>& arr) ->
@@ -400,7 +400,7 @@ namespace msgpack {
400400
return b_decode_success;
401401
}
402402

403-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
403+
#ifdef HAVE_LIBSTDCPP11
404404

405405
template <typename T, typename U>
406406
bool unpack(std::multimap<T, U>& mp) {
@@ -588,7 +588,7 @@ namespace msgpack {
588588
}
589589
}
590590

591-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
591+
#ifdef HAVE_LIBSTDCPP11
592592

593593
template <typename T, size_t N>
594594
auto unpackBinary() -> typename std::
@@ -802,7 +802,7 @@ namespace msgpack {
802802

803803
double unpackFloat64() {
804804
MSGPACK_DECODABLE_CHECK(double);
805-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
805+
#ifdef HAVE_LIBSTDCPP11
806806
if (isFloat64())
807807
return unpackFloatUnchecked64();
808808
else
@@ -882,7 +882,7 @@ namespace msgpack {
882882
return type_error<bin_t<T>>(Type::BIN32);
883883
}
884884

885-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
885+
#ifdef HAVE_LIBSTDCPP11
886886

887887
template <typename T, size_t N>
888888
auto unpackBinary8() -> typename std::
@@ -1129,7 +1129,7 @@ namespace msgpack {
11291129
}
11301130

11311131
double unpackFloatUnchecked64() {
1132-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
1132+
#ifdef HAVE_LIBSTDCPP11
11331133
return getRawBytes<double>(curr_index++, 1);
11341134
#else
11351135
return unpackFloatUnchecked32(); // AVR does not support double
@@ -1204,7 +1204,7 @@ namespace msgpack {
12041204
return data;
12051205
}
12061206

1207-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
1207+
#ifdef HAVE_LIBSTDCPP11
12081208

12091209
template <typename T, size_t N>
12101210
auto unpackBinaryUnchecked8() -> typename std::
@@ -1469,7 +1469,7 @@ namespace msgpack {
14691469
return isBin();
14701470
}
14711471

1472-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
1472+
#ifdef HAVE_LIBSTDCPP11
14731473

14741474
template <typename T, size_t N>
14751475
auto unpackable(const std::array<T, N>& bin) const ->
@@ -1501,7 +1501,7 @@ namespace msgpack {
15011501
return isArray();
15021502
}
15031503

1504-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
1504+
#ifdef HAVE_LIBSTDCPP11
15051505

15061506
template <typename T, size_t N>
15071507
auto unpackable(const std::array<T, N>& arr) const ->
@@ -1579,7 +1579,7 @@ namespace msgpack {
15791579
return isMap();
15801580
}
15811581

1582-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
1582+
#ifdef HAVE_LIBSTDCPP11
15831583

15841584
template <typename T, typename U>
15851585
bool unpackable(const std::multimap<T, U>& mp) const {
@@ -1895,7 +1895,7 @@ namespace msgpack {
18951895
return T();
18961896
}
18971897

1898-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
1898+
#ifdef HAVE_LIBSTDCPP11
18991899
template <template <typename...> class C, class T>
19001900
void unpackArrayContainerArray(C<T>& arr)
19011901
#else // Do not have libstdc++11
@@ -1917,7 +1917,7 @@ namespace msgpack {
19171917
}
19181918
}
19191919

1920-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
1920+
#ifdef HAVE_LIBSTDCPP11
19211921
template <template <typename...> class C, class T>
19221922
void unpackArrayContainerSet(C<T>& arr)
19231923
#else // Do not have libstdc++11
@@ -1938,7 +1938,7 @@ namespace msgpack {
19381938
}
19391939
}
19401940

1941-
#if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11
1941+
#ifdef HAVE_LIBSTDCPP11
19421942
template <template <typename...> class C, class T, class U>
19431943
void unpackMapContainer(C<T, U>& mp) {
19441944
#else // Do not have libstdc++11

0 commit comments

Comments
 (0)