Skip to content

Commit

Permalink
fix windows compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
facontidavide committed Apr 2, 2024
1 parent 7771171 commit 36489e6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/cmake_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ jobs:
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 1.59.0

- name: Create default profile
run: conan profile new default --detect
run: conan profile detect

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ CMakeSettings.json

# OSX junk
.DS_Store
CMakeUserPresets.json
9 changes: 3 additions & 6 deletions include/behaviortree_cpp/json_export.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,12 @@ template <typename T>
inline void JsonExporter::addConverter()
{
ToJonConverter to_converter = [](const BT::Any& entry, nlohmann::json& dst) {
using namespace nlohmann;
to_json(dst, *const_cast<BT::Any&>(entry).castPtr<T>());
dst = *const_cast<BT::Any&>(entry).castPtr<T>();
};
to_json_converters_.insert({ typeid(T), to_converter });

FromJonConverter from_converter = [](const nlohmann::json& dst) -> Entry {
T value;
using namespace nlohmann;
from_json(dst, value);
FromJonConverter from_converter = [](const nlohmann::json& src) -> Entry {
T value = src.get<T>();
return { BT::Any(value), BT::TypeInfo::Create<T>() };
};

Expand Down
2 changes: 1 addition & 1 deletion src/basic_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int64_t convertFromString<int64_t>(StringView str)
}

template <>
uint64_t convertFromString<unsigned long>(StringView str)
uint64_t convertFromString<uint64_t>(StringView str)
{
unsigned long result = 0;
auto [ptr, ec] = std::from_chars(str.data(), str.data() + str.size(), result);
Expand Down

0 comments on commit 36489e6

Please sign in to comment.