diff --git a/httplib.h b/httplib.h index 9312227..225e73d 100644 --- a/httplib.h +++ b/httplib.h @@ -156,6 +156,9 @@ using socket_t = SOCKET; #include #include #include +#ifdef __linux__ +#include +#endif #include #ifdef CPPHTTPLIB_USE_POLL #include @@ -1821,6 +1824,9 @@ socket_t create_socket(const char *host, int port, int socket_flags, auto service = std::to_string(port); if (getaddrinfo(host, service.c_str(), &hints, &result)) { +#ifdef __linux__ + res_init(); +#endif return INVALID_SOCKET; }