Skip to content

Commit

Permalink
Fix clang compile; fix Windows, macOS packaging
Browse files Browse the repository at this point in the history
Credits go to peetonn: peetonn@cfe4a89
peetonn@8953025
  • Loading branch information
PhDittmann committed Jun 5, 2023
1 parent 661d1b9 commit b48be63
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 25 deletions.
13 changes: 6 additions & 7 deletions Source/Rosbridge2Unreal/Public/DataHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ namespace DataHelpers
{
ROSData Data;
Message->ToData(Data);
DataHelpers::Append<ROSData>(OutMessage, Key, Data);
Internal::DataConverter<ROSData>::Append(OutMessage, Key, Data);
}

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

DataHelpers::Append<ROSData>(OutMessage, Key, ArrayData);
Internal::DataConverter<ROSData>::Append(OutMessage, Key, ArrayData);
}

template <typename T, typename Allocator>
static inline bool Extract(const ROSData& Message, const char* Key, TArray<T, Allocator>& Array)
{
ROSData ArrayData;
if (!DataHelpers::Extract<ROSData>(Message, Key, ArrayData) || !ArrayData.is_array())
if (!Internal::DataConverter<ROSData>::Extract(Message, Key, ArrayData) || !ArrayData.is_array())
{
return false;
}
Expand All @@ -193,7 +192,7 @@ namespace DataHelpers
for (uint64 i = 0; i < ArrayData.size(); i++)
{
const std::string Path = "/" + std::to_string(i);
if (!DataHelpers::Extract(ArrayData, Path.c_str(), Array[i]))
if (!Internal::DataConverter<T>::Extract(ArrayData, Path.c_str(), Array[i]))
{
return false;
}
Expand Down Expand Up @@ -251,4 +250,4 @@ namespace DataHelpers
Message.insert_or_assign(Key, Data);
}
}
} // namespace DataHelpers
} // namespace DataHelpers
2 changes: 2 additions & 0 deletions Source/Rosbridge2Unreal/Rosbridge2Unreal.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public Rosbridge2Unreal(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

bEnableExceptions = true;

PublicDefinitions.AddRange(
new string[]{}
);
Expand Down
6 changes: 0 additions & 6 deletions Source/ThirdParty/jsoncons/include/jsoncons/basic_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3390,7 +3390,6 @@ class basic_json
indenting line_indent,
std::error_code& ec) const
{
using string_type = std::basic_string<char_type,char_traits_type,SAllocator>;
if (line_indent == indenting::indent)
{
basic_json_encoder<char_type,jsoncons::string_sink<string_type>> encoder(s, options);
Expand All @@ -3408,7 +3407,6 @@ class basic_json
indenting line_indent,
std::error_code& ec) const
{
using string_type = std::basic_string<char_type,char_traits_type,SAllocator>;
if (line_indent == indenting::indent)
{
basic_json_encoder<char_type,jsoncons::string_sink<string_type>> encoder(s);
Expand Down Expand Up @@ -3902,8 +3900,6 @@ class basic_json
template <class SAllocator=std::allocator<char_type>>
std::basic_string<char_type,char_traits_type,SAllocator> as_string(const SAllocator& alloc) const
{
using string_type = std::basic_string<char_type,char_traits_type,SAllocator>;

converter<string_type> convert(alloc);
std::error_code ec;
switch (var_.storage())
Expand Down Expand Up @@ -4686,7 +4682,6 @@ class basic_json

std::basic_string<char_type> to_string() const noexcept
{
using string_type = std::basic_string<char_type>;
string_type s;
basic_compact_json_encoder<char_type, jsoncons::string_sink<string_type>> encoder(s);
dump(encoder);
Expand All @@ -4700,7 +4695,6 @@ class basic_json
std::basic_string<char_type, char_traits_type, SAllocator> to_string(const basic_json_encode_options<char_type>& options,
const SAllocator& alloc = SAllocator()) const
{
using string_type = std::basic_string<char_type, char_traits_type, SAllocator>;
string_type s(alloc);
basic_compact_json_encoder<char_type, jsoncons::string_sink<string_type>> encoder(s, options);
dump(encoder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@

#if !defined(JSONCONS_NO_EXCEPTIONS)

#if __GNUC__ && !__EXCEPTIONS
#if __GNUC__ && !defined(__EXCEPTIONS)
# define JSONCONS_NO_EXCEPTIONS 1
#elif _MSC_VER
#elif defined(_MSC_VER)
#if defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS == 0
# define JSONCONS_NO_EXCEPTIONS 1
#elif !defined(_CPPUNWIND)
Expand All @@ -192,10 +192,10 @@
#if !defined(JSONCONS_HAS_STD_MAKE_UNIQUE)
#if defined(__clang__)
#if defined(__APPLE__)
#if __clang_major__ >= 6 && _cplusplus >= 201103L // Xcode 6
#if __clang_major__ >= 6 && __cplusplus >= 201103L // Xcode 6
#define JSONCONS_HAS_STD_MAKE_UNIQUE
#endif
#elif ((__clang_major__*100 +__clang_minor__) >= 340) && _cplusplus > 201103L
#elif ((__clang_major__*100 +__clang_minor__) >= 340) && __cplusplus > 201103L
#define JSONCONS_HAS_STD_MAKE_UNIQUE
#endif
#elif defined(__GNUC__)
Expand Down
8 changes: 0 additions & 8 deletions Source/ThirdParty/jsoncons/include/jsoncons/staj_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ namespace jsoncons {

void next()
{
using char_type = typename Json::char_type;

if (!done())
{
view_->cursor_->next();
Expand All @@ -145,8 +143,6 @@ namespace jsoncons {

void next(std::error_code& ec)
{
using char_type = typename Json::char_type;

if (!done())
{
view_->cursor_->next(ec);
Expand Down Expand Up @@ -272,8 +268,6 @@ namespace jsoncons {

void next()
{
using char_type = typename Json::char_type;

view_->cursor_->next();
if (!done())
{
Expand All @@ -294,8 +288,6 @@ namespace jsoncons {

void next(std::error_code& ec)
{
using char_type = typename Json::char_type;

view_->cursor_->next(ec);
if (ec)
{
Expand Down

0 comments on commit b48be63

Please sign in to comment.