[Lldb-commits] [lldb] [lldb] Include api-level.h header for Android (PR #124383)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 27 06:59:11 PST 2025


================
@@ -29,6 +29,10 @@
 #include <sys/utsname.h>
 #include <unistd.h>
 
+#ifdef __ANDROID__
+#include <android/api-level.h>
----------------
labath wrote:

It sounds like it's mainly for "style", but given what you've said, maybe that shouldn't be the style we should use (is it possible those includes were necessary 10 years ago?) I think this code would look much nicer if we could assume that __ANDROID_API__ is always defined (at least that, like, we could assume that any header which includes the definition of a C function we're about to call, also includes the definition of that macro -- which I guess must be true as otherwise it wouldn't be able to annotate the declaration)

https://github.com/llvm/llvm-project/pull/124383


More information about the lldb-commits mailing list