diff --git a/src/thirdparty/dukglue/detail_function.h b/src/thirdparty/dukglue/detail_function.h index 3d715884d3..84ecbcb4cc 100644 --- a/src/thirdparty/dukglue/detail_function.h +++ b/src/thirdparty/dukglue/detail_function.h @@ -1,6 +1,8 @@ #pragma once #include "detail_stack.h" +#include "detail_types.h" +#include "detail_primitive_types.h" namespace dukglue { diff --git a/src/thirdparty/dukglue/detail_stack.h b/src/thirdparty/dukglue/detail_stack.h index f5382ab898..b8164f9404 100644 --- a/src/thirdparty/dukglue/detail_stack.h +++ b/src/thirdparty/dukglue/detail_stack.h @@ -2,6 +2,7 @@ #include +#include "detail_primitive_types.h" #include "detail_traits.h" #include "detail_types.h" diff --git a/src/thirdparty/dukglue/detail_typeinfo.h b/src/thirdparty/dukglue/detail_typeinfo.h index 5626c64c5a..e906857d02 100644 --- a/src/thirdparty/dukglue/detail_typeinfo.h +++ b/src/thirdparty/dukglue/detail_typeinfo.h @@ -1,5 +1,6 @@ #pragma once +#include #include namespace dukglue @@ -7,7 +8,7 @@ namespace dukglue namespace detail { // same as duk_get_type_name, which is private for some reason *shakes fist* - static const char* get_type_name(duk_int_t type_idx) { + static inline const char* get_type_name(duk_int_t type_idx) { static const char* names[] = { "none", "undefined", @@ -21,7 +22,7 @@ namespace dukglue "lightfunc" }; - if (type_idx >= 0 && type_idx < sizeof(names) / sizeof(names[0])) + if (type_idx >= 0 && type_idx < static_cast(sizeof(names) / sizeof(names[0]))) return names[type_idx]; else return "unknown"; diff --git a/src/thirdparty/dukglue/detail_types.h b/src/thirdparty/dukglue/detail_types.h index de86afe414..56f16eb579 100644 --- a/src/thirdparty/dukglue/detail_types.h +++ b/src/thirdparty/dukglue/detail_types.h @@ -145,7 +145,7 @@ namespace dukglue { typedef typename Bare::type BareType; //typedef DukType ThisDukType; typedef typename DukType::IsValueType IsValueType; - + static_assert(!IsValueType::value || !std::is_pointer::value, "Cannot return pointer to value type."); static_assert(!IsValueType::value || (!std::is_reference::value || std::is_const::type>::value), @@ -156,5 +156,3 @@ namespace dukglue { }; } } - -#include "detail_primitive_types.h" diff --git a/src/thirdparty/dukglue/dukexception.h b/src/thirdparty/dukglue/dukexception.h index 7d42768ebe..9643c27974 100644 --- a/src/thirdparty/dukglue/dukexception.h +++ b/src/thirdparty/dukglue/dukexception.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include @@ -37,4 +38,4 @@ public: duk_pop(ctx); } } -}; \ No newline at end of file +}; diff --git a/src/thirdparty/dukglue/public_util.h b/src/thirdparty/dukglue/public_util.h index d6ff344d8f..5dc7947cab 100644 --- a/src/thirdparty/dukglue/public_util.h +++ b/src/thirdparty/dukglue/public_util.h @@ -2,6 +2,7 @@ #include "dukexception.h" #include "detail_traits.h" // for index_tuple/make_indexes +#include "detail_types.h" // This file has some useful utility functions for users. // Hopefully this saves you from wading through the implementation. @@ -125,7 +126,7 @@ typename std::enable_if::value, RetT>::type dukglue_pcall_met dukglue::detail::SafeMethodCallData data { &obj, method_name, std::tuple(args...), nullptr }; - + duk_idx_t rc = duk_safe_call(ctx, &dukglue::detail::call_method_safe, (void*) &data, 0, 1); if (rc != 0) throw DukErrorException(ctx, rc); @@ -234,11 +235,11 @@ typename std::enable_if::value, RetT>::type dukglue_pcall(du dukglue::detail::SafeCallData data{ &obj, std::tuple(args...), &result }; - + duk_int_t rc = duk_safe_call(ctx, &dukglue::detail::call_safe, (void*) &data, 0, 1); if (rc != 0) throw DukErrorException(ctx, rc); - + duk_pop(ctx); // remove result from stack return std::move(result); }