From bb661c0f0cb72d4bbfc2e251f6ded6949a713292 Mon Sep 17 00:00:00 2001 From: Bilyan Borisov Date: Mon, 4 Apr 2016 16:27:32 +0100 Subject: Refactor use of __ANDROID__ macro We use the __ANDROID__ macro, which is provided by the toolchain, in numerous places. This patch refactors the usage of this by defining a new macro, ART_TARGET_ANDROID, that is being passed during build to ART_TARGET_CFLAGS in Android.common_build.mk on the same line as ART_TARGET. The codebase currently assumes that the existence of the __ANDROID__ macro implies that we are compiling art for an android target device. This is because, currently, target builds are compiled with target toolchains that provide the macro, while host toolchains do not. With this change this assumption is still preserved. However, in a future patch we will add the ability to compile art for a linux target, and in that case the ART_TARGET_ANDROID macro won't be passed anymore. Change-Id: I1f3a811aa735c87087d812da27fc6b08f01bad51 --- compiler/utils/assembler_thumb_test.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/utils/assembler_thumb_test.cc') diff --git a/compiler/utils/assembler_thumb_test.cc b/compiler/utils/assembler_thumb_test.cc index c67cb5a563..9c9271db33 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 __ANDROID__ +#ifndef ART_TARGET_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 __ANDROID__ +#ifndef ART_TARGET_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& code, const char* testname, const char* const* results) { -#ifndef __ANDROID__ +#ifndef ART_TARGET_ANDROID static std::string toolsdir = GetToolsDir(); ScratchFile file; @@ -169,7 +169,7 @@ void DumpAndCheck(std::vector& code, const char* testname, const char* snprintf(buf, sizeof(buf), "%s.oo", filename); unlink(buf); -#endif +#endif // ART_TARGET_ANDROID } #define __ assembler-> -- cgit v1.2.3-59-g8ed1b