diff options
author | 2011-02-16 10:13:53 -0800 | |
---|---|---|
committer | 2011-02-16 10:56:32 -0800 | |
commit | bb9d394b21bdfeb1ceb4cf6e4ed0306e39757b15 (patch) | |
tree | dbe7d5b2eef96e80ed4a3a1595e1a26cb19e228d | |
parent | 9497144281b92dd5293ea734d668217bcf4e86e9 (diff) |
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
-rw-r--r-- | libs/binder/MemoryHeapBase.cpp | 4 | ||||
-rw-r--r-- | libs/binder/MemoryHeapPmem.cpp | 12 | ||||
-rw-r--r-- | libs/utils/SystemClock.cpp | 8 | ||||
-rw-r--r-- | libs/utils/Threads.cpp | 2 | ||||
-rw-r--r-- | opengl/libs/EGL/egl.cpp | 2 | ||||
-rw-r--r-- | services/jni/com_android_server_AlarmManagerService.cpp | 12 | ||||
-rw-r--r-- | services/jni/com_android_server_BatteryService.cpp | 2 |
7 files changed, 21 insertions, 21 deletions
diff --git a/libs/binder/MemoryHeapBase.cpp b/libs/binder/MemoryHeapBase.cpp index 624f7eba8470..9f501e277cea 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, ®); diff --git a/libs/binder/MemoryHeapPmem.cpp b/libs/binder/MemoryHeapPmem.cpp index 16e92f939ee3..03322ea5d9c4 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); diff --git a/libs/utils/SystemClock.cpp b/libs/utils/SystemClock.cpp index 2bdc0ce278a4..062e6d76bfb8 100644 --- a/libs/utils/SystemClock.cpp +++ b/libs/utils/SystemClock.cpp @@ -19,7 +19,7 @@ * System clock functions. */ -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS #include <linux/ioctl.h> #include <linux/rtc.h> #include <utils/Atomic.h> @@ -50,7 +50,7 @@ int setCurrentTimeMillis(int64_t millis) return -1; #else struct timeval tv; -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS struct timespec ts; int fd; int res; @@ -66,7 +66,7 @@ int setCurrentTimeMillis(int64_t millis) LOGD("Setting time of day to sec=%d\n", (int) tv.tv_sec); -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS fd = open("/dev/alarm", O_RDWR); if(fd < 0) { LOGW("Unable to open alarm driver: %s\n", strerror(errno)); @@ -106,7 +106,7 @@ int64_t uptimeMillis() */ int64_t elapsedRealtime() { -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS static int s_fd = -1; if (s_fd == -1) { diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp index b1bd8284430f..35dcbcb64d53 100644 --- a/libs/utils/Threads.cpp +++ b/libs/utils/Threads.cpp @@ -739,7 +739,7 @@ int Thread::_threadLoop(void* user) wp<Thread> weak(strong); self->mHoldSelf.clear(); -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS // this is very useful for debugging with gdb self->mTid = gettid(); #endif diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index 3dc8c03fab32..3d5a4d16f6e1 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -22,7 +22,7 @@ #include <sys/ioctl.h> -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS #include <linux/android_pmem.h> #endif diff --git a/services/jni/com_android_server_AlarmManagerService.cpp b/services/jni/com_android_server_AlarmManagerService.cpp index 0e162bda1c12..aa8c9b32c5bc 100644 --- a/services/jni/com_android_server_AlarmManagerService.cpp +++ b/services/jni/com_android_server_AlarmManagerService.cpp @@ -33,7 +33,7 @@ #include <errno.h> #include <unistd.h> -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS #include <linux/ioctl.h> #include <linux/android_alarm.h> #endif @@ -42,7 +42,7 @@ namespace android { static jint android_server_AlarmManagerService_setKernelTimezone(JNIEnv* env, jobject obj, jint fd, jint minswest) { -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS struct timezone tz; tz.tz_minuteswest = minswest; @@ -64,7 +64,7 @@ static jint android_server_AlarmManagerService_setKernelTimezone(JNIEnv* env, jo static jint android_server_AlarmManagerService_init(JNIEnv* env, jobject obj) { -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS return open("/dev/alarm", O_RDWR); #else return -1; @@ -73,14 +73,14 @@ static jint android_server_AlarmManagerService_init(JNIEnv* env, jobject obj) static void android_server_AlarmManagerService_close(JNIEnv* env, jobject obj, jint fd) { -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS close(fd); #endif } static void android_server_AlarmManagerService_set(JNIEnv* env, jobject obj, jint fd, jint type, jlong seconds, jlong nanoseconds) { -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS struct timespec ts; ts.tv_sec = seconds; ts.tv_nsec = nanoseconds; @@ -95,7 +95,7 @@ static void android_server_AlarmManagerService_set(JNIEnv* env, jobject obj, jin static jint android_server_AlarmManagerService_waitForAlarm(JNIEnv* env, jobject obj, jint fd) { -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS int result = 0; do diff --git a/services/jni/com_android_server_BatteryService.cpp b/services/jni/com_android_server_BatteryService.cpp index d4513e934331..98d0d92b69e4 100644 --- a/services/jni/com_android_server_BatteryService.cpp +++ b/services/jni/com_android_server_BatteryService.cpp @@ -33,7 +33,7 @@ #include <unistd.h> #include <dirent.h> -#if HAVE_ANDROID_OS +#ifdef HAVE_ANDROID_OS #include <linux/ioctl.h> #endif |