diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bc6470..4083317 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,7 +122,7 @@ set(EHS_SOURCES src/io/socket/Request.cpp include/ehs/io/socket/Request.h src/io/socket/Response.cpp include/ehs/io/socket/Response.h - src/io/socket/DNS_LNX.cpp include/ehs/io/socket/DNS_LNX.h + src/io/socket/BaseDNS.cpp include/ehs/io/socket/BaseDNS.h src/io/socket/BaseUDP.cpp include/ehs/io/socket/BaseUDP.h src/io/socket/BaseTCP.cpp include/ehs/io/socket/BaseTCP.h src/io/socket/SSL.cpp include/ehs/io/socket/SSL.h @@ -133,6 +133,7 @@ set(EHS_SOURCES include/ehs/io/socket/Socket.h include/ehs/io/socket/TCP.h include/ehs/io/socket/UDP.h + include/ehs/io/socket/DNS.h src/io/audio/Audio.cpp include/ehs/io/audio/Audio.h src/io/audio/BaseAudioDevice.cpp include/ehs/io/audio/BaseAudioDevice.h @@ -176,9 +177,6 @@ set(EHS_SOURCES include/ehs/io/BaseDirectory.h src/io/BaseDirectory.cpp include/ehs/io/Directory.h - include/ehs/io/socket/BaseDNS.h - src/io/socket/BaseDNS.cpp - include/ehs/io/socket/DNS.h ) if (IS_OS_WINDOWS) diff --git a/src/io/socket/DNS_LNX.cpp b/src/io/socket/DNS_LNX.cpp index 1dcb6d0..4510e5f 100644 --- a/src/io/socket/DNS_LNX.cpp +++ b/src/io/socket/DNS_LNX.cpp @@ -1,14 +1,9 @@ #include "ehs/io/socket/DNS_LNX.h" #include "ehs/Log.h" -#if defined(EHS_OS_WINDOWS) - #include - #include -#elif defined(EHS_OS_LINUX) - #include - #include - #include -#endif +#include +#include +#include namespace ehs { diff --git a/src/io/socket/DNS_W32.cpp b/src/io/socket/DNS_W32.cpp index b0b5b1c..94eb132 100644 --- a/src/io/socket/DNS_W32.cpp +++ b/src/io/socket/DNS_W32.cpp @@ -1,4 +1,8 @@ #include "ehs/io/socket/DNS_W32.h" +#include "ehs/Log.h" + +#include +#include namespace ehs { diff --git a/src/io/socket/TCP_W32.cpp b/src/io/socket/TCP_W32.cpp index 71fadf8..fcd5143 100644 --- a/src/io/socket/TCP_W32.cpp +++ b/src/io/socket/TCP_W32.cpp @@ -372,7 +372,7 @@ namespace ehs } const int result = (int)value; - if (setsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, &result, sizeof(int)) == -1) + if (setsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, (const char *)&result, sizeof(int)) == -1) { EHS_LOG_INT(LogType::ERR, 2, "Failed to set IPv6 only mode with error #" + Str_8::FromNum(errno) + "."); return; @@ -395,7 +395,7 @@ namespace ehs int result; socklen_t len = sizeof(int); - if (getsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, &result, &len) == -1) + if (getsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&result, &len) == -1) { EHS_LOG_INT(LogType::ERR, 2, "Failed to set IPv6 only mode with error #" + Str_8::FromNum(errno) + "."); return false; diff --git a/src/io/socket/UDP_W32.cpp b/src/io/socket/UDP_W32.cpp index 863d9ff..3b42031 100644 --- a/src/io/socket/UDP_W32.cpp +++ b/src/io/socket/UDP_W32.cpp @@ -238,7 +238,7 @@ namespace ehs } const int result = (int)value; - if (setsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, &result, sizeof(int)) == -1) + if (setsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, (const char *)&result, sizeof(int)) == -1) { EHS_LOG_INT(LogType::ERR, 2, "Failed to set IPv6 only mode with error #" + Str_8::FromNum(errno) + "."); return; @@ -261,7 +261,7 @@ namespace ehs int result; socklen_t len = sizeof(int); - if (getsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, &result, &len) == -1) + if (getsockopt(hdl, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&result, &len) == -1) { EHS_LOG_INT(LogType::ERR, 2, "Failed to set IPv6 only mode with error #" + Str_8::FromNum(errno) + "."); return false;