Binder: migrate off libbase macros
Test: mma
Bug: 302723053
Change-Id: Ie7c13c324311f600d72bc8ecc4157ad6c46259a0
diff --git a/libs/binder/Utils.h b/libs/binder/Utils.h
index 8942c31..68d6392 100644
--- a/libs/binder/Utils.h
+++ b/libs/binder/Utils.h
@@ -45,6 +45,17 @@
namespace android {
+/**
+ * Get the size of a statically initialized array.
+ *
+ * \param N the array to get the size of.
+ * \return the size of the array.
+ */
+template <typename T, size_t N>
+constexpr size_t countof(T (&)[N]) {
+ return N;
+}
+
// avoid optimizations
void zeroMemory(uint8_t* data, size_t size);