diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-02-25 11:00:45 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-02-25 14:18:14 +0100 |
commit | 555515fcffe091681f28003ecc82a79c7fda1e74 (patch) | |
tree | 8c2409754e8fa81694e48f83afffdc135390caf8 | |
parent | 88ede1fa5566dd5966fe1d1cccc68b988fbb3495 (diff) |
contrib/util: add more unused attribute macros
-rw-r--r-- | compat/util.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
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<typename t> using ptr = std::unique_ptr<t>; # 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<typename t> int iround(const t& val) { |