From 758fbdd31b9124c81d7ccf3f2e981cc575c80911 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 25 Oct 2024 08:36:25 +0800 Subject: [PATCH] Add #ifndef __VA_NARG__ guard to avoid "__VA_NARG__" redefined warnings Some SDK already defined __VA_NARG__, so without #ifndef __VA_NARG__ guard we got a lot of "__VA_NARG__" redefined warnings. Fix it by adding #ifndef __VA_NARG__ guard in include/libssh/priv.h. Fixes: #279 Signed-off-by: Axel Lin Reviewed-by: Jakub Jelen (cherry picked from commit 861590192fed3627e80605be080f79aa2678a005) --- include/libssh/priv.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/libssh/priv.h b/include/libssh/priv.h index 9220f83e..35fd8506 100644 --- a/include/libssh/priv.h +++ b/include/libssh/priv.h @@ -384,6 +384,7 @@ void explicit_bzero(void *s, size_t n); */ #define discard_const_p(type, ptr) ((type *)discard_const(ptr)) +#ifndef __VA_NARG__ /** * Get the argument count of variadic arguments */ @@ -415,6 +416,7 @@ void explicit_bzero(void *s, size_t n); 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, \ 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, \ 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 +#endif #define CLOSE_SOCKET(s) do { if ((s) != SSH_INVALID_SOCKET) { _XCLOSESOCKET(s); (s) = SSH_INVALID_SOCKET;} } while(0)