diff --git a/include/mega/posix/megafs.h b/include/mega/posix/megafs.h index ac9d7e8a46..240aef6872 100644 --- a/include/mega/posix/megafs.h +++ b/include/mega/posix/megafs.h @@ -32,7 +32,7 @@ #define O_DIRECT 0 #include #include -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__OpenBSD__) #include #else #include diff --git a/include/mega/posix/megasys.h b/include/mega/posix/megasys.h index 27ef954558..97f8bbc1f7 100644 --- a/include/mega/posix/megasys.h +++ b/include/mega/posix/megasys.h @@ -95,7 +95,7 @@ #include #include -#if defined(__linux__) +#if defined(__linux__) || defined(__OpenBSD__) #include #endif diff --git a/src/http.cpp b/src/http.cpp index 8e035f0ba0..8f2c799f3a 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -268,9 +268,11 @@ void HttpIO::getMEGADNSservers(string *dnsservers, bool getfromnetwork) struct addrinfo hints = {}; hints.ai_family = AF_UNSPEC; - -#ifndef __MINGW32__ - hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG; +#ifdef AI_V4MAPPED + hints.ai_flags |= AI_V4MAPPED; +#endif +#ifdef AI_ADDRCONFIG + hints.ai_flags |= AI_ADDRCONFIG; #endif if (!getaddrinfo("ns.mega.co.nz", NULL, &hints, &aiList))