diff --git a/liblog/config_read.h b/liblog/config_read.h index 7b29fa4c2..00ea453e4 100644 --- a/liblog/config_read.h +++ b/liblog/config_read.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBLOG_CONFIG_READ_H__ -#define _LIBLOG_CONFIG_READ_H__ +#pragma once #include @@ -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__ */ diff --git a/liblog/config_write.h b/liblog/config_write.h index db1a08314..e3be4455f 100644 --- a/liblog/config_write.h +++ b/liblog/config_write.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBLOG_CONFIG_WRITE_H__ -#define _LIBLOG_CONFIG_WRITE_H__ +#pragma once #include @@ -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__ */ diff --git a/liblog/fake_log_device.h b/liblog/fake_log_device.h index d88eaeef8..74d434e60 100644 --- a/liblog/fake_log_device.h +++ b/liblog/fake_log_device.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBLOG_FAKE_LOG_DEVICE_H -#define _LIBLOG_FAKE_LOG_DEVICE_H +#pragma once #include @@ -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 diff --git a/liblog/include/log/event_tag_map.h b/liblog/include/log/event_tag_map.h index 8dd91572c..2687b3aad 100644 --- a/liblog/include/log/event_tag_map.h +++ b/liblog/include/log/event_tag_map.h @@ -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*/ diff --git a/liblog/include/log/log.h b/liblog/include/log/log.h index 544b3a640..df5affb4a 100644 --- a/liblog/include/log/log.h +++ b/liblog/include/log/log.h @@ -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 */ diff --git a/liblog/include/log/log_event_list.h b/liblog/include/log/log_event_list.h index 7819fb1b4..b37650424 100644 --- a/liblog/include/log/log_event_list.h +++ b/liblog/include/log/log_event_list.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBS_LOG_EVENT_LIST_H -#define _LIBS_LOG_EVENT_LIST_H +#pragma once #include #include @@ -299,5 +298,3 @@ class android_log_event_list { #ifdef __cplusplus } #endif - -#endif /* _LIBS_LOG_EVENT_LIST_H */ diff --git a/liblog/include/log/log_id.h b/liblog/include/log/log_id.h index c44f5a2eb..c052a503c 100644 --- a/liblog/include/log/log_id.h +++ b/liblog/include/log/log_id.h @@ -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 */ diff --git a/liblog/include/log/log_main.h b/liblog/include/log/log_main.h index a94a2836d..64791c2cc 100644 --- a/liblog/include/log/log_main.h +++ b/liblog/include/log/log_main.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBS_LOG_LOG_MAIN_H -#define _LIBS_LOG_LOG_MAIN_H +#pragma once #include #include @@ -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 */ diff --git a/liblog/include/log/log_properties.h b/liblog/include/log/log_properties.h index 94da242ef..3a8af6deb 100644 --- a/liblog/include/log/log_properties.h +++ b/liblog/include/log/log_properties.h @@ -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 */ diff --git a/liblog/include/log/log_radio.h b/liblog/include/log/log_radio.h index bd629fe35..8b8a3625f 100644 --- a/liblog/include/log/log_radio.h +++ b/liblog/include/log/log_radio.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBS_LOG_LOG_RADIO_H -#define _LIBS_LOG_LOG_RADIO_H +#pragma once #include #include @@ -140,5 +139,3 @@ LOG_TAG, __VA_ARGS__)) \ : (void)0) #endif - -#endif /* _LIBS_LOG_LOG_RADIO_H */ diff --git a/liblog/include/log/log_read.h b/liblog/include/log/log_read.h index d6de930d9..fdef306d2 100644 --- a/liblog/include/log/log_read.h +++ b/liblog/include/log/log_read.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBS_LOG_LOG_READ_H -#define _LIBS_LOG_LOG_READ_H +#pragma once #include @@ -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 */ diff --git a/liblog/include/log/log_safetynet.h b/liblog/include/log/log_safetynet.h index c8a5781cf..d3e9b1954 100644 --- a/liblog/include/log/log_safetynet.h +++ b/liblog/include/log/log_safetynet.h @@ -7,8 +7,7 @@ ** General Public License. */ -#ifndef _LIBS_LOG_SAFETYNET_H -#define _LIBS_LOG_SAFETYNET_H +#pragma once #include @@ -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 */ diff --git a/liblog/include/log/log_system.h b/liblog/include/log/log_system.h index 3b5ae2277..eaec741ea 100644 --- a/liblog/include/log/log_system.h +++ b/liblog/include/log/log_system.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBS_LOG_LOG_SYSTEM_H -#define _LIBS_LOG_LOG_SYSTEM_H +#pragma once #include #include @@ -138,5 +137,3 @@ LOG_TAG, __VA_ARGS__)) \ : (void)0) #endif - -#endif /* _LIBS_LOG_LOG_SYSTEM_H */ diff --git a/liblog/include/log/log_time.h b/liblog/include/log/log_time.h index 5830e6edb..be6925598 100644 --- a/liblog/include/log/log_time.h +++ b/liblog/include/log/log_time.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBS_LOG_LOG_TIME_H -#define _LIBS_LOG_LOG_TIME_H +#pragma once #include #include @@ -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(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 */ diff --git a/liblog/include/log/log_transport.h b/liblog/include/log/log_transport.h index 8b029957c..b48761af8 100644 --- a/liblog/include/log/log_transport.h +++ b/liblog/include/log/log_transport.h @@ -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 */ diff --git a/liblog/include/log/logprint.h b/liblog/include/log/logprint.h index ca58bc7e0..8f4b1877e 100644 --- a/liblog/include/log/logprint.h +++ b/liblog/include/log/logprint.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LOGPRINT_H -#define _LOGPRINT_H +#pragma once #include @@ -158,5 +157,3 @@ int android_log_printLogLine(AndroidLogFormat* p_format, int fd, #ifdef __cplusplus } #endif - -#endif /*_LOGPRINT_H*/ diff --git a/liblog/include/log/uio.h b/liblog/include/log/uio.h index a492baefe..7feb5527f 100644 --- a/liblog/include/log/uio.h +++ b/liblog/include/log/uio.h @@ -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 */ diff --git a/liblog/include/private/android_logger.h b/liblog/include/private/android_logger.h index 9da20a65b..830f6516b 100644 --- a/liblog/include/private/android_logger.h +++ b/liblog/include/private/android_logger.h @@ -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_ */ diff --git a/liblog/log_portability.h b/liblog/log_portability.h index 4a1f59c1b..b9fb1d248 100644 --- a/liblog/log_portability.h +++ b/liblog/log_portability.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBLOG_PORTABILITY_H__ -#define _LIBLOG_PORTABILITY_H__ +#pragma once #include #include @@ -75,5 +74,3 @@ _rc; \ }) #endif - -#endif /* _LIBLOG_PORTABILITY_H__ */ diff --git a/liblog/logd_reader.h b/liblog/logd_reader.h index 8ebb1aee1..0bba7cf56 100644 --- a/liblog/logd_reader.h +++ b/liblog/logd_reader.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBLOG_LOGD_READER_H__ -#define _LIBLOG_LOGD_READER_H__ +#pragma once #include @@ -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__ */ diff --git a/liblog/logger.h b/liblog/logger.h index 7bb9b20fb..25ee06547 100644 --- a/liblog/logger.h +++ b/liblog/logger.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBLOG_LOGGER_H__ -#define _LIBLOG_LOGGER_H__ +#pragma once #include #include @@ -164,5 +163,3 @@ LIBLOG_HIDDEN void __android_log_unlock(); extern LIBLOG_HIDDEN int __android_log_transport; __END_DECLS - -#endif /* _LIBLOG_LOGGER_H__ */ diff --git a/liblog/tests/log_time_test.cpp b/liblog/tests/log_time_test.cpp index 0ae1d1848..47fe594ab 100644 --- a/liblog/tests/log_time_test.cpp +++ b/liblog/tests/log_time_test.cpp @@ -21,12 +21,6 @@ #include 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);