Merge "Fix mac build." am: 5445c73012

Change-Id: I3ba84fb777d5de85970708aa564569296f0ebe20
This commit is contained in:
Christopher Ferris 2020-05-09 05:04:14 +00:00 committed by Automerger Merge Worker
commit 6cf64c1218
1 changed files with 9 additions and 1 deletions

View File

@ -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);
}