Enable weak functions properly.
There is a check for WEAKS_AVAILABLE that is never set. Change this so
so it is available everywhere except apple/windows.
Add new test to verify that on Android the logStackInternal function is
defined.
Bug: 331489939
Test: All unit tests pass.
Change-Id: Ie982eba30ae421931a62718d39ff1f0c282453db
diff --git a/libutils/CallStack.cpp b/libutils/CallStack.cpp
index fe827eb..029f4a7 100644
--- a/libutils/CallStack.cpp
+++ b/libutils/CallStack.cpp
@@ -89,7 +89,8 @@
// The following four functions may be used via weak symbol references from libutils.
// Clients assume that if any of these symbols are available, then deleteStack() is.
-#ifdef WEAKS_AVAILABLE
+// Apple and Windows does not support this, so only compile on other platforms.
+#if !defined(__APPLE__) && !defined(_WIN32)
CallStack::CallStackUPtr CallStack::getCurrentInternal(int ignoreDepth) {
CallStack::CallStackUPtr stack(new CallStack());
@@ -110,6 +111,6 @@
delete stack;
}
-#endif // WEAKS_AVAILABLE
+#endif // !defined(__APPLE__) && !defined(_WIN32)
}; // namespace android