diff options
author | Marco Nelissen <marcone@google.com> | 2009-07-07 09:29:00 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2009-07-07 09:29:00 -0700 |
commit | a4b587cb063dfd1b11f0006b0149e5e3045cc873 (patch) | |
tree | 95a0b62c5a154c1a1425f6695a0f35343f498b44 /modules/gralloc/gralloc.cpp | |
parent | cdb66fbc8a192e4b01b8b529c78773b2a3bf4573 (diff) | |
download | hardware_libhardware-a4b587cb063dfd1b11f0006b0149e5e3045cc873.zip hardware_libhardware-a4b587cb063dfd1b11f0006b0149e5e3045cc873.tar.gz hardware_libhardware-a4b587cb063dfd1b11f0006b0149e5e3045cc873.tar.bz2 |
Simulator build fixes for the new GL stuff. The simulator still doesn't run, but at least it builds.
Diffstat (limited to 'modules/gralloc/gralloc.cpp')
-rw-r--r-- | modules/gralloc/gralloc.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/gralloc/gralloc.cpp b/modules/gralloc/gralloc.cpp index a371f05..44e42d8 100644 --- a/modules/gralloc/gralloc.cpp +++ b/modules/gralloc/gralloc.cpp @@ -19,6 +19,8 @@ #include <fcntl.h> #include <errno.h> #include <pthread.h> +#include <stdlib.h> +#include <string.h> #include <sys/mman.h> #include <sys/stat.h> @@ -238,6 +240,10 @@ try_ashmem: err = -errno; } } else { +#ifndef HAVE_ANDROID_OS // should probably define HAVE_PMEM somewhere + LOGE("pmem not available on this target"); + err = -1; +#else private_module_t* m = reinterpret_cast<private_module_t*>( dev->common.module); @@ -284,6 +290,7 @@ try_ashmem: LOGE("couldn't open pmem (%s)", strerror(-errno)); } } +#endif // HAVE_ANDROID_OS } if (err == 0) { @@ -380,6 +387,10 @@ static int gralloc_free(alloc_device_t* dev, } else if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_PMEM) { +#ifndef HAVE_ANDROID_OS + LOGE("pmem not available on this target"); + return -EINVAL; +#else if (hnd->fd >= 0) { struct pmem_region sub = { hnd->offset, hnd->size }; int err = ioctl(hnd->fd, PMEM_UNMAP, &sub); @@ -393,6 +404,7 @@ static int gralloc_free(alloc_device_t* dev, sAllocator.deallocate(hnd->offset); } } +#endif // HAVE_ANDROID_OS } gralloc_module_t* m = reinterpret_cast<gralloc_module_t*>( |