Clean up bionic_macros.h a bit.
Use <android-base/macros.h> instead where possible, and move the bionic
macros out of the way of the libbase ones. Yes, there are folks who manage
to end up with both included at once (thanks OpenGL!), and cleaning that
up doesn't seem nearly as practical as just making this change.
Bug: N/A
Test: builds
Change-Id: I23fc544f39d5addf81dc61471771a5438778895b
diff --git a/linker/Android.bp b/linker/Android.bp
index 697c260..779cd3f 100644
--- a/linker/Android.bp
+++ b/linker/Android.bp
@@ -15,7 +15,7 @@
// We need to access Bionic private headers in the linker.
include_dirs: ["bionic/libc"],
- static_libs: ["libasync_safe"],
+ static_libs: ["libasync_safe", "libbase"],
}
// This is used for bionic on (host) Linux to bootstrap our linker embedded into
diff --git a/linker/linked_list.h b/linker/linked_list.h
index 7f70a2c..5473ca0 100644
--- a/linker/linked_list.h
+++ b/linker/linked_list.h
@@ -28,7 +28,7 @@
#pragma once
-#include "private/bionic_macros.h"
+#include <android-base/macros.h>
template<typename T>
struct LinkedListEntry {
diff --git a/linker/linker_block_allocator.h b/linker/linker_block_allocator.h
index b501659..bd44fc8 100644
--- a/linker/linker_block_allocator.h
+++ b/linker/linker_block_allocator.h
@@ -30,7 +30,8 @@
#include <stdlib.h>
#include <limits.h>
-#include "private/bionic_macros.h"
+
+#include <android-base/macros.h>
struct LinkerBlockAllocatorPage;
diff --git a/linker/linker_common_types.h b/linker/linker_common_types.h
index ffa4066..ae78aa9 100644
--- a/linker/linker_common_types.h
+++ b/linker/linker_common_types.h
@@ -31,6 +31,8 @@
#include <android/dlext.h>
#include "linked_list.h"
+#include <android-base/macros.h>
+
// TODO(dimitry): move this to linker_defines.h? Unless it is removed by
// consequent refactoring steps.
diff --git a/linker/linker_config.h b/linker/linker_config.h
index e117aea..24c44f4 100644
--- a/linker/linker_config.h
+++ b/linker/linker_config.h
@@ -32,13 +32,14 @@
#include <stdlib.h>
#include <limits.h>
-#include "private/bionic_macros.h"
#include <memory>
#include <string>
#include <vector>
#include <unordered_map>
+#include <android-base/macros.h>
+
class NamespaceLinkConfig {
public:
NamespaceLinkConfig() = default;
diff --git a/linker/linker_logger.h b/linker/linker_logger.h
index 9ce438e..1828799 100644
--- a/linker/linker_logger.h
+++ b/linker/linker_logger.h
@@ -30,9 +30,11 @@
#include <stdlib.h>
#include <limits.h>
-#include "private/bionic_macros.h"
+
#include "private/bionic_systrace.h"
+#include <android-base/macros.h>
+
#define LD_LOG(type, x...) \
{ \
g_linker_logger.Log(type, x); \
diff --git a/linker/linker_mapped_file_fragment.h b/linker/linker_mapped_file_fragment.h
index f7872bd..91e094f 100644
--- a/linker/linker_mapped_file_fragment.h
+++ b/linker/linker_mapped_file_fragment.h
@@ -30,7 +30,7 @@
#include <unistd.h>
-#include "private/bionic_macros.h"
+#include <android-base/macros.h>
class MappedFileFragment {
public: