Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 731f4d7e authored by Christopher Ferris's avatar Christopher Ferris Committed by Automerger Merge Worker
Browse files

Merge "Fix mac build." am: 5445c730 am: 6cf64c12 am: 3e88d36f am: 8e6abebb am: a11655d1

Change-Id: I201ed6ef31a727069f02dd3f9f2dfc4caf599457
parents 88f2af55 a11655d1
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -19,12 +19,20 @@

#include <unistd.h>

#if !defined(__MINGW32__)
#include <sys/mman.h>
#endif

#if defined(__APPLE__)

/* Mac OS has always had a 64-bit off_t, so it doesn't have off64_t. */

static_assert(sizeof(off_t) >= 8, "This code requires that Mac OS have at least a 64-bit off_t.");
typedef off_t off64_t;

static inline void* mmap64(void* addr, size_t length, int prot, int flags, int fd, off64_t offset) {
    return mmap(addr, length, prot, flags, fd, offset);
}

static inline off64_t lseek64(int fd, off64_t offset, int whence) {
    return lseek(fd, offset, whence);
}