diff --git a/lldb/cmake/platforms/Android.cmake b/lldb/cmake/platforms/Android.cmake index 04c73af9fea2..b977b1ed364c 100644 --- a/lldb/cmake/platforms/Android.cmake +++ b/lldb/cmake/platforms/Android.cmake @@ -33,8 +33,7 @@ set( CMAKE_SYSTEM_NAME Linux ) include( CMakeForceCompiler ) # flags and definitions -remove_definitions( -DANDROID -D__ANDROID__ ) -add_definitions( -DANDROID -D__ANDROID_NDK__ -DLLDB_DISABLE_LIBEDIT ) +add_definitions( -DANDROID -DLLDB_DISABLE_LIBEDIT ) set( ANDROID True ) set( __ANDROID_NDK__ True ) set( LLDB_DEFAULT_DISABLE_LIBEDIT True ) diff --git a/lldb/include/lldb/Core/RegularExpression.h b/lldb/include/lldb/Core/RegularExpression.h index 5e36f5516ed4..fe34ef545dc4 100644 --- a/lldb/include/lldb/Core/RegularExpression.h +++ b/lldb/include/lldb/Core/RegularExpression.h @@ -31,7 +31,7 @@ inline int regexec(const llvm_regex_t *a, const char *b, size_t c, inline void regfree(llvm_regex_t *a) { llvm_regfree(a); } #else -#if __ANDROID_NDK__ +#ifdef __ANDROID__ #include #endif #include diff --git a/lldb/include/lldb/Host/Config.h b/lldb/include/lldb/Host/Config.h index e2e143900d4d..16845ae9327b 100644 --- a/lldb/include/lldb/Host/Config.h +++ b/lldb/include/lldb/Host/Config.h @@ -14,7 +14,7 @@ #include "lldb/Host/macosx/Config.h" -#elif defined(__ANDROID_NDK__) +#elif defined(__ANDROID__) #include "lldb/Host/android/Config.h" diff --git a/lldb/include/lldb/Host/Editline.h b/lldb/include/lldb/Host/Editline.h index 065a63a1ff0a..f92cbba7f2a0 100644 --- a/lldb/include/lldb/Host/Editline.h +++ b/lldb/include/lldb/Host/Editline.h @@ -55,11 +55,9 @@ #if defined(_WIN32) #include "lldb/Host/windows/editlinewin.h" -#else -#if !defined(__ANDROID_NDK__) +#elif !defined(__ANDROID__) #include #endif -#endif #include #include diff --git a/lldb/include/lldb/Host/Host.h b/lldb/include/lldb/Host/Host.h index 8af5f32d9e27..0666b67157ad 100644 --- a/lldb/include/lldb/Host/Host.h +++ b/lldb/include/lldb/Host/Host.h @@ -209,9 +209,9 @@ public: static bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info); -#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || \ - defined(__GLIBC__) || defined(__NetBSD__) -#if !defined(__ANDROID__) && !defined(__ANDROID_NDK__) +#if (defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || \ + defined(__GLIBC__) || defined(__NetBSD__)) && \ + !defined(__ANDROID__) static short GetPosixspawnFlags(const ProcessLaunchInfo &launch_info); @@ -223,9 +223,7 @@ public: const FileAction *info, Log *log, Error &error); -#endif // !defined(__ANDROID__) && !defined(__ANDROID_NDK__) -#endif // defined (__APPLE__) || defined (__linux__) || defined (__FreeBSD__) || - // defined (__GLIBC__) || defined(__NetBSD__) +#endif static const lldb::UnixSignalsSP &GetUnixSignals(); diff --git a/lldb/include/lldb/Host/HostInfo.h b/lldb/include/lldb/Host/HostInfo.h index 3973899e5a17..4646be2b9234 100644 --- a/lldb/include/lldb/Host/HostInfo.h +++ b/lldb/include/lldb/Host/HostInfo.h @@ -38,7 +38,7 @@ #include "lldb/Host/windows/HostInfoWindows.h" #define HOST_INFO_TYPE HostInfoWindows #elif defined(__linux__) -#if defined(__ANDROID_NDK__) +#if defined(__ANDROID__) #include "lldb/Host/android/HostInfoAndroid.h" #define HOST_INFO_TYPE HostInfoAndroid #else diff --git a/lldb/include/lldb/Host/Time.h b/lldb/include/lldb/Host/Time.h index 125b183566c5..3be30dd03375 100644 --- a/lldb/include/lldb/Host/Time.h +++ b/lldb/include/lldb/Host/Time.h @@ -12,7 +12,7 @@ #ifndef liblldb_Host_Time_h_ #define liblldb_Host_Time_h_ -#ifdef __ANDROID_NDK__ +#ifdef __ANDROID__ #include #endif diff --git a/lldb/include/lldb/Host/linux/Personality.h b/lldb/include/lldb/Host/linux/Personality.h index 48fc2e2bdd4c..cc35c4da59cf 100644 --- a/lldb/include/lldb/Host/linux/Personality.h +++ b/lldb/include/lldb/Host/linux/Personality.h @@ -12,7 +12,7 @@ #ifndef liblldb_Host_linux_Personality_h_ #define liblldb_Host_linux_Personality_h_ -#ifdef __ANDROID_NDK__ +#ifdef __ANDROID__ #include #endif diff --git a/lldb/include/lldb/Host/posix/Fcntl.h b/lldb/include/lldb/Host/posix/Fcntl.h index 3e3a472f0a20..833a90584141 100644 --- a/lldb/include/lldb/Host/posix/Fcntl.h +++ b/lldb/include/lldb/Host/posix/Fcntl.h @@ -12,7 +12,7 @@ #ifndef liblldb_Host_posix_Fcntl_h_ #define liblldb_Host_posix_Fcntl_h_ -#ifdef __ANDROID_NDK__ +#ifdef __ANDROID__ #include #endif diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index e31930fd96cb..f0d7e2e80e4c 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -29,7 +29,7 @@ #if defined(__linux__) || defined(__FreeBSD__) || \ defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__NetBSD__) -#if !defined(__ANDROID__) && !defined(__ANDROID_NDK__) +#if !defined(__ANDROID__) #include #endif #include @@ -320,7 +320,7 @@ lldb::tid_t Host::GetCurrentThreadID() { return thread_self; #elif defined(__FreeBSD__) return lldb::tid_t(pthread_getthreadid_np()); -#elif defined(__ANDROID_NDK__) +#elif defined(__ANDROID__) return lldb::tid_t(gettid()); #elif defined(__linux__) return lldb::tid_t(syscall(SYS_gettid)); @@ -454,7 +454,7 @@ bool Host::ResolveExecutableInBundle(FileSpec &file) { return false; } FileSpec Host::GetModuleFileSpecForHostAddress(const void *host_addr) { FileSpec module_filespec; -#if !defined(__ANDROID__) && !defined(__ANDROID_NDK__) +#if !defined(__ANDROID__) Dl_info info; if (::dladdr(host_addr, &info)) { if (info.dli_fname) @@ -622,7 +622,7 @@ Error Host::RunShellCommand(const Args &args, const FileSpec &working_dir, #if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || \ defined(__GLIBC__) || defined(__NetBSD__) -#if !defined(__ANDROID__) && !defined(__ANDROID_NDK__) +#if !defined(__ANDROID__) // this method needs to be visible to macosx/Host.cpp and // common/Host.cpp. @@ -956,7 +956,7 @@ bool Host::AddPosixSpawnFileAction(void *_file_actions, const FileAction *info, } return error.Success(); } -#endif // !defined(__ANDROID__) && !defined(__ANDROID_NDK__) +#endif // !defined(__ANDROID__) #endif // defined (__APPLE__) || defined (__linux__) || defined (__FreeBSD__) || // defined (__GLIBC__) || defined(__NetBSD__) diff --git a/lldb/source/Host/common/Socket.cpp b/lldb/source/Host/common/Socket.cpp index cbdb0779ba14..3e9490800cdd 100644 --- a/lldb/source/Host/common/Socket.cpp +++ b/lldb/source/Host/common/Socket.cpp @@ -33,7 +33,7 @@ #include "lldb/Host/linux/AbstractSocket.h" #endif -#ifdef __ANDROID_NDK__ +#ifdef __ANDROID__ #include #include #include @@ -44,7 +44,7 @@ #include #include #endif // ANDROID_ARM_BUILD_STATIC || ANDROID_MIPS_BUILD_STATIC -#endif // __ANDROID_NDK__ +#endif // __ANDROID__ using namespace lldb; using namespace lldb_private; diff --git a/lldb/source/Host/linux/ProcessLauncherLinux.cpp b/lldb/source/Host/linux/ProcessLauncherLinux.cpp index 4a51f8f4f53f..27a6329da067 100644 --- a/lldb/source/Host/linux/ProcessLauncherLinux.cpp +++ b/lldb/source/Host/linux/ProcessLauncherLinux.cpp @@ -26,7 +26,7 @@ using namespace lldb; using namespace lldb_private; static void FixupEnvironment(Args &env) { -#ifdef __ANDROID_NDK__ +#ifdef __ANDROID__ // If there is no PATH variable specified inside the environment then set the // path to /system/bin. It is required because the default path used by // execve() is wrong on android. diff --git a/lldb/source/Host/posix/HostInfoPosix.cpp b/lldb/source/Host/posix/HostInfoPosix.cpp index 689928cd38fc..38aac59ecc40 100644 --- a/lldb/source/Host/posix/HostInfoPosix.cpp +++ b/lldb/source/Host/posix/HostInfoPosix.cpp @@ -48,7 +48,7 @@ bool HostInfoPosix::GetHostname(std::string &s) { return false; } -#ifdef __ANDROID_NDK__ +#ifdef __ANDROID__ #include #endif #if defined(__ANDROID_API__) && __ANDROID_API__ < 21 diff --git a/lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp b/lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp index c25fc495d55e..346ea0bbd519 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp @@ -20,6 +20,7 @@ #include "lldb/DataFormatters/StringPrinter.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/Host/Endian.h" +#include "lldb/Host/Time.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" @@ -28,12 +29,6 @@ #include -#if __ANDROID_NDK__ -#include -#endif - -#include "lldb/Host/Time.h" - using namespace lldb; using namespace lldb_private; using namespace lldb_private::formatters; diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index 21f3c8c80114..5bca1de89fbd 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -9,7 +9,7 @@ #include "ObjectContainerBSDArchive.h" -#if defined(_WIN32) || defined(__ANDROID_NDK__) +#if defined(_WIN32) || defined(__ANDROID__) // Defines from ar, missing on Windows #define ARMAG "!\n" #define SARMAG 8 diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp index 03f7a6272f45..95b106d68bb3 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp @@ -120,7 +120,7 @@ bool RegisterContextMacOSXFrameBackchain::ReadRegister( // the same bytes size as "double" #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__) && \ !defined(_MSC_VER) && !defined(__mips__) && !defined(__powerpc__) && \ - !defined(__ANDROID_NDK__) + !defined(__ANDROID__) case sizeof(long double): if (sizeof(long double) == sizeof(uint32_t)) { value.SetUInt32(reg_value, RegisterValue::eTypeLongDouble); diff --git a/lldb/source/Utility/PseudoTerminal.cpp b/lldb/source/Utility/PseudoTerminal.cpp index 5c320c2d4b30..4d99a568b65e 100644 --- a/lldb/source/Utility/PseudoTerminal.cpp +++ b/lldb/source/Utility/PseudoTerminal.cpp @@ -20,7 +20,7 @@ #include "lldb/Host/PosixApi.h" -#if defined(__ANDROID_NDK__) +#if defined(__ANDROID__) int posix_openpt(int flags); #endif diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp index 325d441d573d..102a26ae7f65 100644 --- a/lldb/tools/driver/Driver.cpp +++ b/lldb/tools/driver/Driver.cpp @@ -19,8 +19,6 @@ #if defined(_WIN32) #include #include -#elif defined(__ANDROID_NDK__) -#include #else #include #endif