diff --git a/include/xemmai/engine.h b/include/xemmai/engine.h index 01c59414..96329ee7 100644 --- a/include/xemmai/engine.h +++ b/include/xemmai/engine.h @@ -32,7 +32,7 @@ class t_engine friend class t_symbol; friend struct t_code; friend struct t_safe_region; - friend XEMMAI__PORTABLE__EXPORT t_engine* f_engine(); + friend t_engine* f_engine(); public: struct t_options diff --git a/include/xemmai/global.h b/include/xemmai/global.h index 93d83d1e..52d80387 100644 --- a/include/xemmai/global.h +++ b/include/xemmai/global.h @@ -18,7 +18,7 @@ class t_global : public t_library { friend struct t_type_of; friend class t_engine; - friend XEMMAI__PORTABLE__EXPORT t_global* f_global(); + friend t_global* f_global(); static inline XEMMAI__PORTABLE__THREAD t_global* v_instance; @@ -235,7 +235,9 @@ XEMMAI__LIBRARY__TYPE(t_global, bytes) XEMMAI__LIBRARY__TYPE_AS(t_global, t_lexer::t_error, lexer__error) XEMMAI__LIBRARY__TYPE_AS(t_global, t_parser::t_error, parser__error) -#ifndef _WIN32 +#ifdef _WIN32 +XEMMAI__PORTABLE__EXPORT t_global* f_global(); +#else inline t_global* f_global() { return t_global::v_instance; diff --git a/include/xemmai/type.h b/include/xemmai/type.h index 39182671..ab68e593 100644 --- a/include/xemmai/type.h +++ b/include/xemmai/type.h @@ -324,8 +324,8 @@ void f_throw_type_error [[noreturn]] (const wchar_t* a_name) f_throw_type_error(typeid(typename t_fundamental::t_type), a_name); } -template -inline void f_check(const t_value& a_object, const wchar_t* a_name) +template +inline void f_check(const t_value& a_object, const wchar_t* a_name) { if (!f_is(a_object)) [[unlikely]] f_throw_type_error(a_name); } diff --git a/include/xemmai/value.h b/include/xemmai/value.h index 160df7be..0fa0e765 100644 --- a/include/xemmai/value.h +++ b/include/xemmai/value.h @@ -249,7 +249,7 @@ class t_value : public T_tag double v_float; }; - void f_copy(const t_value& a_value) + void f_copy(const auto& a_value) { if (sizeof(double) > sizeof(intptr_t)) v_float = a_value.v_float; @@ -273,7 +273,8 @@ class t_value : public T_tag { f_copy(a_value); } - t_value(const t_value& a_value) : T_tag(a_value) + template + t_value(const t_value& a_value) : T_tag(a_value) { f_copy(a_value); } @@ -284,7 +285,8 @@ class t_value : public T_tag f_copy(a_value); return *this; } - t_value& operator=(const t_value& a_value) + template + t_value& operator=(const t_value& a_value) { static_cast(*this) = a_value; f_copy(a_value);