diff options
author | Elliott Hughes <enh@google.com> | 2018-02-13 14:26:29 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2018-02-13 14:27:17 -0800 |
commit | cbc80ba9d839675a0c4891e2ab33f39ba51b04b2 (patch) | |
tree | 0b24e6123c94bd3e61d94fd6eca6a3b9cc9b074e /libc | |
parent | 3374d0cabb973ff2b73ad8cd909389bdeed18658 (diff) | |
download | android_bionic-cbc80ba9d839675a0c4891e2ab33f39ba51b04b2.tar.gz android_bionic-cbc80ba9d839675a0c4891e2ab33f39ba51b04b2.tar.bz2 android_bionic-cbc80ba9d839675a0c4891e2ab33f39ba51b04b2.zip |
Switch the rest of our internal headers to #pragma once.
We've been using #pragma once for new internal files, but let's be more bold.
Bug: N/A
Test: builds
Change-Id: I7e2ee2730043bd884f9571cdbd8b524043030c07
Diffstat (limited to 'libc')
32 files changed, 36 insertions, 130 deletions
diff --git a/libc/async_safe/include/async_safe/log.h b/libc/async_safe/include/async_safe/log.h index 10833e488..415b48ed2 100644 --- a/libc/async_safe/include/async_safe/log.h +++ b/libc/async_safe/include/async_safe/log.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef _ASYNC_SAFE_LOG_LOG_H -#define _ASYNC_SAFE_LOG_LOG_H +#pragma once #include <sys/cdefs.h> #include <stdarg.h> @@ -104,5 +103,3 @@ int async_safe_write_log(int pri, const char* tag, const char* msg); } while(0) __END_DECLS - -#endif diff --git a/libc/bionic/bionic_netlink.h b/libc/bionic/bionic_netlink.h index bc0e3f007..a21200e64 100644 --- a/libc/bionic/bionic_netlink.h +++ b/libc/bionic/bionic_netlink.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef BIONIC_NETLINK_H -#define BIONIC_NETLINK_H +#pragma once #include <sys/types.h> @@ -49,5 +48,3 @@ class NetlinkConnection { char* data_; size_t size_; }; - -#endif diff --git a/libc/bionic/grp_pwd_file.h b/libc/bionic/grp_pwd_file.h index ae8cd982e..93dd85261 100644 --- a/libc/bionic/grp_pwd_file.h +++ b/libc/bionic/grp_pwd_file.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef GRP_PWD_FILE_H -#define GRP_PWD_FILE_H +#pragma once #include <grp.h> #include <pwd.h> @@ -93,5 +92,3 @@ class GroupFile { private: MmapFile mmap_file_; }; - -#endif diff --git a/libc/bionic/jemalloc.h b/libc/bionic/jemalloc.h index f7e877056..79a4f7237 100644 --- a/libc/bionic/jemalloc.h +++ b/libc/bionic/jemalloc.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef LIBC_BIONIC_JEMALLOC_H_ -#define LIBC_BIONIC_JEMALLOC_H_ +#pragma once #include <jemalloc/jemalloc.h> #include <malloc.h> // For struct mallinfo. @@ -35,5 +34,3 @@ void* je_memalign_round_up_boundary(size_t, size_t); void* je_pvalloc(size_t); __END_DECLS - -#endif // LIBC_BIONIC_DLMALLOC_H_ diff --git a/libc/bionic/libc_init_common.h b/libc/bionic/libc_init_common.h index 50666520e..6ce4d10ef 100644 --- a/libc/bionic/libc_init_common.h +++ b/libc/bionic/libc_init_common.h @@ -25,8 +25,8 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#ifndef LIBC_INIT_COMMON_H -#define LIBC_INIT_COMMON_H + +#pragma once #include <sys/cdefs.h> @@ -59,5 +59,3 @@ __LIBC_HIDDEN__ void __libc_init_common(KernelArgumentBlock& args); __LIBC_HIDDEN__ void __libc_init_AT_SECURE(KernelArgumentBlock& args); #endif - -#endif diff --git a/libc/bionic/malloc_info.h b/libc/bionic/malloc_info.h index 5fffae980..257fec105 100644 --- a/libc/bionic/malloc_info.h +++ b/libc/bionic/malloc_info.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef LIBC_BIONIC_MALLOC_INFO_H_ -#define LIBC_BIONIC_MALLOC_INFO_H_ +#pragma once #include <malloc.h> #include <sys/cdefs.h> @@ -28,5 +27,3 @@ __LIBC_HIDDEN__ struct mallinfo __mallinfo_arena_info(size_t); __LIBC_HIDDEN__ struct mallinfo __mallinfo_bin_info(size_t, size_t); __END_DECLS - -#endif // LIBC_BIONIC_MALLOC_INFO_H_ diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h index a4cba879b..18f5aee2c 100644 --- a/libc/bionic/pthread_internal.h +++ b/libc/bionic/pthread_internal.h @@ -25,8 +25,8 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#ifndef _PTHREAD_INTERNAL_H_ -#define _PTHREAD_INTERNAL_H_ + +#pragma once #include <pthread.h> #include <stdatomic.h> @@ -172,5 +172,3 @@ __LIBC_HIDDEN__ void pthread_key_clean_all(void); __LIBC_HIDDEN__ extern void __bionic_atfork_run_prepare(); __LIBC_HIDDEN__ extern void __bionic_atfork_run_child(); __LIBC_HIDDEN__ extern void __bionic_atfork_run_parent(); - -#endif /* _PTHREAD_INTERNAL_H_ */ diff --git a/libc/malloc_debug/BacktraceData.h b/libc/malloc_debug/BacktraceData.h index c8234dc3c..3c153484d 100644 --- a/libc/malloc_debug/BacktraceData.h +++ b/libc/malloc_debug/BacktraceData.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef DEBUG_MALLOC_BACKTRACEDATA_H -#define DEBUG_MALLOC_BACKTRACEDATA_H +#pragma once #include <stdint.h> @@ -67,5 +66,3 @@ class BacktraceData : public OptionData { DISALLOW_COPY_AND_ASSIGN(BacktraceData); }; - -#endif // DEBUG_MALLOC_BACKTRACEDATA_H diff --git a/libc/malloc_debug/Config.h b/libc/malloc_debug/Config.h index 349ad775d..a310e09e0 100644 --- a/libc/malloc_debug/Config.h +++ b/libc/malloc_debug/Config.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef MALLOC_DEBUG_CONFIG_H -#define MALLOC_DEBUG_CONFIG_H +#pragma once #include <stdint.h> @@ -159,5 +158,3 @@ class Config { uint8_t front_guard_value_; uint8_t rear_guard_value_; }; - -#endif // MALLOC_DEBUG_CONFIG_H diff --git a/libc/malloc_debug/DebugData.h b/libc/malloc_debug/DebugData.h index 7228a722e..9aece0b80 100644 --- a/libc/malloc_debug/DebugData.h +++ b/libc/malloc_debug/DebugData.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef DEBUG_MALLOC_DEBUGDATA_H -#define DEBUG_MALLOC_DEBUGDATA_H +#pragma once #include <stdint.h> @@ -106,5 +105,3 @@ class DebugData { }; extern DebugData* g_debug; - -#endif // MALLOC_DEBUG_DEBUGDATA_H diff --git a/libc/malloc_debug/FreeTrackData.h b/libc/malloc_debug/FreeTrackData.h index 0e8c17742..bd3497d5e 100644 --- a/libc/malloc_debug/FreeTrackData.h +++ b/libc/malloc_debug/FreeTrackData.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef DEBUG_MALLOC_FREETRACKDATA_H -#define DEBUG_MALLOC_FREETRACKDATA_H +#pragma once #include <stdint.h> #include <pthread.h> @@ -75,5 +74,3 @@ class FreeTrackData : public OptionData { DISALLOW_COPY_AND_ASSIGN(FreeTrackData); }; - -#endif // DEBUG_MALLOC_FREETRACKDATA_H diff --git a/libc/malloc_debug/GuardData.h b/libc/malloc_debug/GuardData.h index ddf6ce147..7b2167187 100644 --- a/libc/malloc_debug/GuardData.h +++ b/libc/malloc_debug/GuardData.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef DEBUG_MALLOC_GUARDDATA_H -#define DEBUG_MALLOC_GUARDDATA_H +#pragma once #include <stdint.h> #include <string.h> @@ -93,5 +92,3 @@ class RearGuardData : public GuardData { DISALLOW_COPY_AND_ASSIGN(RearGuardData); }; - -#endif // DEBUG_MALLOC_GUARDDATA_H diff --git a/libc/malloc_debug/MapData.h b/libc/malloc_debug/MapData.h index 895f78f85..a71f96d0d 100644 --- a/libc/malloc_debug/MapData.h +++ b/libc/malloc_debug/MapData.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef DEBUG_MALLOC_MAPDATA_H -#define DEBUG_MALLOC_MAPDATA_H +#pragma once #include <sys/cdefs.h> @@ -74,5 +73,3 @@ class MapData { DISALLOW_COPY_AND_ASSIGN(MapData); }; - -#endif // DEBUG_MALLOC_MAPDATA_H diff --git a/libc/malloc_debug/OptionData.h b/libc/malloc_debug/OptionData.h index 5c2d2728a..3fa8e145d 100644 --- a/libc/malloc_debug/OptionData.h +++ b/libc/malloc_debug/OptionData.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef DEBUG_MALLOC_OPTIONDATA_H -#define DEBUG_MALLOC_OPTIONDATA_H +#pragma once // Forward Declarations class DebugData; @@ -42,5 +41,3 @@ class OptionData { DISALLOW_COPY_AND_ASSIGN(OptionData); }; - -#endif // MALLOC_DEBUG_OPTIONDATA_H diff --git a/libc/malloc_debug/RecordData.h b/libc/malloc_debug/RecordData.h index 97ad81328..021a2993a 100644 --- a/libc/malloc_debug/RecordData.h +++ b/libc/malloc_debug/RecordData.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef DEBUG_MALLOC_RECORDDATA_H -#define DEBUG_MALLOC_RECORDDATA_H +#pragma once #include <stdint.h> #include <pthread.h> @@ -173,5 +172,3 @@ class RecordData { DISALLOW_COPY_AND_ASSIGN(RecordData); }; - -#endif // DEBUG_MALLOC_RECORDDATA_H diff --git a/libc/malloc_debug/TrackData.h b/libc/malloc_debug/TrackData.h index 9a649b9ff..7201c49ec 100644 --- a/libc/malloc_debug/TrackData.h +++ b/libc/malloc_debug/TrackData.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef DEBUG_MALLOC_TRACKDATA_H -#define DEBUG_MALLOC_TRACKDATA_H +#pragma once #include <stdint.h> #include <pthread.h> @@ -75,5 +74,3 @@ class TrackData : public OptionData { DISALLOW_COPY_AND_ASSIGN(TrackData); }; - -#endif // DEBUG_MALLOC_TRACKDATA_H diff --git a/libc/malloc_debug/backtrace.h b/libc/malloc_debug/backtrace.h index f5708737d..92ea23752 100644 --- a/libc/malloc_debug/backtrace.h +++ b/libc/malloc_debug/backtrace.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef MALLOC_DEBUG_BACKTRACE_H -#define MALLOC_DEBUG_BACKTRACE_H +#pragma once #include <stdint.h> #include <sys/cdefs.h> @@ -39,5 +38,3 @@ void backtrace_shutdown(); size_t backtrace_get(uintptr_t* frames, size_t frame_count); void backtrace_log(const uintptr_t* frames, size_t frame_count); std::string backtrace_string(const uintptr_t* frames, size_t frame_count); - -#endif // MALLOC_DEBUG_BACKTRACE_H diff --git a/libc/malloc_debug/debug_disable.h b/libc/malloc_debug/debug_disable.h index 9edb4df8e..0049595e2 100644 --- a/libc/malloc_debug/debug_disable.h +++ b/libc/malloc_debug/debug_disable.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef MALLOC_DEBUG_DISABLE_H -#define MALLOC_DEBUG_DISABLE_H +#pragma once #include <sys/cdefs.h> @@ -60,5 +59,3 @@ class ScopedDisableDebugCalls { DISALLOW_COPY_AND_ASSIGN(ScopedDisableDebugCalls); }; - -#endif // MALLOC_DEBUG_DISABLE_H diff --git a/libc/malloc_debug/debug_log.h b/libc/malloc_debug/debug_log.h index ed4b54169..54dd221ec 100644 --- a/libc/malloc_debug/debug_log.h +++ b/libc/malloc_debug/debug_log.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef MALLOC_DEBUG_LOG_H -#define MALLOC_DEBUG_LOG_H +#pragma once #include <async_safe/log.h> @@ -42,5 +41,3 @@ async_safe_write_log(ANDROID_LOG_ERROR, "malloc_debug", (str)) #define info_log(format, ...) \ async_safe_format_log(ANDROID_LOG_INFO, "malloc_debug", (format), ##__VA_ARGS__ ) - -#endif // MALLOC_DEBUG_LOG_H diff --git a/libc/malloc_debug/malloc_debug.h b/libc/malloc_debug/malloc_debug.h index 4a1e8dad1..18a6c2c7f 100644 --- a/libc/malloc_debug/malloc_debug.h +++ b/libc/malloc_debug/malloc_debug.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef MALLOC_DEBUG_H -#define MALLOC_DEBUG_H +#pragma once #include <stdint.h> @@ -70,5 +69,3 @@ constexpr char LOG_DIVIDER[] = "*** *** *** *** *** *** *** *** *** *** *** *** constexpr size_t FREE_TRACK_MEM_BUFFER_SIZE = 4096; extern const MallocDispatch* g_dispatch; - -#endif // MALLOC_DEBUG_H diff --git a/libc/seccomp/include/seccomp_policy.h b/libc/seccomp/include/seccomp_policy.h index add17b96c..49280f4cc 100644 --- a/libc/seccomp/include/seccomp_policy.h +++ b/libc/seccomp/include/seccomp_policy.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef SECCOMP_POLICY_H -#define SECCOMP_POLICY_H +#pragma once #include <stddef.h> #include <linux/filter.h> @@ -23,5 +22,3 @@ bool set_app_seccomp_filter(); bool set_system_seccomp_filter(); bool set_global_seccomp_filter(); - -#endif diff --git a/libc/seccomp/seccomp_bpfs.h b/libc/seccomp/seccomp_bpfs.h index 8728c3623..797dfc5e8 100644 --- a/libc/seccomp/seccomp_bpfs.h +++ b/libc/seccomp/seccomp_bpfs.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef SECCOMP_BPFS_H -#define SECCOMP_BPFS_H +#pragma once #include <stddef.h> #include <linux/seccomp.h> @@ -61,5 +60,3 @@ extern const struct sock_filter mips64_system_filter[]; extern const size_t mips64_system_filter_size; extern const struct sock_filter mips64_global_filter[]; extern const size_t mips64_global_filter_size; - -#endif diff --git a/libc/stdio/local.h b/libc/stdio/local.h index a31d7b940..11b136d71 100644 --- a/libc/stdio/local.h +++ b/libc/stdio/local.h @@ -32,8 +32,7 @@ * SUCH DAMAGE. */ -#ifndef __BIONIC_STDIO_LOCAL_H__ -#define __BIONIC_STDIO_LOCAL_H__ +#pragma once #include <pthread.h> #include <stdbool.h> @@ -278,5 +277,3 @@ char* __hldtoa(long double, const char*, int, int*, int*, char**); char* __ldtoa(long double*, int, int, int*, int*, char**); __END_DECLS - -#endif diff --git a/libc/stdio/wcio.h b/libc/stdio/wcio.h index 3c4f7a468..047eb775f 100644 --- a/libc/stdio/wcio.h +++ b/libc/stdio/wcio.h @@ -29,8 +29,7 @@ * $Citrus$ */ -#ifndef _WCIO_H_ -#define _WCIO_H_ +#pragma once #include <sys/cdefs.h> @@ -80,5 +79,3 @@ do {\ } while (0) __END_DECLS - -#endif /*_WCIO_H_*/ diff --git a/libc/system_properties/include/system_properties/context_node.h b/libc/system_properties/include/system_properties/context_node.h index 6a3bbcda4..35d0e92c2 100644 --- a/libc/system_properties/include/system_properties/context_node.h +++ b/libc/system_properties/include/system_properties/context_node.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef SYSTEM_PROPERTIES_CONTEXT_NODE_H -#define SYSTEM_PROPERTIES_CONTEXT_NODE_H +#pragma once #include "private/bionic_lock.h" @@ -66,5 +65,3 @@ class ContextNode { bool no_access_; const char* filename_; }; - -#endif diff --git a/libc/system_properties/include/system_properties/contexts.h b/libc/system_properties/include/system_properties/contexts.h index 8f154ed01..670f80828 100644 --- a/libc/system_properties/include/system_properties/contexts.h +++ b/libc/system_properties/include/system_properties/contexts.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef SYSTEM_PROPERTIES_CONTEXTS_H -#define SYSTEM_PROPERTIES_CONTEXTS_H +#pragma once #include "prop_area.h" #include "prop_info.h" @@ -44,5 +43,3 @@ class Contexts { virtual void ResetAccess() = 0; virtual void FreeAndUnmap() = 0; }; - -#endif diff --git a/libc/system_properties/include/system_properties/contexts_pre_split.h b/libc/system_properties/include/system_properties/contexts_pre_split.h index 14b00f16a..6e695e9a1 100644 --- a/libc/system_properties/include/system_properties/contexts_pre_split.h +++ b/libc/system_properties/include/system_properties/contexts_pre_split.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef SYSTEM_PROPERTIES_CONTEXTS_PRE_SPLIT_H -#define SYSTEM_PROPERTIES_CONTEXTS_PRE_SPLIT_H +#pragma once #include "contexts.h" #include "prop_area.h" @@ -68,5 +67,3 @@ class ContextsPreSplit : public Contexts { private: prop_area* pre_split_prop_area_ = nullptr; }; - -#endif diff --git a/libc/system_properties/include/system_properties/contexts_serialized.h b/libc/system_properties/include/system_properties/contexts_serialized.h index 010730a3f..93d6ac1bc 100644 --- a/libc/system_properties/include/system_properties/contexts_serialized.h +++ b/libc/system_properties/include/system_properties/contexts_serialized.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef SYSTEM_PROPERTIES_CONTEXTS_SERIALIZED_H -#define SYSTEM_PROPERTIES_CONTEXTS_SERIALIZED_H +#pragma once #include <property_info_parser/property_info_parser.h> @@ -60,5 +59,3 @@ class ContextsSerialized : public Contexts { size_t context_nodes_mmap_size_ = 0; prop_area* serial_prop_area_ = nullptr; }; - -#endif diff --git a/libc/system_properties/include/system_properties/contexts_split.h b/libc/system_properties/include/system_properties/contexts_split.h index 06c405a56..acb18e3de 100644 --- a/libc/system_properties/include/system_properties/contexts_split.h +++ b/libc/system_properties/include/system_properties/contexts_split.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef SYSTEM_PROPERTIES_CONTEXTS_SPLIT_H -#define SYSTEM_PROPERTIES_CONTEXTS_SPLIT_H +#pragma once #include "contexts.h" @@ -58,5 +57,3 @@ class ContextsSplit : public Contexts { prop_area* serial_prop_area_ = nullptr; const char* filename_ = nullptr; }; - -#endif diff --git a/libc/system_properties/include/system_properties/prop_area.h b/libc/system_properties/include/system_properties/prop_area.h index a7d5d221a..2c253370e 100644 --- a/libc/system_properties/include/system_properties/prop_area.h +++ b/libc/system_properties/include/system_properties/prop_area.h @@ -26,6 +26,8 @@ * SUCH DAMAGE. */ +#pragma once + #include <stdatomic.h> #include <stdint.h> #include <string.h> @@ -35,9 +37,6 @@ #include "prop_info.h" -#ifndef SYSTEM_PROPERTIES_PROP_AREA_H -#define SYSTEM_PROPERTIES_PROP_AREA_H - // Properties are stored in a hybrid trie/binary tree structure. // Each property's name is delimited at '.' characters, and the tokens are put // into a trie structure. Siblings at each level of the trie are stored in a @@ -161,5 +160,3 @@ class prop_area { DISALLOW_COPY_AND_ASSIGN(prop_area); }; - -#endif diff --git a/libc/system_properties/include/system_properties/prop_info.h b/libc/system_properties/include/system_properties/prop_info.h index 99bcaafbe..a127550c2 100644 --- a/libc/system_properties/include/system_properties/prop_info.h +++ b/libc/system_properties/include/system_properties/prop_info.h @@ -26,15 +26,14 @@ * SUCH DAMAGE. */ +#pragma once + #include <stdatomic.h> #include <stdint.h> #include <sys/system_properties.h> #include "private/bionic_macros.h" -#ifndef SYSTEM_PROPERTIES_PROP_INFO_H -#define SYSTEM_PROPERTIES_PROP_INFO_H - // The C11 standard doesn't allow atomic loads from const fields, // though C++11 does. Fudge it until standards get straightened out. static inline uint_least32_t load_const_atomic(const atomic_uint_least32_t* s, memory_order mo) { @@ -88,5 +87,3 @@ struct prop_info { }; static_assert(sizeof(prop_info) == 96, "sizeof struct prop_info must be 96 bytes"); - -#endif diff --git a/libc/system_properties/include/system_properties/system_properties.h b/libc/system_properties/include/system_properties/system_properties.h index 83ac00ce8..37fe6c0a2 100644 --- a/libc/system_properties/include/system_properties/system_properties.h +++ b/libc/system_properties/include/system_properties/system_properties.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef SYSTEM_PROPERTIES_SYSTEM_PROPERTIES_H -#define SYSTEM_PROPERTIES_SYSTEM_PROPERTIES_H +#pragma once #include <stdint.h> #include <sys/system_properties.h> @@ -92,5 +91,3 @@ class SystemProperties { bool initialized_; char property_filename_[PROP_FILENAME_MAX]; }; - -#endif |