Bring in google3-style DISALLOW_* macros.
I've been meaning to do this for a very long time...
Change-Id: Ia8c16eee7c026c3c9505399948485fb778fb0152
diff --git a/libc/bionic/pthread_accessor.h b/libc/bionic/pthread_accessor.h
index 2a320f6..ccb71bb 100644
--- a/libc/bionic/pthread_accessor.h
+++ b/libc/bionic/pthread_accessor.h
@@ -19,6 +19,7 @@
#include <pthread.h>
+#include "private/bionic_macros.h"
#include "pthread_internal.h"
class pthread_accessor {
@@ -57,9 +58,7 @@
is_locked_ = true;
}
- // Disallow copy and assignment.
- pthread_accessor(const pthread_accessor&);
- void operator=(const pthread_accessor&);
+ DISALLOW_COPY_AND_ASSIGN(pthread_accessor);
};
#endif // PTHREAD_ACCESSOR_H
diff --git a/libc/bionic/scandir.cpp b/libc/bionic/scandir.cpp
index 25d5200..9f731ab 100644
--- a/libc/bionic/scandir.cpp
+++ b/libc/bionic/scandir.cpp
@@ -19,6 +19,7 @@
#include <errno.h>
#include <stdlib.h>
+#include "private/bionic_macros.h"
#include "private/ScopedReaddir.h"
// A smart pointer to the scandir dirent**.
@@ -84,9 +85,7 @@
return copy;
}
- // Disallow copy and assignment.
- ScandirResult(const ScandirResult&);
- void operator=(const ScandirResult&);
+ DISALLOW_COPY_AND_ASSIGN(ScandirResult);
};
int scandir(const char* dirname, dirent*** name_list,
diff --git a/libc/bionic/system_properties.cpp b/libc/bionic/system_properties.cpp
index 4e4684a..ec3d04b 100644
--- a/libc/bionic/system_properties.cpp
+++ b/libc/bionic/system_properties.cpp
@@ -54,6 +54,7 @@
#include <sys/atomics.h>
#include "private/bionic_atomic_inline.h"
+#include "private/bionic_macros.h"
#define ALIGN(x, a) (((x) + (a - 1)) & ~(a - 1))
@@ -100,9 +101,7 @@
}
private:
- // Disallow copy and assign.
- prop_bt(const prop_bt&);
- prop_bt& operator=(const prop_bt&);
+ DISALLOW_COPY_AND_ASSIGN(prop_bt);
};
struct prop_area {
@@ -121,9 +120,7 @@
}
private:
- // Disallow copy and assign.
- prop_area(const prop_area&);
- prop_area& operator=(const prop_area&);
+ DISALLOW_COPY_AND_ASSIGN(prop_area);
};
struct prop_info {
@@ -141,9 +138,7 @@
ANDROID_MEMBAR_FULL();
}
private:
- // Disallow copy and assign.
- prop_info(const prop_info&);
- prop_info& operator=(const prop_info&);
+ DISALLOW_COPY_AND_ASSIGN(prop_info);
};
struct find_nth_cookie {