Skip to content

Commit

Permalink
Some fixes for building on OpenBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
brad0 committed Jun 18, 2023
1 parent 49f3a41 commit 0f549e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/mega/posix/megafs.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define O_DIRECT 0
#include <sys/param.h>
#include <sys/mount.h>
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/mount.h>
#else
#include <sys/vfs.h>
Expand Down
2 changes: 1 addition & 1 deletion include/mega/posix/megasys.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
#include <arpa/inet.h>
#include <termios.h>

#if defined(__linux__)
#if defined(__linux__) || defined(__OpenBSD__)
#include <endian.h>
#endif

Expand Down
8 changes: 5 additions & 3 deletions src/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 0f549e8

Please sign in to comment.