diff --git a/src/main/native/cpp/tcpsockets/SocketError.cpp b/src/main/native/cpp/tcpsockets/SocketError.cpp index a2628fdd2b..2db2a24c54 100644 --- a/src/main/native/cpp/tcpsockets/SocketError.cpp +++ b/src/main/native/cpp/tcpsockets/SocketError.cpp @@ -8,13 +8,23 @@ #include "tcpsockets/SocketError.h" #ifdef _WIN32 +#include #include #else +#include #include #endif namespace wpi { +int SocketErrno() { +#ifdef _WIN32 + return WSAGetLastError(); +#else + return errno; +#endif +} + std::string SocketStrerror(int code) { #ifdef _WIN32 LPSTR errstr = nullptr; diff --git a/src/main/native/include/tcpsockets/SocketError.h b/src/main/native/include/tcpsockets/SocketError.h index 3d87b2d5c9..0835797270 100644 --- a/src/main/native/include/tcpsockets/SocketError.h +++ b/src/main/native/include/tcpsockets/SocketError.h @@ -10,21 +10,9 @@ #include -#ifdef _WIN32 -#include -#else -#include -#endif - namespace wpi { -static inline int SocketErrno() { -#ifdef _WIN32 - return WSAGetLastError(); -#else - return errno; -#endif -} +int SocketErrno(); std::string SocketStrerror(int code); diff --git a/src/main/native/include/tcpsockets/TCPStream.h b/src/main/native/include/tcpsockets/TCPStream.h index 89e3779778..d58e6a979d 100644 --- a/src/main/native/include/tcpsockets/TCPStream.h +++ b/src/main/native/include/tcpsockets/TCPStream.h @@ -27,12 +27,6 @@ #include #include -#ifdef _WIN32 -#include -#else -#include -#endif - #include "tcpsockets/NetworkStream.h" struct sockaddr_in;