Merge "Remove __ANDROID_USE_LIBLOG_* guards"

This commit is contained in:
Treehugger Robot 2019-01-16 18:28:21 +00:00 committed by Gerrit Code Review
commit e780431345
7 changed files with 3 additions and 149 deletions

View file

@ -152,35 +152,12 @@ typedef enum {
#ifdef __linux__
#ifndef __ANDROID_USE_LIBLOG_CLOCK_INTERFACE
#ifndef __ANDROID_API__
#define __ANDROID_USE_LIBLOG_CLOCK_INTERFACE 1
#elif __ANDROID_API__ > 22 /* > Lollipop */
#define __ANDROID_USE_LIBLOG_CLOCK_INTERFACE 1
#else
#define __ANDROID_USE_LIBLOG_CLOCK_INTERFACE 0
#endif
#endif
#if __ANDROID_USE_LIBLOG_CLOCK_INTERFACE
clockid_t android_log_clockid(void);
#endif
#endif /* __linux__ */
/* --------------------------------------------------------------------- */
#ifndef __ANDROID_USE_LIBLOG_CLOSE_INTERFACE
#ifndef __ANDROID_API__
#define __ANDROID_USE_LIBLOG_CLOSE_INTERFACE 1
#elif __ANDROID_API__ > 18 /* > JellyBean */
#define __ANDROID_USE_LIBLOG_CLOSE_INTERFACE 1
#else
#define __ANDROID_USE_LIBLOG_CLOSE_INTERFACE 0
#endif
#endif
#if __ANDROID_USE_LIBLOG_CLOSE_INTERFACE
/*
* Release any logger resources (a new log write will immediately re-acquire)
*
@ -188,19 +165,6 @@ clockid_t android_log_clockid(void);
* all O_CLOEXEC so wil self clean on exec().
*/
void __android_log_close(void);
#endif
#ifndef __ANDROID_USE_LIBLOG_RATELIMIT_INTERFACE
#ifndef __ANDROID_API__
#define __ANDROID_USE_LIBLOG_RATELIMIT_INTERFACE 1
#elif __ANDROID_API__ > 25 /* > OC */
#define __ANDROID_USE_LIBLOG_RATELIMIT_INTERFACE 1
#else
#define __ANDROID_USE_LIBLOG_RATELIMIT_INTERFACE 0
#endif
#endif
#if __ANDROID_USE_LIBLOG_RATELIMIT_INTERFACE
/*
* if last is NULL, caller _must_ provide a consistent value for seconds.
@ -229,14 +193,6 @@ int __android_log_ratelimit(time_t seconds, time_t* last);
#define IF_ALOG_RATELIMIT_LOCAL(seconds, state) \
if (__android_log_ratelimit(seconds, state) > 0)
#else
/* No ratelimiting as API unsupported */
#define IF_ALOG_RATELIMIT() if (1)
#define IF_ALOG_RATELIMIT_LOCAL(...) if (1)
#endif
#if defined(__clang__)
#pragma clang diagnostic pop
#endif

View file

@ -32,18 +32,6 @@ extern "C++" {
extern "C" {
#endif
#ifndef __ANDROID_USE_LIBLOG_EVENT_INTERFACE
#ifndef __ANDROID_API__
#define __ANDROID_USE_LIBLOG_EVENT_INTERFACE 1
#elif __ANDROID_API__ > 23 /* > Marshmallow */
#define __ANDROID_USE_LIBLOG_EVENT_INTERFACE 1
#else
#define __ANDROID_USE_LIBLOG_EVENT_INTERFACE 0
#endif
#endif
#if __ANDROID_USE_LIBLOG_EVENT_INTERFACE
/* For manipulating lists of events. */
#define ANDROID_MAX_LIST_NEST_DEPTH 8
@ -314,8 +302,6 @@ class android_log_event_list {
#endif
#endif
#endif /* __ANDROID_USE_LIBLOG_EVENT_INTERFACE */
#ifdef __cplusplus
}
#endif

View file

@ -18,9 +18,10 @@
#define _LIBS_LOG_LOG_MAIN_H
#include <stdbool.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <android/log.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
@ -349,20 +350,6 @@ extern int __fake_use_va_args(int, ...);
* over Android.
*/
#ifndef __ANDROID_USE_LIBLOG_LOGGABLE_INTERFACE
#ifndef __ANDROID_API__
#define __ANDROID_USE_LIBLOG_LOGGABLE_INTERFACE 2
#elif __ANDROID_API__ > 24 /* > Nougat */
#define __ANDROID_USE_LIBLOG_LOGGABLE_INTERFACE 2
#elif __ANDROID_API__ > 22 /* > Lollipop */
#define __ANDROID_USE_LIBLOG_LOGGABLE_INTERFACE 1
#else
#define __ANDROID_USE_LIBLOG_LOGGABLE_INTERFACE 0
#endif
#endif
#if __ANDROID_USE_LIBLOG_LOGGABLE_INTERFACE
/*
* Use the per-tag properties "log.tag.<tagname>" to generate a runtime
* result of non-zero to expose a log. prio is ANDROID_LOG_VERBOSE to
@ -370,12 +357,7 @@ extern int __fake_use_va_args(int, ...);
* any other value.
*/
int __android_log_is_loggable(int prio, const char* tag, int default_prio);
#if __ANDROID_USE_LIBLOG_LOGGABLE_INTERFACE > 1
#include <sys/types.h>
int __android_log_is_loggable_len(int prio, const char* tag, size_t len,
int default_prio);
int __android_log_is_loggable_len(int prio, const char* tag, size_t len, int default_prio);
#if LOG_NDEBUG /* Production */
#define android_testLog(prio, tag) \
@ -387,24 +369,6 @@ int __android_log_is_loggable_len(int prio, const char* tag, size_t len,
ANDROID_LOG_VERBOSE) != 0)
#endif
#else
#if LOG_NDEBUG /* Production */
#define android_testLog(prio, tag) \
(__android_log_is_loggable(prio, tag, ANDROID_LOG_DEBUG) != 0)
#else
#define android_testLog(prio, tag) \
(__android_log_is_loggable(prio, tag, ANDROID_LOG_VERBOSE) != 0)
#endif
#endif
#else /* __ANDROID_USE_LIBLOG_LOGGABLE_INTERFACE */
#define android_testLog(prio, tag) (1)
#endif /* !__ANDROID_USE_LIBLOG_LOGGABLE_INTERFACE */
#if defined(__clang__)
#pragma clang diagnostic pop
#endif

View file

@ -14,19 +14,7 @@
extern "C" {
#endif
#ifndef __ANDROID_USE_LIBLOG_IS_DEBUGGABLE_INTERFACE
#ifndef __ANDROID_API__
#define __ANDROID_USE_LIBLOG_IS_DEBUGGABLE_INTERFACE 1
#elif __ANDROID_API__ > 24 /* > Nougat */
#define __ANDROID_USE_LIBLOG_IS_DEBUGGABLE_INTERFACE 1
#else
#define __ANDROID_USE_LIBLOG_IS_DEBUGGABLE_INTERFACE 0
#endif
#endif
#if __ANDROID_USE_LIBLOG_IS_DEBUGGABLE_INTERFACE
int __android_log_is_debuggable();
#endif
#ifdef __cplusplus
}

View file

@ -194,22 +194,6 @@ struct log_msg {
};
#endif
#ifndef __ANDROID_USE_LIBLOG_READER_INTERFACE
#ifndef __ANDROID_API__
#define __ANDROID_USE_LIBLOG_READER_INTERFACE 3
#elif __ANDROID_API__ > 23 /* > Marshmallow */
#define __ANDROID_USE_LIBLOG_READER_INTERFACE 3
#elif __ANDROID_API__ > 22 /* > Lollipop */
#define __ANDROID_USE_LIBLOG_READER_INTERFACE 2
#elif __ANDROID_API__ > 19 /* > KitKat */
#define __ANDROID_USE_LIBLOG_READER_INTERFACE 1
#else
#define __ANDROID_USE_LIBLOG_READER_INTERFACE 0
#endif
#endif
#if __ANDROID_USE_LIBLOG_READER_INTERFACE
struct logger;
log_id_t android_logger_get_id(struct logger* logger);
@ -222,14 +206,12 @@ int android_logger_get_log_version(struct logger* logger);
struct logger_list;
#if __ANDROID_USE_LIBLOG_READER_INTERFACE > 1
ssize_t android_logger_get_statistics(struct logger_list* logger_list,
char* buf, size_t len);
ssize_t android_logger_get_prune_list(struct logger_list* logger_list,
char* buf, size_t len);
int android_logger_set_prune_list(struct logger_list* logger_list, char* buf,
size_t len);
#endif
#define ANDROID_LOG_RDONLY O_RDONLY
#define ANDROID_LOG_WRONLY O_WRONLY
@ -240,13 +222,9 @@ int android_logger_set_prune_list(struct logger_list* logger_list, char* buf,
#else
#define ANDROID_LOG_NONBLOCK O_NONBLOCK
#endif
#if __ANDROID_USE_LIBLOG_READER_INTERFACE > 2
#define ANDROID_LOG_WRAP 0x40000000 /* Block until buffer about to wrap */
#define ANDROID_LOG_WRAP_DEFAULT_TIMEOUT 7200 /* 2 hour default */
#endif
#if __ANDROID_USE_LIBLOG_READER_INTERFACE > 1
#define ANDROID_LOG_PSTORE 0x80000000
#endif
struct logger_list* android_logger_list_alloc(int mode, unsigned int tail,
pid_t pid);
@ -265,8 +243,6 @@ struct logger_list* android_logger_list_open(log_id_t id, int mode,
unsigned int tail, pid_t pid);
#define android_logger_list_close android_logger_list_free
#endif /* __ANDROID_USE_LIBLOG_READER_INTERFACE */
#ifdef __cplusplus
}
#endif

View file

@ -16,18 +16,6 @@
extern "C" {
#endif
#ifndef _ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE
#ifndef __ANDROID_API__
#define __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE 1
#elif __ANDROID_API__ > 22 /* > Lollipop */
#define __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE 1
#else
#define __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE 0
#endif
#endif
#if __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE
#define android_errorWriteLog(tag, subTag) \
__android_log_error_write(tag, subTag, -1, NULL, 0)
@ -37,8 +25,6 @@ extern "C" {
int __android_log_error_write(int tag, const char* subTag, int32_t uid,
const char* data, uint32_t dataLen);
#endif /* __ANDROID_USE_LIBLOG_SAFETYNET_INTERFACE */
#ifdef __cplusplus
}
#endif

View file

@ -27,8 +27,6 @@
extern "C" {
#endif
#define __ANDROID_USE_LIBLOG_EVENT_INTERFACE 1
/*
* The opaque context used to manipulate lists of events.
*/