diff options
author | tgore <tim.gore@intel.com> | 2014-03-28 12:54:58 +0000 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-03-28 17:50:41 +0100 |
commit | a96c6340768772590cf548ed8b81a10877fc7b43 (patch) | |
tree | b971522f1a304bf592a4a749ee8d865c80320851 /lib | |
parent | 798fca377a0e26cffb40e5a97230baaac4b12733 (diff) |
intel-gpu-tools: fix problem with redefinition of mmap64
In android builds there is no reliable way to determine if mmap64 is defined
or not, and this sometimes leads to a compile error due to its re-defnition.
So this commit avoids its use altogether in intel-gpu-tools for Android builds,
unless the HAVE_MMAP64 macro is defined.
Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/drmtest.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/drmtest.h b/lib/drmtest.h index fdf98c62..f3afbaa8 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -40,7 +40,11 @@ #ifdef ANDROID #ifndef HAVE_MMAP64 extern void* __mmap2(void *, size_t, int, int, int, off_t); -static inline void *mmap64(void *addr, size_t length, int prot, int flags, + +/* mmap64 is a recent addition to bionic and not available in all android builds. */ +/* I can find no reliable way to know if it is defined or not - so just avoid it */ +#define mmap64 igt_mmap64 +static inline void *igt_mmap64(void *addr, size_t length, int prot, int flags, int fd, off64_t offset) { return __mmap2(addr, length, prot, flags, fd, offset >> 12); |