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.
This commit is contained in:
Romain Vimont 2022-01-01 23:27:34 +01:00
parent 6b9f397733
commit 37124e1452

View file

@ -83,6 +83,7 @@ unwrap(sc_socket socket) {
#endif #endif
} }
#ifndef HAVE_SOCK_CLOEXEC // avoid unused-function warning
static inline bool static inline bool
sc_raw_socket_close(sc_raw_socket raw_sock) { sc_raw_socket_close(sc_raw_socket raw_sock) {
#ifndef _WIN32 #ifndef _WIN32
@ -91,6 +92,7 @@ sc_raw_socket_close(sc_raw_socket raw_sock) {
return !closesocket(raw_sock); return !closesocket(raw_sock);
#endif #endif
} }
#endif
#ifndef HAVE_SOCK_CLOEXEC #ifndef HAVE_SOCK_CLOEXEC
// If SOCK_CLOEXEC does not exist, the flag must be set manually once the // If SOCK_CLOEXEC does not exist, the flag must be set manually once the