Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5540e5d0 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk
Browse files

Fix Linux Binder warning on gcc

Bug: 285204695
Test: mma
Test: build with gcc in docker
Change-Id: I71d897143789d0b64002a26a0fc474f55494cc0d
parent edf5d0fd
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -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)