From 37124e14527192799e15af664186d1504bbc68ec Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sat, 1 Jan 2022 23:27:34 +0100 Subject: [PATCH] Avoid unused function warning If HAVE_SOCK_CLOEXEC is not defined, then sc_raw_socket_close() is never used. Add an #ifndef block to remove the warning. --- app/src/util/net.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/util/net.c b/app/src/util/net.c index ec678d2e..565db2e9 100644 --- a/app/src/util/net.c +++ b/app/src/util/net.c @@ -83,6 +83,7 @@ unwrap(sc_socket socket) { #endif } +#ifndef HAVE_SOCK_CLOEXEC // avoid unused-function warning static inline bool sc_raw_socket_close(sc_raw_socket raw_sock) { #ifndef _WIN32 @@ -91,6 +92,7 @@ sc_raw_socket_close(sc_raw_socket raw_sock) { return !closesocket(raw_sock); #endif } +#endif #ifndef HAVE_SOCK_CLOEXEC // If SOCK_CLOEXEC does not exist, the flag must be set manually once the