diff options
| author | Tom Cherry <tomcherry@google.com> | 2019-10-16 13:51:42 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-10-16 13:51:42 +0000 |
| commit | b29667f2f71b10c7105b0f676a531364cf8dd1fc (patch) | |
| tree | d4d2e14f25aa8a2ada22c57ecb904a97b04539ba | |
| parent | ff41946e5db6ac2fd93badfbab5be6d9e7982825 (diff) | |
| parent | 238f883d36bbfbcd3bf094051f09615fb19ffee3 (diff) | |
Merge "liblog: remove unneeded checks and includes from headers"
| -rw-r--r-- | liblog/include/log/event_tag_map.h | 2 | ||||
| -rw-r--r-- | liblog/include/log/log.h | 20 | ||||
| -rw-r--r-- | liblog/include/log/log_event_list.h | 9 | ||||
| -rw-r--r-- | liblog/include/log/log_read.h | 15 | ||||
| -rw-r--r-- | liblog/include/log/log_time.h | 5 | ||||
| -rw-r--r-- | liblog/include/log/logprint.h | 3 | ||||
| -rw-r--r-- | liblog/tests/liblog_benchmark.cpp | 1 |
7 files changed, 5 insertions, 50 deletions
diff --git a/liblog/include/log/event_tag_map.h b/liblog/include/log/event_tag_map.h index 2687b3aad2..f7ec208b33 100644 --- a/liblog/include/log/event_tag_map.h +++ b/liblog/include/log/event_tag_map.h @@ -16,6 +16,8 @@ #pragma once +#include <stddef.h> + #ifdef __cplusplus extern "C" { #endif diff --git a/liblog/include/log/log.h b/liblog/include/log/log.h index 5928649011..90d1e760e6 100644 --- a/liblog/include/log/log.h +++ b/liblog/include/log/log.h @@ -22,7 +22,6 @@ #endif #include <stdint.h> /* uint16_t, int32_t */ #include <stdio.h> -#include <sys/types.h> #include <time.h> #include <unistd.h> @@ -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 636d417e83..deadf2060e 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 fdef306d26..2079e7a82d 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 1b3333141e..6b4458cae7 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 8f4b1877ee..7dfd914e41 100644 --- a/liblog/include/log/logprint.h +++ b/liblog/include/log/logprint.h @@ -16,7 +16,8 @@ #pragma once -#include <pthread.h> +#include <stdint.h> +#include <sys/types.h> #include <android/log.h> #include <log/event_tag_map.h> diff --git a/liblog/tests/liblog_benchmark.cpp b/liblog/tests/liblog_benchmark.cpp index 4642b9bf41..56892a2b4f 100644 --- a/liblog/tests/liblog_benchmark.cpp +++ b/liblog/tests/liblog_benchmark.cpp @@ -17,6 +17,7 @@ #include <fcntl.h> #include <inttypes.h> #include <poll.h> +#include <sched.h> #include <sys/socket.h> #include <sys/syscall.h> #include <sys/types.h> |
