Skip to content

Commit

Permalink
[ci] Multiple build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Nov 15, 2023
1 parent b16548c commit c182d95
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 29 deletions.
50 changes: 27 additions & 23 deletions include/avnd/binding/dump/DumpCBOR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,35 +471,39 @@ void print_arguments(refl, nlohmann::json& obj)
template <typename Processor, typename type>
void print_message(nlohmann::json& obj)
{
if constexpr(requires(Processor p, std::vector<std::variant<float, std::string>> v) {
type::func()(p, v);
})
using refl_type = decltype(avnd::message_function_reflection<type>());
if constexpr(!std::is_same_v<refl_type, void>)
{
obj["type"] = "type-generic";
}
else
{
if constexpr(avnd::stateless_message<type>)
{
if constexpr(std::is_member_function_pointer_v<decltype(type::func())>)
obj["type"] = "member-function-pointer";
else
obj["type"] = "free-function";
}
else if constexpr(avnd::stateful_message<type>)
{
obj["type"] = "returns-function-object";
}
else if constexpr(avnd::stdfunc_message<type>)
if constexpr(requires(Processor p, std::vector<std::variant<float, std::string>> v) {
type::func()(p, v);
})
{
obj["type"] = "std::function";
obj["type"] = "type-generic";
}
else if constexpr(avnd::function_object_message<type>)
else
{
obj["type"] = "function-object";
if constexpr(avnd::stateless_message<type>)
{
if constexpr(std::is_member_function_pointer_v<decltype(type::func())>)
obj["type"] = "member-function-pointer";
else
obj["type"] = "free-function";
}
else if constexpr(avnd::stateful_message<type>)
{
obj["type"] = "returns-function-object";
}
else if constexpr(avnd::stdfunc_message<type>)
{
obj["type"] = "std::function";
}
else if constexpr(avnd::function_object_message<type>)
{
obj["type"] = "function-object";
}
}
print_arguments(avnd::message_function_reflection<type>(), obj);
}
print_arguments(avnd::message_function_reflection<type>(), obj);
}

template <typename Processor>
Expand Down
6 changes: 4 additions & 2 deletions include/avnd/binding/ui/nuklear/nuklear.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <string.h>
#include <time.h>

// clang-format off
#define NK_INCLUDE_FIXED_TYPES
#define NK_INCLUDE_STANDARD_IO
#define NK_INCLUDE_STANDARD_VARARGS
Expand All @@ -23,16 +24,17 @@
#define NK_IMPLEMENTATION
#define NK_GLFW_GL4_IMPLEMENTATION
#define NK_KEYSTATE_BASED_INPUT
#include "nuklear_glfw_gl4.h"

#include <nuklear.h>

#define WINDOW_WIDTH 1200
#define WINDOW_HEIGHT 800

#define MAX_VERTEX_BUFFER 512 * 1024
#define MAX_ELEMENT_BUFFER 128 * 1024

#include <nuklear.h>
#include "nuklear_glfw_gl4.h"
// clang-format on
static inline int nk_tab(struct nk_context* ctx, const char* title, int active)
{
const struct nk_user_font* f = ctx->style.font;
Expand Down
2 changes: 1 addition & 1 deletion include/avnd/binding/ui/nuklear/nuklear_glfw_gl4.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ nk_glfw3_render(enum nk_anti_aliasing AA)
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_glfw_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex);
config.null = dev->null;

config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;
Expand Down
1 change: 1 addition & 0 deletions include/avnd/binding/ui/nuklear_layout_ui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <avnd/introspection/input.hpp>
#include <avnd/introspection/layout.hpp>
#include <avnd/introspection/messages.hpp>
#include <avnd/introspection/range.hpp>
#include <avnd/wrappers/metadatas.hpp>
namespace nkl
{
Expand Down
12 changes: 9 additions & 3 deletions include/avnd/wrappers/metadatas.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@

namespace avnd
{
#if __cpp_if_consteval >= 202106L
#define AVND_IF_CONSTEVAL consteval
#else
#define AVND_IF_CONSTEVAL (std::is_constant_evaluated())
#endif

#define define_get_property(PropName, Type, Default) \
template <typename T> \
constexpr Type get_##PropName() \
Expand All @@ -31,7 +37,7 @@ namespace avnd
template <typename T> \
constexpr Type get_##PropName(const T& t) \
{ \
if consteval \
if AVND_IF_CONSTEVAL \
{ \
return get_##PropName<T>(); \
} \
Expand Down Expand Up @@ -235,15 +241,15 @@ template <typename T>
if constexpr(requires {
{
T::version()
} -> std::integral;
} -> std::integral;
})
{
return T::version();
}
else if constexpr(requires {
{
std::declval<T>().version
} -> std::integral;
} -> std::integral;
})
{
return T::version;
Expand Down

0 comments on commit c182d95

Please sign in to comment.