From 0dfd7e3d8cd9f09deb331f59fe024452e89aae83 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 25 Nov 2023 23:03:29 +0100 Subject: [PATCH] net/SocketDescriptor: SO_PROTOCOL is really Linux-specific --- src/net/SocketDescriptor.cxx | 4 ++-- src/net/SocketDescriptor.hxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/net/SocketDescriptor.cxx b/src/net/SocketDescriptor.cxx index ecf339df4..f90feae8f 100644 --- a/src/net/SocketDescriptor.cxx +++ b/src/net/SocketDescriptor.cxx @@ -32,7 +32,7 @@ SocketDescriptor::IsStream() const noexcept return GetType() == SOCK_STREAM; } -#ifndef _WIN32 +#ifdef __linux__ int SocketDescriptor::GetProtocol() const noexcept @@ -40,7 +40,7 @@ SocketDescriptor::GetProtocol() const noexcept return GetIntOption(SOL_SOCKET, SO_PROTOCOL, -1); } -#endif // !_WIN32 +#endif // __linux__ #ifdef _WIN32 diff --git a/src/net/SocketDescriptor.hxx b/src/net/SocketDescriptor.hxx index a25641c0c..143a88417 100644 --- a/src/net/SocketDescriptor.hxx +++ b/src/net/SocketDescriptor.hxx @@ -101,14 +101,14 @@ public: [[gnu::pure]] bool IsStream() const noexcept; -#ifndef _WIN32 +#ifdef __linux__ /** * Determine the socket protocol (SO_PROTOCOL), * e.g. IPPROTO_SCTP. Returns -1 on error. */ [[gnu::pure]] int GetProtocol() const noexcept; -#endif // !_WIN32 +#endif // __linux__ static constexpr SocketDescriptor Undefined() noexcept { #ifdef _WIN32