Use #pragma one for all liblog includes

Test: build
Change-Id: I0ffe40853a89acffc1af4fd3838ef488706d23dc
This commit is contained in:
Tom Cherry 2019-01-15 17:47:48 -08:00
parent 3a4591c750
commit bab52203b7
22 changed files with 21 additions and 98 deletions

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBLOG_CONFIG_READ_H__
#define _LIBLOG_CONFIG_READ_H__
#pragma once
#include <cutils/list.h>
@ -51,5 +50,3 @@ LIBLOG_HIDDEN void __android_log_config_read();
LIBLOG_HIDDEN void __android_log_config_read_close();
__END_DECLS
#endif /* _LIBLOG_CONFIG_READ_H__ */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBLOG_CONFIG_WRITE_H__
#define _LIBLOG_CONFIG_WRITE_H__
#pragma once
#include <cutils/list.h>
@ -51,5 +50,3 @@ LIBLOG_HIDDEN void __android_log_config_write();
LIBLOG_HIDDEN void __android_log_config_write_close();
__END_DECLS
#endif /* _LIBLOG_CONFIG_WRITE_H__ */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBLOG_FAKE_LOG_DEVICE_H
#define _LIBLOG_FAKE_LOG_DEVICE_H
#pragma once
#include <sys/types.h>
@ -36,5 +35,3 @@ LIBLOG_ABI_PUBLIC int __android_log_is_loggable_len(int prio, const char*, size_
LIBLOG_ABI_PRIVATE int __android_log_is_debuggable();
__END_DECLS
#endif // _LIBLOG_FAKE_LOG_DEVICE_H

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBS_CUTILS_EVENTTAGMAP_H
#define _LIBS_CUTILS_EVENTTAGMAP_H
#pragma once
#ifdef __cplusplus
extern "C" {
@ -69,5 +68,3 @@ int android_lookupEventTagNum(EventTagMap* map, const char* tagname,
#ifdef __cplusplus
}
#endif
#endif /*_LIBS_CUTILS_EVENTTAGMAP_H*/

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBS_LOG_LOG_H
#define _LIBS_LOG_LOG_H
#pragma once
/* Too many in the ecosystem assume these are included */
#if !defined(_WIN32)
@ -200,5 +199,3 @@ int __android_log_ratelimit(time_t seconds, time_t* last);
#ifdef __cplusplus
}
#endif
#endif /* _LIBS_LOG_LOG_H */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBS_LOG_EVENT_LIST_H
#define _LIBS_LOG_EVENT_LIST_H
#pragma once
#include <errno.h>
#include <stdint.h>
@ -299,5 +298,3 @@ class android_log_event_list {
#ifdef __cplusplus
}
#endif
#endif /* _LIBS_LOG_EVENT_LIST_H */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBS_LOG_LOG_ID_H
#define _LIBS_LOG_LOG_ID_H
#pragma once
#ifdef __cplusplus
extern "C" {
@ -62,5 +61,3 @@ const char* android_log_id_to_name(log_id_t log_id);
#ifdef __cplusplus
}
#endif
#endif /* _LIBS_LOG_LOG_ID_H */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBS_LOG_LOG_MAIN_H
#define _LIBS_LOG_LOG_MAIN_H
#pragma once
#include <stdbool.h>
#include <sys/cdefs.h>
@ -374,5 +373,3 @@ int __android_log_is_loggable_len(int prio, const char* tag, size_t len, int def
#endif
__END_DECLS
#endif /* _LIBS_LOG_LOG_MAIN_H */

View file

@ -7,8 +7,7 @@
** General Public License.
*/
#ifndef _LIBS_LOG_PROPERTIES_H
#define _LIBS_LOG_PROPERTIES_H
#pragma once
#ifdef __cplusplus
extern "C" {
@ -19,5 +18,3 @@ int __android_log_is_debuggable();
#ifdef __cplusplus
}
#endif
#endif /* _LIBS_LOG_PROPERTIES_H */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBS_LOG_LOG_RADIO_H
#define _LIBS_LOG_LOG_RADIO_H
#pragma once
#include <android/log.h>
#include <log/log_id.h>
@ -140,5 +139,3 @@
LOG_TAG, __VA_ARGS__)) \
: (void)0)
#endif
#endif /* _LIBS_LOG_LOG_RADIO_H */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBS_LOG_LOG_READ_H
#define _LIBS_LOG_LOG_READ_H
#pragma once
#include <sys/types.h>
@ -246,5 +245,3 @@ struct logger_list* android_logger_list_open(log_id_t id, int mode,
#ifdef __cplusplus
}
#endif
#endif /* _LIBS_LOG_LOG_H */

View file

