aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-11-30 17:37:07 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-11-30 18:25:12 +0100
commit109a203453e782bcaa8ac5662aac74397fa0cc1a (patch)
tree78de66037b2622030fe547e433f2d24fa1340966 /include
parentac8b9540198c7df5314f8ab709d6a5ecdd2c37a4 (diff)
downloadlibssh-109a203453e782bcaa8ac5662aac74397fa0cc1a.tar.gz
libssh-109a203453e782bcaa8ac5662aac74397fa0cc1a.tar.xz
libssh-109a203453e782bcaa8ac5662aac74397fa0cc1a.zip
include: Add macro for unused arguments and variables
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include')
-rw-r--r--include/libssh/priv.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 01659411..de7ffdf2 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -302,8 +302,6 @@ int ssh_connector_remove_event(ssh_connector connector);
void explicit_bzero(void *s, size_t n);
#endif /* !HAVE_EXPLICIT_BZERO */
-#define UNUSED(x) (void)(x)
-
/**
* This is a hack to fix warnings. The idea is to use this everywhere that we
* get the "discarding const" warning by the compiler. That doesn't actually
@@ -388,6 +386,22 @@ void explicit_bzero(void *s, size_t n);
# endif /* HAVE_FALLTHROUGH_ATTRIBUTE */
#endif /* FALL_THROUGH */
+#ifndef __unused__
+# ifdef HAVE_UNUSED_ATTRIBUTE
+# define __unused__ __attribute__((unused))
+# else /* HAVE_UNUSED_ATTRIBUTE */
+# define __unused__
+# endif /* HAVE_UNUSED_ATTRIBUTE */
+#endif /* __unused__ */
+
+#ifndef UNUSED_PARAM
+#define UNUSED_PARAM(param) param __unused__
+#endif /* UNUSED_PARAM */
+
+#ifndef UNUSED_VAR
+#define UNUSED_VAR(var) __unused__ var
+#endif /* UNUSED_VAR */
+
void ssh_agent_state_free(void *data);
#endif /* _LIBSSH_PRIV_H */