diff options
56 files changed, 63 insertions, 227 deletions
diff --git a/benchmarks/util.h b/benchmarks/util.h index 3225bc298..d9e10f40e 100644 --- a/benchmarks/util.h +++ b/benchmarks/util.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _BIONIC_BENCHMARKS_UTIL_H_ -#define _BIONIC_BENCHMARKS_UTIL_H_ +#pragma once #include <map> #include <mutex> @@ -62,5 +61,3 @@ wchar_t* GetAlignedPtr(std::vector<wchar_t>* buf, size_t alignment, size_t nbyte char* GetAlignedPtrFilled(std::vector<char>* buf, size_t alignment, size_t nbytes, char fill_byte); bool LockToCPU(long cpu_to_lock); - -#endif // _BIONIC_BENCHMARKS_UTIL_H 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 diff --git a/libm/fpmath.h b/libm/fpmath.h index 80420e5af..854ba11f1 100644 --- a/libm/fpmath.h +++ b/libm/fpmath.h @@ -33,8 +33,7 @@ // - android uses 128 bits long doubles for LP64, so the structure and macros // were reworked for the quad precision ieee representation. -#ifndef _FPMATH_ -#define _FPMATH_ +#pragma once #include <endian.h> @@ -92,5 +91,3 @@ union IEEEl2bits { } while(0) #endif // __LP64__ - -#endif // _FPMATH_ diff --git a/libm/freebsd-compat.h b/libm/freebsd-compat.h index ee41e455a..0bcc40d51 100644 --- a/libm/freebsd-compat.h +++ b/libm/freebsd-compat.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _BIONIC_LIBM_FREEBSD_COMPAT_H_included -#define _BIONIC_LIBM_FREEBSD_COMPAT_H_included +#pragma once #include <float.h> @@ -38,5 +37,3 @@ int digittoint(char ch); // Similarly rename _scan_nan. #define _scan_nan __libm_scan_nan - -#endif diff --git a/linker/linked_list.h b/linker/linked_list.h index ed2b1508c..048ea4d99 100644 --- a/linker/linked_list.h +++ b/linker/linked_list.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __LINKED_LIST_H -#define __LINKED_LIST_H +#pragma once #include "private/bionic_macros.h" @@ -259,5 +258,3 @@ class LinkedList { LinkedListEntry<T>* tail_; DISALLOW_COPY_AND_ASSIGN(LinkedList); }; - -#endif // __LINKED_LIST_H diff --git a/linker/linker.h b/linker/linker.h index 29d40faec..260c89d71 100644 --- a/linker/linker.h +++ b/linker/linker.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef _LINKER_H_ -#define _LINKER_H_ +#pragma once #include <dlfcn.h> #include <android/dlext.h> @@ -187,5 +186,3 @@ android_namespace_t* get_exported_namespace(const char* name); void increment_dso_handle_reference_counter(void* dso_handle); void decrement_dso_handle_reference_counter(void* dso_handle); - -#endif diff --git a/linker/linker_allocator.h b/linker/linker_allocator.h index 7fc6cbf38..82e4ef456 100644 --- a/linker/linker_allocator.h +++ b/linker/linker_allocator.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __LINKER_ALLOCATOR_H -#define __LINKER_ALLOCATOR_H +#pragma once #include <errno.h> #include <stdlib.h> @@ -152,6 +151,3 @@ class LinkerMemoryAllocator { LinkerSmallObjectAllocator* allocators_; uint8_t allocators_buf_[sizeof(LinkerSmallObjectAllocator)*kSmallObjectAllocatorsCount]; }; - - -#endif /* __LINKER_ALLOCATOR_H */ diff --git a/linker/linker_block_allocator.h b/linker/linker_block_allocator.h index eba1db205..b501659fe 100644 --- a/linker/linker_block_allocator.h +++ b/linker/linker_block_allocator.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __LINKER_BLOCK_ALLOCATOR_H -#define __LINKER_BLOCK_ALLOCATOR_H +#pragma once #include <stdlib.h> #include <limits.h> @@ -89,5 +88,3 @@ class LinkerTypeAllocator { LinkerBlockAllocator block_allocator_; DISALLOW_COPY_AND_ASSIGN(LinkerTypeAllocator); }; - -#endif // __LINKER_BLOCK_ALLOCATOR_H diff --git a/linker/linker_cfi.h b/linker/linker_cfi.h index e54554f77..f3300d609 100644 --- a/linker/linker_cfi.h +++ b/linker/linker_cfi.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef _LINKER_CFI_H_ -#define _LINKER_CFI_H_ +#pragma once #include "linker.h" #include "linker_debug.h" @@ -103,5 +102,3 @@ class CFIShadowWriter : private CFIShadow { }; CFIShadowWriter* get_cfi_shadow(); - -#endif // _LINKER_CFI_H_ diff --git a/linker/linker_common_types.h b/linker/linker_common_types.h index 6afd95087..ffa406689 100644 --- a/linker/linker_common_types.h +++ b/linker/linker_common_types.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __LINKER_COMMON_TYPES_H -#define __LINKER_COMMON_TYPES_H +#pragma once #include <android/dlext.h> #include "linked_list.h" @@ -65,5 +64,3 @@ class NamespaceListAllocator { typedef LinkedList<soinfo, SoinfoListAllocator> soinfo_list_t; typedef LinkedList<android_namespace_t, NamespaceListAllocator> android_namespace_list_t; - -#endif /* __LINKER_COMMON_TYPES_H */ diff --git a/linker/linker_config.h b/linker/linker_config.h index 0c50d57aa..e117aeaad 100644 --- a/linker/linker_config.h +++ b/linker/linker_config.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef _LINKER_CONFIG_H_ -#define _LINKER_CONFIG_H_ +#pragma once #include <android/api-level.h> @@ -171,5 +170,3 @@ class Config { DISALLOW_COPY_AND_ASSIGN(Config); }; - -#endif /* _LINKER_CONFIG_H_ */ diff --git a/linker/linker_debug.h b/linker/linker_debug.h index 7ceab0814..862ea122c 100644 --- a/linker/linker_debug.h +++ b/linker/linker_debug.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef _LINKER_DEBUG_H_ -#define _LINKER_DEBUG_H_ +#pragma once // You can increase the verbosity of debug traces by defining the LD_DEBUG // environment variable to a numeric value from 0 to 2 (corresponding to @@ -102,5 +101,3 @@ extern uint32_t bitmask[]; #define MARK(x) do {} while (0) #endif - -#endif /* _LINKER_DEBUG_H_ */ diff --git a/linker/linker_dlwarning.h b/linker/linker_dlwarning.h index 68827f7a5..af26824fe 100644 --- a/linker/linker_dlwarning.h +++ b/linker/linker_dlwarning.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __LINKER_DLWARNING_H -#define __LINKER_DLWARNING_H +#pragma once void add_dlwarning(const char* sopath, const char* message, const char* value = nullptr); @@ -36,5 +35,3 @@ void add_dlwarning(const char* sopath, const char* message, const char* value = // is used to avoid forcing user into saving the message // to a global variable. void get_dlwarning(void* user_data, void (*f)(void*, const char*)); - -#endif /* __LINKER_DLWARNING_H */ diff --git a/linker/linker_gdb_support.h b/linker/linker_gdb_support.h index 6709da1e1..4ae18ee36 100644 --- a/linker/linker_gdb_support.h +++ b/linker/linker_gdb_support.h @@ -25,8 +25,8 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#ifndef __LINKER_GDB_SUPPORT_H -#define __LINKER_GDB_SUPPORT_H + +#pragma once #include <link.h> #include <sys/cdefs.h> @@ -42,5 +42,3 @@ void notify_gdb_of_libraries(); extern struct r_debug _r_debug; __END_DECLS - -#endif diff --git a/linker/linker_globals.h b/linker/linker_globals.h index 11ccbd54a..b470918b0 100644 --- a/linker/linker_globals.h +++ b/linker/linker_globals.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __LINKER_GLOBALS_H -#define __LINKER_GLOBALS_H +#pragma once #include <link.h> #include <stddef.h> @@ -86,5 +85,3 @@ class DlErrorRestorer { private: std::string saved_error_msg_; }; - -#endif /* __LINKER_GLOBALS_H */ diff --git a/linker/linker_logger.h b/linker/linker_logger.h index 3e53f7404..9ce438eae 100644 --- a/linker/linker_logger.h +++ b/linker/linker_logger.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef _LINKER_LOGGER_H_ -#define _LINKER_LOGGER_H_ +#pragma once #include <stdlib.h> #include <limits.h> @@ -61,5 +60,3 @@ extern char** g_argv; // If the system property debug.ld.greylist_disabled is true, we'll not use the greylist // regardless of API level. extern bool g_greylist_disabled; - -#endif /* _LINKER_LOGGER_H_ */ diff --git a/linker/linker_main.h b/linker/linker_main.h index 5641696b1..8d486e846 100644 --- a/linker/linker_main.h +++ b/linker/linker_main.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __LINKER_MAIN_H -#define __LINKER_MAIN_H +#pragma once #include <android/dlext.h> @@ -71,5 +70,3 @@ void solist_add_soinfo(soinfo* si); bool solist_remove_soinfo(soinfo* si); soinfo* solist_get_head(); soinfo* solist_get_somain(); - -#endif diff --git a/linker/linker_mapped_file_fragment.h b/linker/linker_mapped_file_fragment.h index 0bfc7a3da..f7872bdb3 100644 --- a/linker/linker_mapped_file_fragment.h +++ b/linker/linker_mapped_file_fragment.h @@ -25,8 +25,8 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#ifndef LINKER_MAPPED_FILE_FRAGMENT_H -#define LINKER_MAPPED_FILE_FRAGMENT_H + +#pragma once #include <unistd.h> @@ -49,5 +49,3 @@ class MappedFileFragment { DISALLOW_COPY_AND_ASSIGN(MappedFileFragment); }; - -#endif /* LINKER_MAPPED_FILE_FRAGMENT_H */ diff --git a/linker/linker_namespaces.h b/linker/linker_namespaces.h index a7fe0d55d..03520d79d 100644 --- a/linker/linker_namespaces.h +++ b/linker/linker_namespaces.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __LINKER_NAMESPACES_H -#define __LINKER_NAMESPACES_H +#pragma once #include "linker_common_types.h" @@ -164,5 +163,3 @@ struct android_namespace_t { DISALLOW_COPY_AND_ASSIGN(android_namespace_t); }; - -#endif /* __LINKER_NAMESPACES_H */ diff --git a/linker/linker_phdr.h b/linker/linker_phdr.h index d6276ed3f..9b9ce94e6 100644 --- a/linker/linker_phdr.h +++ b/linker/linker_phdr.h @@ -25,8 +25,8 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#ifndef LINKER_PHDR_H -#define LINKER_PHDR_H + +#pragma once /* Declarations related to the ELF program header table and segments. * @@ -134,5 +134,3 @@ void phdr_table_get_dynamic_section(const ElfW(Phdr)* phdr_table, size_t phdr_co const char* phdr_table_get_interpreter_name(const ElfW(Phdr) * phdr_table, size_t phdr_count, ElfW(Addr) load_bias); - -#endif /* LINKER_PHDR_H */ diff --git a/linker/linker_reloc_iterators.h b/linker/linker_reloc_iterators.h index 634092438..b16268456 100644 --- a/linker/linker_reloc_iterators.h +++ b/linker/linker_reloc_iterators.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __LINKER_RELOC_ITERATORS_H -#define __LINKER_RELOC_ITERATORS_H +#pragma once #include "linker.h" @@ -173,5 +172,3 @@ class packed_reloc_iterator { size_t relocation_group_index_; rel_t reloc_; }; - -#endif // __LINKER_RELOC_ITERATORS_H diff --git a/linker/linker_relocs.h b/linker/linker_relocs.h index ed00594e2..4bab0e0a5 100644 --- a/linker/linker_relocs.h +++ b/linker/linker_relocs.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __LINKER_RELOCS_H -#define __LINKER_RELOCS_H +#pragma once #include <elf.h> @@ -62,5 +61,3 @@ #define R_GENERIC_IRELATIVE R_X86_64_IRELATIVE #endif - -#endif // __LINKER_RELOCS_H diff --git a/linker/linker_sleb128.h b/linker/linker_sleb128.h index 01e127d05..6bb31997d 100644 --- a/linker/linker_sleb128.h +++ b/linker/linker_sleb128.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef _LINKER_SLEB128_H -#define _LINKER_SLEB128_H +#pragma once #include <stdint.h> @@ -70,5 +69,3 @@ class sleb128_decoder { const uint8_t* current_; const uint8_t* const end_; }; - -#endif // __LINKER_SLEB128_H diff --git a/linker/linker_soinfo.h b/linker/linker_soinfo.h index 447c7c39c..6e1f005fd 100644 --- a/linker/linker_soinfo.h +++ b/linker/linker_soinfo.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __LINKER_SOINFO_H -#define __LINKER_SOINFO_H +#pragma once #include <link.h> @@ -386,5 +385,3 @@ void for_each_dt_needed(const soinfo* si, F action) { } } } - -#endif /* __LINKER_SOINFO_H */ diff --git a/linker/linker_utils.h b/linker/linker_utils.h index e104a2566..214646c3c 100644 --- a/linker/linker_utils.h +++ b/linker/linker_utils.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef __LINKER_UTILS_H -#define __LINKER_UTILS_H +#pragma once #include <string> #include <vector> @@ -56,5 +55,3 @@ std::string dirname(const char* path); off64_t page_start(off64_t offset); size_t page_offset(off64_t offset); bool safe_add(off64_t* out, off64_t a, size_t b); - -#endif |