diff options
author | 2015-07-30 08:57:50 -0700 | |
---|---|---|
committer | 2015-07-30 08:57:50 -0700 | |
commit | c60e1b755c5632dfeb04c333489ede52ee5c945f (patch) | |
tree | 9582a0ffc99e4ad11dcd5d95dd97b09bc6acc5bf | |
parent | 7b926cdacc2b67241bc9cb5f2d4b04b13ca79d0e (diff) |
ART: Use __ANDROID__ instead of HAVE_ANDROID_OS
Use the proper define.
Change-Id: I71e291ac25f5d5f0187ac9b6ef2d6872f19e6085
26 files changed, 51 insertions, 51 deletions
diff --git a/compiler/dex/quick/quick_cfi_test.cc b/compiler/dex/quick/quick_cfi_test.cc index 8318b526b6..16c161e320 100644 --- a/compiler/dex/quick/quick_cfi_test.cc +++ b/compiler/dex/quick/quick_cfi_test.cc @@ -36,7 +36,7 @@ namespace art { // Run the tests only on host. -#ifndef HAVE_ANDROID_OS +#ifndef __ANDROID__ class QuickCFITest : public CFITest { public: @@ -136,6 +136,6 @@ TEST_ISA(kX86_64) TEST_ISA(kMips) TEST_ISA(kMips64) -#endif // HAVE_ANDROID_OS +#endif // __ANDROID__ } // namespace art diff --git a/compiler/dwarf/dwarf_test.cc b/compiler/dwarf/dwarf_test.cc index 4d423d007f..a07d27c1d2 100644 --- a/compiler/dwarf/dwarf_test.cc +++ b/compiler/dwarf/dwarf_test.cc @@ -27,7 +27,7 @@ namespace art { namespace dwarf { // Run the tests only on host since we need objdump. -#ifndef HAVE_ANDROID_OS +#ifndef __ANDROID__ constexpr CFIFormat kCFIFormat = DW_DEBUG_FRAME_FORMAT; @@ -336,7 +336,7 @@ TEST_F(DwarfTest, DebugInfo) { CheckObjdumpOutput(is64bit, "-W"); } -#endif // HAVE_ANDROID_OS +#endif // __ANDROID__ } // namespace dwarf } // namespace art diff --git a/compiler/jni/jni_cfi_test.cc b/compiler/jni/jni_cfi_test.cc index 016f28ef1e..0bfe8a276a 100644 --- a/compiler/jni/jni_cfi_test.cc +++ b/compiler/jni/jni_cfi_test.cc @@ -28,7 +28,7 @@ namespace art { // Run the tests only on host. -#ifndef HAVE_ANDROID_OS +#ifndef __ANDROID__ class JNICFITest : public CFITest { public: @@ -88,6 +88,6 @@ TEST_ISA(kX86_64) TEST_ISA(kMips) TEST_ISA(kMips64) -#endif // HAVE_ANDROID_OS +#endif // __ANDROID__ } // namespace art diff --git a/compiler/optimizing/optimizing_cfi_test.cc b/compiler/optimizing/optimizing_cfi_test.cc index fe3bb1a2b4..f455571636 100644 --- a/compiler/optimizing/optimizing_cfi_test.cc +++ b/compiler/optimizing/optimizing_cfi_test.cc @@ -29,7 +29,7 @@ namespace art { // Run the tests only on host. -#ifndef HAVE_ANDROID_OS +#ifndef __ANDROID__ class OptimizingCFITest : public CFITest { public: @@ -125,6 +125,6 @@ TEST_ISA(kArm64) TEST_ISA(kX86) TEST_ISA(kX86_64) -#endif // HAVE_ANDROID_OS +#endif // __ANDROID__ } // namespace art diff --git a/compiler/utils/assembler_thumb_test.cc b/compiler/utils/assembler_thumb_test.cc index 20f61f942b..cb01cea8ef 100644 --- a/compiler/utils/assembler_thumb_test.cc +++ b/compiler/utils/assembler_thumb_test.cc @@ -32,7 +32,7 @@ namespace arm { // Include results file (generated manually) #include "assembler_thumb_test_expected.cc.inc" -#ifndef HAVE_ANDROID_OS +#ifndef __ANDROID__ // This controls whether the results are printed to the // screen or compared against the expected output. // To generate new expected output, set this to true and @@ -72,7 +72,7 @@ void InitResults() { } std::string GetToolsDir() { -#ifndef HAVE_ANDROID_OS +#ifndef __ANDROID__ // This will only work on the host. There is no as, objcopy or objdump on the device. static std::string toolsdir; @@ -89,7 +89,7 @@ std::string GetToolsDir() { } void DumpAndCheck(std::vector<uint8_t>& code, const char* testname, const char* const* results) { -#ifndef HAVE_ANDROID_OS +#ifndef __ANDROID__ static std::string toolsdir = GetToolsDir(); ScratchFile file; diff --git a/compiler/utils/x86_64/assembler_x86_64_test.cc b/compiler/utils/x86_64/assembler_x86_64_test.cc index 422138ce8e..2c1a6a1f3c 100644 --- a/compiler/utils/x86_64/assembler_x86_64_test.cc +++ b/compiler/utils/x86_64/assembler_x86_64_test.cc @@ -35,7 +35,7 @@ TEST(AssemblerX86_64, CreateBuffer) { ASSERT_EQ(static_cast<size_t>(5), buffer.Size()); } -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ static constexpr size_t kRandomIterations = 1000; // Devices might be puny, don't stress them... #else static constexpr size_t kRandomIterations = 100000; // Hosts are pretty powerful. diff --git a/runtime/arch/arm/instruction_set_features_arm.cc b/runtime/arch/arm/instruction_set_features_arm.cc index f8590d3bd2..28d1942f0a 100644 --- a/runtime/arch/arm/instruction_set_features_arm.cc +++ b/runtime/arch/arm/instruction_set_features_arm.cc @@ -16,7 +16,7 @@ #include "instruction_set_features_arm.h" -#if defined(HAVE_ANDROID_OS) && defined(__arm__) +#if defined(__ANDROID__) && defined(__arm__) #include <sys/auxv.h> #include <asm/hwcap.h> #endif @@ -166,7 +166,7 @@ const ArmInstructionSetFeatures* ArmInstructionSetFeatures::FromHwcap() { bool has_div = false; bool has_lpae = false; -#if defined(HAVE_ANDROID_OS) && defined(__arm__) +#if defined(__ANDROID__) && defined(__arm__) uint64_t hwcaps = getauxval(AT_HWCAP); LOG(INFO) << "hwcaps=" << hwcaps; if ((hwcaps & HWCAP_IDIVT) != 0) { diff --git a/runtime/arch/instruction_set_features_test.cc b/runtime/arch/instruction_set_features_test.cc index e6f4e7ab01..99c2d4dc74 100644 --- a/runtime/arch/instruction_set_features_test.cc +++ b/runtime/arch/instruction_set_features_test.cc @@ -18,7 +18,7 @@ #include <gtest/gtest.h> -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ #include "cutils/properties.h" #endif @@ -26,7 +26,7 @@ namespace art { -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ #if defined(__aarch64__) TEST(InstructionSetFeaturesTest, DISABLED_FeaturesFromSystemPropertyVariant) { LOG(WARNING) << "Test disabled due to no CPP define for A53 erratum 835769"; @@ -111,7 +111,7 @@ TEST(InstructionSetFeaturesTest, FeaturesFromCpuInfo) { } #endif -#ifndef HAVE_ANDROID_OS +#ifndef __ANDROID__ TEST(InstructionSetFeaturesTest, HostFeaturesFromCppDefines) { std::string error_msg; std::unique_ptr<const InstructionSetFeatures> default_features( diff --git a/runtime/base/logging.cc b/runtime/base/logging.cc index 859de4bd5b..7a620e375b 100644 --- a/runtime/base/logging.cc +++ b/runtime/base/logging.cc @@ -26,7 +26,7 @@ #include "utils.h" // Headers for LogMessage::LogLine. -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ #include "cutils/log.h" #else #include <sys/types.h> @@ -47,7 +47,7 @@ static std::unique_ptr<std::string> gProgramInvocationShortName; // Print INTERNAL_FATAL messages directly instead of at destruction time. This only works on the // host right now: for the device, a stream buf collating output into lines and calling LogLine or // lower-level logging is necessary. -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ static constexpr bool kPrintInternalFatalDirectly = false; #else static constexpr bool kPrintInternalFatalDirectly = !kIsTargetBuild; @@ -234,7 +234,7 @@ std::ostream& LogMessage::stream() { return data_->GetBuffer(); } -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ static const android_LogPriority kLogSeverityToAndroidLogPriority[] = { ANDROID_LOG_VERBOSE, ANDROID_LOG_DEBUG, ANDROID_LOG_INFO, ANDROID_LOG_WARN, ANDROID_LOG_ERROR, ANDROID_LOG_FATAL, ANDROID_LOG_FATAL @@ -245,7 +245,7 @@ static_assert(arraysize(kLogSeverityToAndroidLogPriority) == INTERNAL_FATAL + 1, void LogMessage::LogLine(const char* file, unsigned int line, LogSeverity log_severity, const char* message) { -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ const char* tag = ProgramInvocationShortName(); int priority = kLogSeverityToAndroidLogPriority[log_severity]; if (priority == ANDROID_LOG_FATAL) { @@ -264,7 +264,7 @@ void LogMessage::LogLine(const char* file, unsigned int line, LogSeverity log_se void LogMessage::LogLineLowStack(const char* file, unsigned int line, LogSeverity log_severity, const char* message) { -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ // Use android_writeLog() to avoid stack-based buffers used by android_printLog(). const char* tag = ProgramInvocationShortName(); int priority = kLogSeverityToAndroidLogPriority[log_severity]; diff --git a/runtime/debugger.cc b/runtime/debugger.cc index f0de65b816..c9ae9b8b6e 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -4626,7 +4626,7 @@ void Dbg::DdmSendHeapSegments(bool native) { // Send a series of heap segment chunks. HeapChunkContext context(what == HPSG_WHAT_MERGED_OBJECTS, native); if (native) { -#if defined(HAVE_ANDROID_OS) && defined(USE_DLMALLOC) +#if defined(__ANDROID__) && defined(USE_DLMALLOC) dlmalloc_inspect_all(HeapChunkContext::HeapChunkNativeCallback, &context); HeapChunkContext::HeapChunkNativeCallback(nullptr, nullptr, 0, &context); // Indicate end of a space. #else diff --git a/runtime/gc/allocation_record.cc b/runtime/gc/allocation_record.cc index ec4d626e97..16c9354137 100644 --- a/runtime/gc/allocation_record.cc +++ b/runtime/gc/allocation_record.cc @@ -20,7 +20,7 @@ #include "base/stl_util.h" #include "stack.h" -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ #include "cutils/properties.h" #endif @@ -42,7 +42,7 @@ const char* AllocRecord::GetClassDescriptor(std::string* storage) const { } void AllocRecordObjectMap::SetProperties() { -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ // Check whether there's a system property overriding the max number of records. const char* propertyName = "dalvik.vm.allocTrackerMax"; char allocMaxString[PROPERTY_VALUE_MAX]; diff --git a/runtime/gc/allocator/dlmalloc.h b/runtime/gc/allocator/dlmalloc.h index 0e91a4372c..0558921a56 100644 --- a/runtime/gc/allocator/dlmalloc.h +++ b/runtime/gc/allocator/dlmalloc.h @@ -35,7 +35,7 @@ #include "../../bionic/libc/upstream-dlmalloc/malloc.h" #pragma GCC diagnostic pop -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ // Define dlmalloc routines from bionic that cannot be included directly because of redefining // symbols from the include above. extern "C" void dlmalloc_inspect_all(void(*handler)(void*, void *, size_t, void*), void* arg); diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc index abaa97f2db..470bc1cb22 100644 --- a/runtime/gc/allocator/rosalloc.cc +++ b/runtime/gc/allocator/rosalloc.cc @@ -1170,7 +1170,7 @@ size_t RosAlloc::BulkFree(Thread* self, void** ptrs, size_t num_ptrs) { // First mark slots to free in the bulk free bit map without locking the // size bracket locks. On host, unordered_set is faster than vector + flag. -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ std::vector<Run*> runs; #else std::unordered_set<Run*, hash_run, eq_run> runs; @@ -1237,7 +1237,7 @@ size_t RosAlloc::BulkFree(Thread* self, void** ptrs, size_t num_ptrs) { DCHECK_EQ(run->magic_num_, kMagicNum); // Set the bit in the bulk free bit map. freed_bytes += run->MarkBulkFreeBitMap(ptr); -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ if (!run->to_be_bulk_freed_) { run->to_be_bulk_freed_ = true; runs.push_back(run); @@ -1252,7 +1252,7 @@ size_t RosAlloc::BulkFree(Thread* self, void** ptrs, size_t num_ptrs) { // union the bulk free bit map into the thread-local free bit map // (for thread-local runs.) for (Run* run : runs) { -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ DCHECK(run->to_be_bulk_freed_); run->to_be_bulk_freed_ = false; #endif diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 07309d8eb7..5f617bd274 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -1277,7 +1277,7 @@ void Heap::TrimSpaces(Thread* self) { FinishGC(self, collector::kGcTypeNone); size_t native_reclaimed = 0; -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ // Only trim the native heap if we don't care about pauses. if (!CareAboutPauseTimes()) { #if defined(USE_DLMALLOC) @@ -1290,7 +1290,7 @@ void Heap::TrimSpaces(Thread* self) { UNIMPLEMENTED(WARNING) << "Add trimming support"; #endif } -#endif // HAVE_ANDROID_OS +#endif // __ANDROID__ uint64_t end_ns = NanoTime(); VLOG(heap) << "Heap trim of managed (duration=" << PrettyDuration(gc_heap_end_ns - start_ns) << ", advised=" << PrettySize(managed_reclaimed) << ") and native (duration=" diff --git a/runtime/jdwp/jdwp_adb.cc b/runtime/jdwp/jdwp_adb.cc index adc2912e58..51952c4923 100644 --- a/runtime/jdwp/jdwp_adb.cc +++ b/runtime/jdwp/jdwp_adb.cc @@ -24,7 +24,7 @@ #include "base/stringprintf.h" #include "jdwp/jdwp_priv.h" -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ #include "cutils/sockets.h" #endif @@ -224,7 +224,7 @@ bool JdwpAdbState::Accept() { */ int ret = connect(control_sock_, &control_addr_.controlAddrPlain, control_addr_len_); if (!ret) { -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ if (!socket_peer_is_trusted(control_sock_)) { if (shutdown(control_sock_, SHUT_RDWR)) { PLOG(ERROR) << "trouble shutting down socket"; diff --git a/runtime/jdwp/jdwp_main.cc b/runtime/jdwp/jdwp_main.cc index 260abe7d04..5a9a0f5006 100644 --- a/runtime/jdwp/jdwp_main.cc +++ b/runtime/jdwp/jdwp_main.cc @@ -248,7 +248,7 @@ JdwpState* JdwpState::Create(const JdwpOptions* options) { case kJdwpTransportSocket: InitSocketTransport(state.get(), options); break; -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ case kJdwpTransportAndroidAdb: InitAdbTransport(state.get(), options); break; diff --git a/runtime/mem_map.cc b/runtime/mem_map.cc index 8df8f96ea9..d9ad7dc0c2 100644 --- a/runtime/mem_map.cc +++ b/runtime/mem_map.cc @@ -280,7 +280,7 @@ MemMap* MemMap::MapAnonymous(const char* name, uint8_t* expected_ptr, size_t byt ScopedFd fd(-1); #ifdef USE_ASHMEM -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ const bool use_ashmem = true; #else // When not on Android ashmem is faked using files in /tmp. Ensure that such files won't diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc index 7abc546fa8..9ea339a6bd 100644 --- a/runtime/native/dalvik_system_VMRuntime.cc +++ b/runtime/native/dalvik_system_VMRuntime.cc @@ -16,7 +16,7 @@ #include "dalvik_system_VMRuntime.h" -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ extern "C" void android_set_application_target_sdk_version(uint32_t version); #endif #include <limits.h> @@ -196,7 +196,7 @@ static void VMRuntime_setTargetSdkVersionNative(JNIEnv*, jobject, jint target_sd // Note that targetSdkVersion may be 0, meaning "current". Runtime::Current()->SetTargetSdkVersion(target_sdk_version); -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ // This part is letting libc/dynamic linker know about current app's // target sdk version to enable compatibility workarounds. android_set_application_target_sdk_version(static_cast<uint32_t>(target_sdk_version)); diff --git a/runtime/native/java_lang_Runtime.cc b/runtime/native/java_lang_Runtime.cc index abac8153b3..856a3e7d01 100644 --- a/runtime/native/java_lang_Runtime.cc +++ b/runtime/native/java_lang_Runtime.cc @@ -31,10 +31,10 @@ #include "verify_object-inl.h" #include <sstream> -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ // This function is provided by android linker. extern "C" void android_update_LD_LIBRARY_PATH(const char* ld_library_path); -#endif // HAVE_ANDROID_OS +#endif // __ANDROID__ namespace art { @@ -53,7 +53,7 @@ NO_RETURN static void Runtime_nativeExit(JNIEnv*, jclass, jint status) { } static void SetLdLibraryPath(JNIEnv* env, jstring javaLdLibraryPathJstr) { -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ if (javaLdLibraryPathJstr != nullptr) { ScopedUtfChars ldLibraryPath(env, javaLdLibraryPathJstr); if (ldLibraryPath.c_str() != nullptr) { diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc index 098fe619aa..a23d94d845 100644 --- a/runtime/oat_file.cc +++ b/runtime/oat_file.cc @@ -27,7 +27,7 @@ #include <sstream> // dlopen_ext support from bionic. -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ #include "android/dlext.h" #endif @@ -229,7 +229,7 @@ bool OatFile::Dlopen(const std::string& elf_filename, uint8_t* requested_base, *error_msg = StringPrintf("Failed to find absolute path for '%s'", elf_filename.c_str()); return false; } -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ android_dlextinfo extinfo; extinfo.flags = ANDROID_DLEXT_FORCE_LOAD | ANDROID_DLEXT_FORCE_FIXED_VADDR; dlopen_handle_ = android_dlopen_ext(absolute_path.get(), RTLD_NOW, &extinfo); diff --git a/runtime/prebuilt_tools_test.cc b/runtime/prebuilt_tools_test.cc index 53bc87665a..a7f7bcd134 100644 --- a/runtime/prebuilt_tools_test.cc +++ b/runtime/prebuilt_tools_test.cc @@ -23,7 +23,7 @@ namespace art { // Run the tests only on host. -#ifndef HAVE_ANDROID_OS +#ifndef __ANDROID__ class PrebuiltToolsTest : public CommonRuntimeTest { }; @@ -61,6 +61,6 @@ TEST_F(PrebuiltToolsTest, CheckTargetTools) { } } -#endif // HAVE_ANDROID_OS +#endif // __ANDROID__ } // namespace art diff --git a/runtime/thread.cc b/runtime/thread.cc index 2b977af51c..b3efad0742 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -2139,7 +2139,7 @@ void Thread::DumpFromGdb() const { std::string str(ss.str()); // log to stderr for debugging command line processes std::cerr << str; -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ // log to logcat for debugging frameworks processes LOG(INFO) << str; #endif diff --git a/runtime/thread_linux.cc b/runtime/thread_linux.cc index 9d54eba347..9563b994f8 100644 --- a/runtime/thread_linux.cc +++ b/runtime/thread_linux.cc @@ -44,7 +44,7 @@ static constexpr int kHostAltSigStackSize = void Thread::SetUpAlternateSignalStack() { // Create and set an alternate signal stack. -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ LOG(FATAL) << "Invalid use of alternate signal stack on Android"; #endif stack_t ss; diff --git a/sigchainlib/sigchain.cc b/sigchainlib/sigchain.cc index 8e9d421b3d..c984b17c2c 100644 --- a/sigchainlib/sigchain.cc +++ b/sigchainlib/sigchain.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ #include <android/log.h> #else #include <stdarg.h> @@ -103,7 +103,7 @@ static void log(const char* format, ...) { va_list ap; va_start(ap, format); vsnprintf(buf, sizeof(buf), format, ap); -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ __android_log_write(ANDROID_LOG_ERROR, "libsigchain", buf); #else std::cout << buf << "\n"; diff --git a/sigchainlib/sigchain_dummy.cc b/sigchainlib/sigchain_dummy.cc index 8495a5417f..dfe0c6f981 100644 --- a/sigchainlib/sigchain_dummy.cc +++ b/sigchainlib/sigchain_dummy.cc @@ -17,7 +17,7 @@ #include <stdio.h> #include <stdlib.h> -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ #include <android/log.h> #else #include <stdarg.h> @@ -38,7 +38,7 @@ static void log(const char* format, ...) { va_list ap; va_start(ap, format); vsnprintf(buf, sizeof(buf), format, ap); -#ifdef HAVE_ANDROID_OS +#ifdef __ANDROID__ __android_log_write(ANDROID_LOG_ERROR, "libsigchain", buf); #else std::cout << buf << "\n"; diff --git a/test/051-thread/thread_test.cc b/test/051-thread/thread_test.cc index 2b8e675cc6..4215207c97 100644 --- a/test/051-thread/thread_test.cc +++ b/test/051-thread/thread_test.cc @@ -28,7 +28,7 @@ extern "C" JNIEXPORT jint JNICALL Java_Main_getNativePriority(JNIEnv* env, extern "C" JNIEXPORT jboolean JNICALL Java_Main_supportsThreadPriorities( JNIEnv* env ATTRIBUTE_UNUSED, jclass clazz ATTRIBUTE_UNUSED) { -#if defined(HAVE_ANDROID_OS) +#if defined(__ANDROID__) return JNI_TRUE; #else return JNI_FALSE; |