From 555515fcffe091681f28003ecc82a79c7fda1e74 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 25 Feb 2017 11:00:45 +0100 Subject: contrib/util: add more unused attribute macros --- compat/util.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'compat') diff --git a/compat/util.hpp b/compat/util.hpp index 19ee1064..81142756 100644 --- a/compat/util.hpp +++ b/compat/util.hpp @@ -24,6 +24,18 @@ template using ptr = std::unique_ptr; # define DEFUN_WARN_UNUSED __attribute__((warn_unused_result)) #endif +#if defined(__GNUG__) +# define unused(t, i) t __attribute__((unused)) i +#else +# define unused(t, i) t +#endif + +#if !defined(_WIN32) +# define unused_on_unix(t, i) unused(t, i) +#else +# define unused_on_unix(t, i) t i +#endif + template int iround(const t& val) { -- cgit v1.2.3