@ -7,8 +7,7 @@
** General Public License.
*/
#ifndef _LIBS_LOG_SAFETYNET_H
#define _LIBS_LOG_SAFETYNET_H
#pragma once
#include <stdint.h>
@ -28,5 +27,3 @@ int __android_log_error_write(int tag, const char* subTag, int32_t uid,
#ifdef __cplusplus
}
#endif
#endif /* _LIBS_LOG_SAFETYNET_H */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBS_LOG_LOG_SYSTEM_H
#define _LIBS_LOG_LOG_SYSTEM_H
#pragma once
#include <android/log.h>
#include <log/log_id.h>
@ -138,5 +137,3 @@
LOG_TAG, __VA_ARGS__)) \
: (void)0)
#endif
#endif /* _LIBS_LOG_LOG_SYSTEM_H */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBS_LOG_LOG_TIME_H
#define _LIBS_LOG_LOG_TIME_H
#pragma once
#include <stdint.h>
#include <time.h>
@ -56,10 +55,8 @@ struct log_time {
explicit log_time(uint32_t sec, uint32_t nsec = 0)
: tv_sec(sec), tv_nsec(nsec) {
}
#ifdef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
#define __struct_log_time_private_defined
static const timespec EPOCH;
#endif
log_time() {
}
#ifdef __linux__
@ -105,7 +102,6 @@ struct log_time {
return !(*this > T);
}
#ifdef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
log_time operator-=(const timespec& T);
log_time operator-(const timespec& T) const {
log_time local(*this);
@ -116,7 +112,6 @@ struct log_time {
log_time local(*this);
return local += T;
}
#endif
/* log_time */
bool operator==(const log_time& T) const {
@ -140,7 +135,6 @@ struct log_time {
return !(*this > T);
}
#ifdef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
log_time operator-=(const log_time& T);
log_time operator-(const log_time& T) const {
log_time local(*this);
@ -151,7 +145,6 @@ struct log_time {
log_time local(*this);
return local += T;
}
#endif
uint64_t nsec() const {
return static_cast<uint64_t>(tv_sec) * NS_PER_SEC + tv_nsec;
@ -165,12 +158,10 @@ struct log_time {
tv_nsec / (NS_PER_SEC / MS_PER_SEC);
}
#ifdef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
static const char default_format[];
/* Add %#q for the fraction of a second to the standard library functions */
char* strptime(const char* s, const char* format = default_format);
#endif
} __attribute__((__packed__));
}
@ -184,5 +175,3 @@ typedef struct log_time {
#endif /* __cplusplus */
#endif /* __struct_log_time_defined */
#endif /* _LIBS_LOG_LOG_TIME_H */

View file

@ -7,8 +7,7 @@
** General Public License.
*/
#ifndef _LIBS_LOG_TRANSPORT_H
#define _LIBS_LOG_TRANSPORT_H
#pragma once
#ifdef __cplusplus
extern "C" {
@ -33,5 +32,3 @@ int android_get_log_transport();
#ifdef __cplusplus
}
#endif
#endif /* _LIBS_LOG_TRANSPORT_H */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LOGPRINT_H
#define _LOGPRINT_H
#pragma once
#include <pthread.h>
@ -158,5 +157,3 @@ int android_log_printLogLine(AndroidLogFormat* p_format, int fd,
#ifdef __cplusplus
}
#endif
#endif /*_LOGPRINT_H*/

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBS_CUTILS_UIO_H
#define _LIBS_CUTILS_UIO_H
#pragma once
#if !defined(_WIN32)
@ -46,5 +45,3 @@ extern int writev(int fd, const struct iovec* vecs, int count);
#endif
#endif
#endif /* _LIBS_UTILS_UIO_H */

View file

@ -16,8 +16,7 @@
/* This file is used to define the internal protocol for the Android Logger */
#ifndef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
#define _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
#pragma once
/* Android private interfaces */
@ -185,5 +184,3 @@ class __android_log_event_list : public android_log_event_list {
#if defined(__cplusplus)
}
#endif
#endif /* _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_ */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBLOG_PORTABILITY_H__
#define _LIBLOG_PORTABILITY_H__
#pragma once
#include <sys/cdefs.h>
#include <unistd.h>
@ -75,5 +74,3 @@
_rc; \
})
#endif
#endif /* _LIBLOG_PORTABILITY_H__ */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBLOG_LOGD_READER_H__
#define _LIBLOG_LOGD_READER_H__
#pragma once
#include <unistd.h>
@ -26,5 +25,3 @@ __BEGIN_DECLS
LIBLOG_HIDDEN ssize_t __send_log_msg(char* buf, size_t buf_size);
__END_DECLS
#endif /* _LIBLOG_LOGD_READER_H__ */

View file

@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef _LIBLOG_LOGGER_H__
#define _LIBLOG_LOGGER_H__
#pragma once
#include <stdatomic.h>
#include <stdbool.h>
@ -164,5 +163,3 @@ LIBLOG_HIDDEN void __android_log_unlock();
extern LIBLOG_HIDDEN int __android_log_transport;
__END_DECLS
#endif /* _LIBLOG_LOGGER_H__ */

View file

@ -21,12 +21,6 @@
#include <log/log_time.h>
TEST(liblog, log_time) {
#ifdef _SYSTEM_CORE_INCLUDE_PRIVATE_ANDROID_LOGGER_H_
log_time(CLOCK_MONOTONIC);
EXPECT_EQ(log_time, log_time::EPOCH);
#endif
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
log_time tl(ts);