From d5beffc9abf2eab583a652b5a6df01230b92f7d0 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 15 Dec 2023 21:58:38 +0000 Subject: binder: consistent vendor #defines There is mixed use of __ANDROID_VNDK__ and __ANDROID_VENDOR__, so make sure they are set consistently. This is only possible because the VNDK is deprecated. Before this, __ANDROID_VNDK__ may be set without __ANDROID_VENDOR__ (and I think some of the logic in libbinder was probably wrong at that point). Bug: N/A Test: N/A Change-Id: I9cf106ab8309520229ae9e23e7d5c42ab3e425cf --- libs/binder/Stability.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libs/binder/Stability.cpp') diff --git a/libs/binder/Stability.cpp b/libs/binder/Stability.cpp index c432b3af29..665dfea456 100644 --- a/libs/binder/Stability.cpp +++ b/libs/binder/Stability.cpp @@ -73,6 +73,14 @@ void Stability::tryMarkCompilationUnit(IBinder* binder) { (void)setRepr(binder, getLocalLevel(), REPR_NONE); } +// after deprecation of the VNDK, these should be aliases. At some point +// all references to __ANDROID_VNDK__ should be replaced by __ANDROID_VENDOR__ +// but for right now, check that this condition holds because some +// places check __ANDROID_VNDK__ and some places check __ANDROID_VENDOR__ +#if defined(__ANDROID_VNDK__) != defined(__ANDROID_VENDOR__) +#error "__ANDROID_VNDK__ and __ANDROID_VENDOR__ should be aliases" +#endif + Stability::Level Stability::getLocalLevel() { #ifdef __ANDROID_APEX__ #error "APEX can't use libbinder (must use libbinder_ndk)" -- cgit v1.2.3-59-g8ed1b