Skip to content

Commit

Permalink
Update Glaze and build using clang-cl
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrNamenlos123 committed Jan 18, 2024
1 parent e045b5b commit bdf642e
Show file tree
Hide file tree
Showing 60 changed files with 5,744 additions and 1,912 deletions.
1 change: 1 addition & 0 deletions src/core/include/battery/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "eventbus.hpp"
#include "events.hpp"
#include "renderer.hpp"
#include <optional>

extern std::unique_ptr<b::Application> CreateApp();

Expand Down
4 changes: 2 additions & 2 deletions src/core/include/battery/thread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ namespace b {
: std::jthread([func = std::forward<Fn>(func), ...args = std::forward<Args>(args), this]() mutable {
m_waitRunningPromise.set_value();
if constexpr (std::is_invocable_v<std::decay_t<Fn>, std::stop_token, std::decay_t<Args>...>) {
if (!catchCommonExceptions(std::move(func), get_stop_token(), std::move(args)...)) {
if (!CatchCommonExceptions(std::move(func), get_stop_token(), std::move(args)...)) {
closeApplicationIfExists();
}
} else {
if (!catchCommonExceptions(std::move(func), std::move(args)...)) {
if (!CatchCommonExceptions(std::move(func), std::move(args)...)) {
closeApplicationIfExists();
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/core/include/glaze/api/impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ namespace glz
}

template <class Arg_tuple, class F, class Parent, size_t... Is>
requires std::invocable<F, Parent, ref_t<std::tuple_element_t<Is, Arg_tuple>>...> decltype(auto)
call_args(F&& f, Parent&& parent, [[maybe_unused]] std::span<void*> args, std::index_sequence<Is...>)
requires std::invocable<F, Parent, ref_t<std::tuple_element_t<Is, Arg_tuple>>...>
decltype(auto) call_args(F&& f, Parent&& parent, [[maybe_unused]] std::span<void*> args,
std::index_sequence<Is...>)
{
return f(parent, to_ref<std::tuple_element_t<Is, Arg_tuple>>(args[Is])...);
}
Expand Down Expand Up @@ -245,8 +246,8 @@ namespace glz
static constexpr auto h = glz::hash<F>();
if (h == type_hash) [[likely]] {
auto* f = new F{};
*f = [parent = &parent, val = &val](auto&&... args) -> decltype(auto) {
return ((*parent).*(*val))(std::forward<decltype(args)>(args)...);
*f = [=, parent = &parent](auto&&... args) -> decltype(auto) {
return ((*parent).*(val))(std::forward<decltype(args)>(args)...);
};
result = std::unique_ptr<void, void (*)(void*)>{
f, [](void* ptr) { delete static_cast<F*>(ptr); }};
Expand Down
2 changes: 1 addition & 1 deletion src/core/include/glaze/api/lib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <dlfcn.h>
#define SHARED_LIBRARY_EXTENSION ".dylib"
#define SHARED_LIBRARY_PREFIX "lib"
#elif __linux__
#elif __has_include(<dlfcn.h>)
#include <dlfcn.h>
#define SHARED_LIBRARY_EXTENSION ".so"
#define SHARED_LIBRARY_PREFIX "lib"
Expand Down
Loading

0 comments on commit bdf642e

Please sign in to comment.