diff --git a/cmake/Libraries.cmake b/cmake/Libraries.cmake index 0fa995afc..a92287573 100644 --- a/cmake/Libraries.cmake +++ b/cmake/Libraries.cmake @@ -121,31 +121,6 @@ macro(configure_unix_libs) message(FATAL_ERROR "Missing posix sigwait") endif() - check_function_exists(inet_aton HAVE_INET_ATON) - - # For some reason, the check_function_exists macro doesn't detect the - # inet_aton on some pure Unix platforms (e.g. sunos5). So we need to do a more - # detailed check and also include some extra libs. - if(NOT HAVE_INET_ATON) - set(CMAKE_REQUIRED_LIBRARIES nsl) - - check_c_source_compiles( - "#include \n int main() { inet_aton (0, 0); }" - HAVE_INET_ATON_ADV) - - set(CMAKE_REQUIRED_LIBRARIES) - - if(HAVE_INET_ATON_ADV) - # Override the previous fail. - set(HAVE_INET_ATON 1) - - # Assume that both nsl and socket will be needed, it seems safe to add - # socket on the back of nsl, since socket only ever needed when nsl is - # needed. - list(APPEND libs nsl socket) - endif() - endif() - # pthread is used on both Linux and Mac check_library_exists("pthread" pthread_create "" HAVE_PTHREAD) if(HAVE_PTHREAD) diff --git a/src/lib/Config.h.in b/src/lib/Config.h.in index 9a3036890..7197fe893 100644 --- a/src/lib/Config.h.in +++ b/src/lib/Config.h.in @@ -7,9 +7,6 @@ // clang-format off -/* Define if you have the `inet_aton` function. */ -#cmakedefine HAVE_INET_ATON @HAVE_INET_ATON@ - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_X11_EXTENSIONS_XRANDR_H @HAVE_X11_EXTENSIONS_XRANDR_H@ diff --git a/src/lib/arch/unix/ArchNetworkBSD.cpp b/src/lib/arch/unix/ArchNetworkBSD.cpp index c0833999f..c2ad0e129 100644 --- a/src/lib/arch/unix/ArchNetworkBSD.cpp +++ b/src/lib/arch/unix/ArchNetworkBSD.cpp @@ -25,10 +25,6 @@ #include #endif -#if !HAVE_INET_ATON -#include -#endif - static const int s_family[] = { PF_UNSPEC, PF_INET, @@ -37,27 +33,6 @@ static const int s_family[] = { static const int s_type[] = {SOCK_DGRAM, SOCK_STREAM}; -#if !HAVE_INET_ATON -// parse dotted quad addresses. we don't bother with the weird BSD'ism -// of handling octal and hex and partial forms. -static in_addr_t inet_aton(const char *cp, struct in_addr *inp) -{ - unsigned int a, b, c, d; - if (sscanf(cp, "%u.%u.%u.%u", &a, &b, &c, &d) != 4) { - return 0; - } - if (a >= 256 || b >= 256 || c >= 256 || d >= 256) { - return 0; - } - unsigned char *incp = (unsigned char *)inp; - incp[0] = (unsigned char)(a & 0xffu); - incp[1] = (unsigned char)(b & 0xffu); - incp[2] = (unsigned char)(c & 0xffu); - incp[3] = (unsigned char)(d & 0xffu); - return inp->s_addr; -} -#endif - // // ArchNetworkBSD::Deps //