summaryrefslogtreecommitdiffstats
path: root/libs/binder
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2011-02-16 10:13:53 -0800
committerKenny Root <kroot@google.com>2011-02-16 10:56:32 -0800
commitbb9d394b21bdfeb1ceb4cf6e4ed0306e39757b15 (patch)
treedbe7d5b2eef96e80ed4a3a1595e1a26cb19e228d /libs/binder
parent9497144281b92dd5293ea734d668217bcf4e86e9 (diff)
downloadframeworks_base-bb9d394b21bdfeb1ceb4cf6e4ed0306e39757b15.zip
frameworks_base-bb9d394b21bdfeb1ceb4cf6e4ed0306e39757b15.tar.gz
frameworks_base-bb9d394b21bdfeb1ceb4cf6e4ed0306e39757b15.tar.bz2
Clean up use of HAVE_ANDROID_OS
HAVE_ANDROID_OS was defined as "1" for targets, but never defined as "0" for non-targets. Changing them to #ifdef should be safe and matches all the other uses of HAVE_ANDROID_OS throughout the system. Change-Id: I82257325a8ae5e4e4371ddfc4dbf51cea8ea0abb
Diffstat (limited to 'libs/binder')
-rw-r--r--libs/binder/MemoryHeapBase.cpp4
-rw-r--r--libs/binder/MemoryHeapPmem.cpp12
2 files changed, 8 insertions, 8 deletions
diff --git a/libs/binder/MemoryHeapBase.cpp b/libs/binder/MemoryHeapBase.cpp
index 624f7eb..9f501e2 100644
--- a/libs/binder/MemoryHeapBase.cpp
+++ b/libs/binder/MemoryHeapBase.cpp
@@ -31,7 +31,7 @@
#include <binder/MemoryHeapBase.h>
-#if HAVE_ANDROID_OS
+#ifdef HAVE_ANDROID_OS
#include <linux/android_pmem.h>
#endif
@@ -108,7 +108,7 @@ status_t MemoryHeapBase::mapfd(int fd, size_t size, uint32_t offset)
{
if (size == 0) {
// try to figure out the size automatically
-#if HAVE_ANDROID_OS
+#ifdef HAVE_ANDROID_OS
// first try the PMEM ioctl
pmem_region reg;
int err = ioctl(fd, PMEM_GET_TOTAL_SIZE, &reg);
diff --git a/libs/binder/MemoryHeapPmem.cpp b/libs/binder/MemoryHeapPmem.cpp
index 16e92f9..03322ea 100644
--- a/libs/binder/MemoryHeapPmem.cpp
+++ b/libs/binder/MemoryHeapPmem.cpp
@@ -30,7 +30,7 @@
#include <binder/MemoryHeapPmem.h>
#include <binder/MemoryHeapBase.h>
-#if HAVE_ANDROID_OS
+#ifdef HAVE_ANDROID_OS
#include <linux/android_pmem.h>
#endif
@@ -72,7 +72,7 @@ SubRegionMemory::SubRegionMemory(const sp<MemoryHeapPmem>& heap,
memset(start_ptr, 0xda, size);
#endif
-#if HAVE_ANDROID_OS
+#ifdef HAVE_ANDROID_OS
if (size > 0) {
const size_t pagesize = getpagesize();
size = (size + pagesize-1) & ~(pagesize-1);
@@ -107,7 +107,7 @@ void SubRegionMemory::revoke()
// which means MemoryHeapPmem::revoke() wouldn't have been able to
// promote() it.
-#if HAVE_ANDROID_OS
+#ifdef HAVE_ANDROID_OS
if (mSize != 0) {
const sp<MemoryHeapPmem>& heap(getHeap());
int our_fd = heap->heapID();
@@ -130,7 +130,7 @@ MemoryHeapPmem::MemoryHeapPmem(const sp<MemoryHeapBase>& pmemHeap,
: MemoryHeapBase()
{
char const * const device = pmemHeap->getDevice();
-#if HAVE_ANDROID_OS
+#ifdef HAVE_ANDROID_OS
if (device) {
int fd = open(device, O_RDWR | (flags & NO_CACHING ? O_SYNC : 0));
LOGE_IF(fd<0, "couldn't open %s (%s)", device, strerror(errno));
@@ -187,7 +187,7 @@ sp<MemoryHeapPmem::MemoryPmem> MemoryHeapPmem::createMemory(
status_t MemoryHeapPmem::slap()
{
-#if HAVE_ANDROID_OS
+#ifdef HAVE_ANDROID_OS
size_t size = getSize();
const size_t pagesize = getpagesize();
size = (size + pagesize-1) & ~(pagesize-1);
@@ -205,7 +205,7 @@ status_t MemoryHeapPmem::slap()
status_t MemoryHeapPmem::unslap()
{
-#if HAVE_ANDROID_OS
+#ifdef HAVE_ANDROID_OS
size_t size = getSize();
const size_t pagesize = getpagesize();
size = (size + pagesize-1) & ~(pagesize-1);