diff --git a/liblog/include/log/event_tag_map.h b/liblog/include/log/event_tag_map.h index 2687b3aad..f7ec208b3 100644 --- a/liblog/include/log/event_tag_map.h +++ b/liblog/include/log/event_tag_map.h @@ -16,6 +16,8 @@ #pragma once +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/liblog/include/log/log.h b/liblog/include/log/log.h index 592864901..90d1e760e 100644 --- a/liblog/include/log/log.h +++ b/liblog/include/log/log.h @@ -22,7 +22,6 @@ #endif #include /* uint16_t, int32_t */ #include -#include #include #include @@ -65,21 +64,6 @@ extern "C" { #endif #endif -/* --------------------------------------------------------------------- */ - -/* - * This file uses ", ## __VA_ARGS__" zero-argument token pasting to - * work around issues with debug-only syntax errors in assertions - * that are missing format strings. See commit - * 19299904343daf191267564fe32e6cd5c165cd42 - */ -#if defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -#endif - -/* --------------------------------------------------------------------- */ - /* * Event logging. */ @@ -164,10 +148,6 @@ clockid_t android_log_clockid(void); */ void __android_log_close(void); -#if defined(__clang__) -#pragma clang diagnostic pop -#endif - #ifdef __cplusplus } #endif diff --git a/liblog/include/log/log_event_list.h b/liblog/include/log/log_event_list.h index 636d417e8..deadf2060 100644 --- a/liblog/include/log/log_event_list.h +++ b/liblog/include/log/log_event_list.h @@ -36,16 +36,11 @@ extern "C" { /* * The opaque context used to manipulate lists of events. */ -#ifndef __android_log_context_defined -#define __android_log_context_defined typedef struct android_log_context_internal* android_log_context; -#endif /* * Elements returned when reading a list of events. */ -#ifndef __android_log_list_element_defined -#define __android_log_list_element_defined typedef struct { AndroidEventLogType type; uint16_t complete; @@ -57,7 +52,6 @@ typedef struct { float float32; } data; } android_log_list_element; -#endif /* * Creates a context associated with an event tag to write elements to @@ -104,8 +98,6 @@ int android_log_parser_reset(android_log_context ctx, int android_log_destroy(android_log_context* ctx); #ifdef __cplusplus -#ifndef __class_android_log_event_list_defined -#define __class_android_log_event_list_defined /* android_log_list C++ helpers */ extern "C++" { class android_log_event_list { @@ -280,7 +272,6 @@ class android_log_event_list { }; } #endif -#endif #ifdef __cplusplus } diff --git a/liblog/include/log/log_read.h b/liblog/include/log/log_read.h index fdef306d2..2079e7a82 100644 --- a/liblog/include/log/log_read.h +++ b/liblog/include/log/log_read.h @@ -53,8 +53,6 @@ extern "C" { /* * The userspace structure for version 1 of the logger_entry ABI. */ -#ifndef __struct_logger_entry_defined -#define __struct_logger_entry_defined struct logger_entry { uint16_t len; /* length of the payload */ uint16_t __pad; /* no matter what, we get 2 bytes of padding */ @@ -64,13 +62,10 @@ struct logger_entry { int32_t nsec; /* nanoseconds */ char msg[0]; /* the entry's payload */ }; -#endif /* * The userspace structure for version 2 of the logger_entry ABI. */ -#ifndef __struct_logger_entry_v2_defined -#define __struct_logger_entry_v2_defined struct logger_entry_v2 { uint16_t len; /* length of the payload */ uint16_t hdr_size; /* sizeof(struct logger_entry_v2) */ @@ -81,13 +76,10 @@ struct logger_entry_v2 { uint32_t euid; /* effective UID of logger */ char msg[0]; /* the entry's payload */ } __attribute__((__packed__)); -#endif /* * The userspace structure for version 3 of the logger_entry ABI. */ -#ifndef __struct_logger_entry_v3_defined -#define __struct_logger_entry_v3_defined struct logger_entry_v3 { uint16_t len; /* length of the payload */ uint16_t hdr_size; /* sizeof(struct logger_entry_v3) */ @@ -98,13 +90,10 @@ struct logger_entry_v3 { uint32_t lid; /* log id of the payload */ char msg[0]; /* the entry's payload */ } __attribute__((__packed__)); -#endif /* * The userspace structure for version 4 of the logger_entry ABI. */ -#ifndef __struct_logger_entry_v4_defined -#define __struct_logger_entry_v4_defined struct logger_entry_v4 { uint16_t len; /* length of the payload */ uint16_t hdr_size; /* sizeof(struct logger_entry_v4) */ @@ -116,7 +105,6 @@ struct logger_entry_v4 { uint32_t uid; /* generating process's uid */ char msg[0]; /* the entry's payload */ }; -#endif #pragma clang diagnostic pop /* @@ -133,8 +121,6 @@ struct logger_entry_v4 { */ #define LOGGER_ENTRY_MAX_LEN (5 * 1024) -#ifndef __struct_log_msg_defined -#define __struct_log_msg_defined struct log_msg { union { unsigned char buf[LOGGER_ENTRY_MAX_LEN + 1]; @@ -191,7 +177,6 @@ struct log_msg { } #endif }; -#endif struct logger; diff --git a/liblog/include/log/log_time.h b/liblog/include/log/log_time.h index 1b3333141..6b4458cae 100644 --- a/liblog/include/log/log_time.h +++ b/liblog/include/log/log_time.h @@ -24,9 +24,6 @@ #define US_PER_SEC 1000000ULL #define MS_PER_SEC 1000ULL -#ifndef __struct_log_time_defined -#define __struct_log_time_defined - #define LOG_TIME_SEC(t) ((t)->tv_sec) /* next power of two after NS_PER_SEC */ #define LOG_TIME_NSEC(t) ((t)->tv_nsec & (UINT32_MAX >> 2)) @@ -164,5 +161,3 @@ typedef struct log_time { } __attribute__((__packed__)) log_time; #endif /* __cplusplus */ - -#endif /* __struct_log_time_defined */ diff --git a/liblog/include/log/logprint.h b/liblog/include/log/logprint.h index 8f4b1877e..7dfd914e4 100644 --- a/liblog/include/log/logprint.h +++ b/liblog/include/log/logprint.h @@ -16,7 +16,8 @@ #pragma once -#include +#include +#include #include #include diff --git a/liblog/tests/liblog_benchmark.cpp b/liblog/tests/liblog_benchmark.cpp index 4642b9bf4..56892a2b4 100644 --- a/liblog/tests/liblog_benchmark.cpp +++ b/liblog/tests/liblog_benchmark.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include