summaryrefslogtreecommitdiffhomepage
path: root/compat/util.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'compat/util.hpp')
-rw-r--r--compat/util.hpp12
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)
{