From bcc1369f6e2295f0d7802b1766e8d0fa92174cff Mon Sep 17 00:00:00 2001 From: Curve Date: Mon, 6 May 2024 23:20:54 +0200 Subject: [PATCH] fix: compiler warnings --- include/lime/hooks/convention.hpp | 8 ++++---- include/lime/hooks/convention.inl | 17 +++++++++++++---- include/lime/hooks/hook.inl | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/include/lime/hooks/convention.hpp b/include/lime/hooks/convention.hpp index 41db55a..d4a9352 100644 --- a/include/lime/hooks/convention.hpp +++ b/include/lime/hooks/convention.hpp @@ -5,10 +5,10 @@ namespace lime enum class convention { automatic, - cdecl, - stdcall, - fastcall, - thiscall, + c_cdecl, + c_stdcall, + c_fastcall, + c_thiscall, }; namespace detail diff --git a/include/lime/hooks/convention.inl b/include/lime/hooks/convention.inl index 8edbc9b..0a3b2b7 100644 --- a/include/lime/hooks/convention.inl +++ b/include/lime/hooks/convention.inl @@ -32,10 +32,15 @@ namespace lime #define LIME_STDCALL __attribute__((stdcall)) #define LIME_FASTCALL __attribute__((fastcall)) #define LIME_THISCALL __attribute__((thiscall)) +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wattributes" #endif template - struct calling_convention + struct calling_convention { using add = Ret LIME_CDECL(Args...); @@ -47,7 +52,7 @@ namespace lime }; template - struct calling_convention + struct calling_convention { using add = Ret LIME_STDCALL(Args...); @@ -59,7 +64,7 @@ namespace lime }; template - struct calling_convention + struct calling_convention { using add = Ret LIME_FASTCALL(Args...); @@ -71,7 +76,7 @@ namespace lime }; template - struct calling_convention + struct calling_convention { using add = Ret LIME_THISCALL(Args...); @@ -81,6 +86,10 @@ namespace lime return Function(std::forward(args)...); } }; + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif }; // namespace detail #undef LIME_CDECL diff --git a/include/lime/hooks/hook.inl b/include/lime/hooks/hook.inl index af56834..08240ba 100644 --- a/include/lime/hooks/hook.inl +++ b/include/lime/hooks/hook.inl @@ -35,7 +35,7 @@ namespace lime Callable &&target) { static hook *rtn; - static auto lambda = std::forward(target); + [[maybe_unused]] static auto lambda = std::forward(target); static constexpr auto dispatch = [](T &&...args) {