From 2a7b86337f7b149887588e4df532272abe3e931c Mon Sep 17 00:00:00 2001
From: Christopher Wiley <wiley@google.com>
Date: Tue, 19 Apr 2016 14:09:41 -0700
Subject: [PATCH] Don't include android-base/macros.h from
 android-base/unique_fd.h

This prevents a ton of macro collisions when libfoo includes libbinder
includes unique_fd.h.

Bug: 27804373
Change-Id: Ide834afb1052b32e86fad3fcba10cff3dafeb899
---
 base/include/android-base/unique_fd.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/base/include/android-base/unique_fd.h b/base/include/android-base/unique_fd.h
index 8bc49ce2e1..ab41c55f07 100644
--- a/base/include/android-base/unique_fd.h
+++ b/base/include/android-base/unique_fd.h
@@ -19,7 +19,10 @@
 
 #include <unistd.h>
 
-#include <android-base/macros.h>
+// DO NOT INCLUDE OTHER LIBBASE HEADERS!
+// This file gets used in libbinder, and libbinder is used everywhere.
+// Including other headers from libbase frequently results in inclusion of
+// android-base/macros.h, which causes macro collisions.
 
 // Container for a file descriptor that automatically closes the descriptor as
 // it goes out of scope.
@@ -75,7 +78,8 @@ class unique_fd final {
  private:
   int value_;
 
-  DISALLOW_COPY_AND_ASSIGN(unique_fd);
+  unique_fd(const unique_fd&);
+  void operator=(const unique_fd&);
 };
 
 }  // namespace base
-- 
GitLab