diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2023-12-12 23:28:58 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-12-12 23:28:58 +0000 |
commit | 5ce403e8dc87d24f81a109478c5563078ccd770d (patch) | |
tree | 2aed1e1e0d171c13a6de94f6cb168d7e8c9f3949 | |
parent | e6d4cbc4188e16adb9042ce0983990f0e32a3d9e (diff) | |
parent | c860791d944c88829ca86673fa71dc8ddab8b292 (diff) | |
download | native-5ce403e8dc87d24f81a109478c5563078ccd770d.tar.gz |
Merge "Fix Linux Binder warning on gcc" into main am: 55d44b74d4 am: 7073b23935 am: c860791d94
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2871055
Change-Id: I0ee2e54a73552e40e05b88eefab8772ca6af04d1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | libs/binder/liblog_stub/include/log/log.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libs/binder/liblog_stub/include/log/log.h b/libs/binder/liblog_stub/include/log/log.h index 3b656076b3..91c9632c1b 100644 --- a/libs/binder/liblog_stub/include/log/log.h +++ b/libs/binder/liblog_stub/include/log/log.h @@ -35,15 +35,19 @@ constexpr bool __android_log_stub_is_loggable(android_LogPriority priority) { return ANDROID_LOG_STUB_MIN_PRIORITY <= priority; } -int __android_log_print(int prio, const char* tag, const char* fmt, ...) - __attribute__((format(printf, 3, 4))) #ifdef ANDROID_LOG_STUB_WEAK_PRINT - __attribute__((weak)) +#define __ANDROID_LOG_STUB_IS_PRINT_PRESENT __android_log_print +#define __ANDROID_LOG_STUB_PRINT_ATTR __attribute__((weak)) +#else +#define __ANDROID_LOG_STUB_IS_PRINT_PRESENT true +#define __ANDROID_LOG_STUB_PRINT_ATTR #endif - ; + +int __android_log_print(int prio, const char* tag, const char* fmt, ...) + __attribute__((format(printf, 3, 4))) __ANDROID_LOG_STUB_PRINT_ATTR; #define IF_ALOG(priority, tag) \ - if (__android_log_stub_is_loggable(ANDROID_##priority) && __android_log_print) + if (__android_log_stub_is_loggable(ANDROID_##priority) && __ANDROID_LOG_STUB_IS_PRINT_PRESENT) #define IF_ALOGV() IF_ALOG(LOG_VERBOSE, LOG_TAG) #define IF_ALOGD() IF_ALOG(LOG_DEBUG, LOG_TAG) #define IF_ALOGI() IF_ALOG(LOG_INFO, LOG_TAG) |