Skip to content

Commit b48be63

Browse files
committed
Fix clang compile; fix Windows, macOS packaging
Credits go to peetonn: peetonn@cfe4a89 peetonn@8953025
1 parent 661d1b9 commit b48be63

File tree

5 files changed

+12
-25
lines changed

5 files changed

+12
-25
lines changed

Source/Rosbridge2Unreal/Public/DataHelpers.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ namespace DataHelpers
138138
{
139139
ROSData Data;
140140
Message->ToData(Data);
141-
DataHelpers::Append<ROSData>(OutMessage, Key, Data);
141+
Internal::DataConverter<ROSData>::Append(OutMessage, Key, Data);
142142
}
143143

144144
static inline bool Extract(const ROSData& Message, const char* Key, T*& OutMessageInstance)
@@ -174,17 +174,16 @@ namespace DataHelpers
174174
for (const auto& Value : Array)
175175
{
176176
const std::string Path = "/" + std::to_string(ArrayData.size());
177-
DataHelpers::Append(ArrayData, Path.c_str(), Value);
177+
Internal::DataConverter<T>::Append(ArrayData, Path.c_str(), Value);
178178
}
179179

180-
DataHelpers::Append<ROSData>(OutMessage, Key, ArrayData);
180+
Internal::DataConverter<ROSData>::Append(OutMessage, Key, ArrayData);
181181
}
182182

183-
template <typename T, typename Allocator>
184183
static inline bool Extract(const ROSData& Message, const char* Key, TArray<T, Allocator>& Array)
185184
{
186185
ROSData ArrayData;
187-
if (!DataHelpers::Extract<ROSData>(Message, Key, ArrayData) || !ArrayData.is_array())
186+
if (!Internal::DataConverter<ROSData>::Extract(Message, Key, ArrayData) || !ArrayData.is_array())
188187
{
189188
return false;
190189
}
@@ -193,7 +192,7 @@ namespace DataHelpers
193192
for (uint64 i = 0; i < ArrayData.size(); i++)
194193
{
195194
const std::string Path = "/" + std::to_string(i);
196-
if (!DataHelpers::Extract(ArrayData, Path.c_str(), Array[i]))
195+
if (!Internal::DataConverter<T>::Extract(ArrayData, Path.c_str(), Array[i]))
197196
{
198197
return false;
199198
}
@@ -251,4 +250,4 @@ namespace DataHelpers
251250
Message.insert_or_assign(Key, Data);
252251
}
253252
}
254-
} // namespace DataHelpers
253+
} // namespace DataHelpers

Source/Rosbridge2Unreal/Rosbridge2Unreal.Build.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public Rosbridge2Unreal(ReadOnlyTargetRules Target) : base(Target)
1010
{
1111
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
1212

13+
bEnableExceptions = true;
14+
1315
PublicDefinitions.AddRange(
1416
new string[]{}
1517
);

Source/ThirdParty/jsoncons/include/jsoncons/basic_json.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3390,7 +3390,6 @@ class basic_json
33903390
indenting line_indent,
33913391
std::error_code& ec) const
33923392
{
3393-
using string_type = std::basic_string<char_type,char_traits_type,SAllocator>;
33943393
if (line_indent == indenting::indent)
33953394
{
33963395
basic_json_encoder<char_type,jsoncons::string_sink<string_type>> encoder(s, options);
@@ -3408,7 +3407,6 @@ class basic_json
34083407
indenting line_indent,
34093408
std::error_code& ec) const
34103409
{
3411-
using string_type = std::basic_string<char_type,char_traits_type,SAllocator>;
34123410
if (line_indent == indenting::indent)
34133411
{
34143412
basic_json_encoder<char_type,jsoncons::string_sink<string_type>> encoder(s);
@@ -3902,8 +3900,6 @@ class basic_json
39023900
template <class SAllocator=std::allocator<char_type>>
39033901
std::basic_string<char_type,char_traits_type,SAllocator> as_string(const SAllocator& alloc) const
39043902
{
3905-
using string_type = std::basic_string<char_type,char_traits_type,SAllocator>;
3906-
39073903
converter<string_type> convert(alloc);
39083904
std::error_code ec;
39093905
switch (var_.storage())
@@ -4686,7 +4682,6 @@ class basic_json
46864682

46874683
std::basic_string<char_type> to_string() const noexcept
46884684
{
4689-
using string_type = std::basic_string<char_type>;
46904685
string_type s;
46914686
basic_compact_json_encoder<char_type, jsoncons::string_sink<string_type>> encoder(s);
46924687
dump(encoder);
@@ -4700,7 +4695,6 @@ class basic_json
47004695
std::basic_string<char_type, char_traits_type, SAllocator> to_string(const basic_json_encode_options<char_type>& options,
47014696
const SAllocator& alloc = SAllocator()) const
47024697
{
4703-
using string_type = std::basic_string<char_type, char_traits_type, SAllocator>;
47044698
string_type s(alloc);
47054699
basic_compact_json_encoder<char_type, jsoncons::string_sink<string_type>> encoder(s, options);
47064700
dump(encoder);

Source/ThirdParty/jsoncons/include/jsoncons/config/compiler_support.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@
165165

166166
#if !defined(JSONCONS_NO_EXCEPTIONS)
167167

168-
#if __GNUC__ && !__EXCEPTIONS
168+
#if __GNUC__ && !defined(__EXCEPTIONS)
169169
# define JSONCONS_NO_EXCEPTIONS 1
170-
#elif _MSC_VER
170+
#elif defined(_MSC_VER)
171171
#if defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS == 0
172172
# define JSONCONS_NO_EXCEPTIONS 1
173173
#elif !defined(_CPPUNWIND)
@@ -192,10 +192,10 @@
192192
#if !defined(JSONCONS_HAS_STD_MAKE_UNIQUE)
193193
#if defined(__clang__)
194194
#if defined(__APPLE__)
195-
#if __clang_major__ >= 6 && _cplusplus >= 201103L // Xcode 6
195+
#if __clang_major__ >= 6 && __cplusplus >= 201103L // Xcode 6
196196
#define JSONCONS_HAS_STD_MAKE_UNIQUE
197197
#endif
198-
#elif ((__clang_major__*100 +__clang_minor__) >= 340) && _cplusplus > 201103L
198+
#elif ((__clang_major__*100 +__clang_minor__) >= 340) && __cplusplus > 201103L
199199
#define JSONCONS_HAS_STD_MAKE_UNIQUE
200200
#endif
201201
#elif defined(__GNUC__)

Source/ThirdParty/jsoncons/include/jsoncons/staj_iterator.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ namespace jsoncons {
126126

127127
void next()
128128
{
129-
using char_type = typename Json::char_type;
130-
131129
if (!done())
132130
{
133131
view_->cursor_->next();
@@ -145,8 +143,6 @@ namespace jsoncons {
145143

146144
void next(std::error_code& ec)
147145
{
148-
using char_type = typename Json::char_type;
149-
150146
if (!done())
151147
{
152148
view_->cursor_->next(ec);
@@ -272,8 +268,6 @@ namespace jsoncons {
272268

273269
void next()
274270
{
275-
using char_type = typename Json::char_type;
276-
277271
view_->cursor_->next();
278272
if (!done())
279273
{
@@ -294,8 +288,6 @@ namespace jsoncons {
294288

295289
void next(std::error_code& ec)
296290
{
297-
using char_type = typename Json::char_type;
298-
299291
view_->cursor_->next(ec);
300292
if (ec)
301293
{

0 commit comments

Comments
 (0)