summaryrefslogtreecommitdiffstats
path: root/base/include
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-06-26 17:17:41 -0700
committerElliott Hughes <enh@google.com>2018-06-26 17:17:41 -0700
commit4d8bbc6f8b5e18305b35147beea2d6c9c9d339b1 (patch)
tree48a5fd2469e87ee8cf69f9536d01030541d8f6c3 /base/include
parent2aa50ff56df2da8854c4209751a5d88c936f3c9b (diff)
downloadsystem_core-4d8bbc6f8b5e18305b35147beea2d6c9c9d339b1.tar.gz
system_core-4d8bbc6f8b5e18305b35147beea2d6c9c9d339b1.tar.bz2
system_core-4d8bbc6f8b5e18305b35147beea2d6c9c9d339b1.zip
libbase: switch to #pragma once.
Bug: N/A Test: builds Change-Id: I125498ac4257ac4e901c6f2a5f1bfac1432d859d
Diffstat (limited to 'base/include')
-rw-r--r--base/include/android-base/chrono_utils.h5
-rw-r--r--base/include/android-base/endian.h5
-rw-r--r--base/include/android-base/errors.h5
-rw-r--r--base/include/android-base/file.h5
-rw-r--r--base/include/android-base/logging.h5
-rw-r--r--base/include/android-base/macros.h5
-rw-r--r--base/include/android-base/memory.h5
-rw-r--r--base/include/android-base/parsedouble.h5
-rw-r--r--base/include/android-base/parseint.h5
-rw-r--r--base/include/android-base/parsenetaddress.h5
-rw-r--r--base/include/android-base/properties.h5
-rw-r--r--base/include/android-base/scopeguard.h5
-rw-r--r--base/include/android-base/stringprintf.h5
-rw-r--r--base/include/android-base/strings.h5
-rw-r--r--base/include/android-base/test_utils.h5
-rw-r--r--base/include/android-base/thread_annotations.h5
-rw-r--r--base/include/android-base/threads.h5
-rw-r--r--base/include/android-base/unique_fd.h5
-rwxr-xr-xbase/include/android-base/utf8.h5
19 files changed, 19 insertions, 76 deletions
diff --git a/base/include/android-base/chrono_utils.h b/base/include/android-base/chrono_utils.h
index b7647f22c..11fcf710e 100644
--- a/base/include/android-base/chrono_utils.h
+++ b/base/include/android-base/chrono_utils.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_CHRONO_UTILS_H
-#define ANDROID_BASE_CHRONO_UTILS_H
+#pragma once
#include <chrono>
#include <sstream>
@@ -52,5 +51,3 @@ std::ostream& operator<<(std::ostream& os, const Timer& t);
} // namespace base
} // namespace android
-
-#endif // ANDROID_BASE_CHRONO_UTILS_H
diff --git a/base/include/android-base/endian.h b/base/include/android-base/endian.h
index 6eb677cd3..cbbd8c9bc 100644
--- a/base/include/android-base/endian.h
+++ b/base/include/android-base/endian.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_ENDIAN_H
-#define ANDROID_BASE_ENDIAN_H
+#pragma once
/* A cross-platform equivalent of bionic's <sys/endian.h>. */
@@ -86,5 +85,3 @@
#define le64toh(x) (x)
#endif
-
-#endif // ANDROID_BASE_ENDIAN_H
diff --git a/base/include/android-base/errors.h b/base/include/android-base/errors.h
index 04c299c86..06f29fcac 100644
--- a/base/include/android-base/errors.h
+++ b/base/include/android-base/errors.h
@@ -27,8 +27,7 @@
// special handling to get the error string. Refer to Microsoft documentation
// to determine which error code to check for each function.
-#ifndef ANDROID_BASE_ERRORS_H
-#define ANDROID_BASE_ERRORS_H
+#pragma once
#include <string>
@@ -42,5 +41,3 @@ std::string SystemErrorCodeToString(int error_code);
} // namespace base
} // namespace android
-
-#endif // ANDROID_BASE_ERRORS_H
diff --git a/base/include/android-base/file.h b/base/include/android-base/file.h
index 667d6fbe2..908690ba6 100644
--- a/base/include/android-base/file.h
+++ b/base/include/android-base/file.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_FILE_H
-#define ANDROID_BASE_FILE_H
+#pragma once
#include <sys/stat.h>
#include <sys/types.h>
@@ -78,5 +77,3 @@ std::string Dirname(const std::string& path);
} // namespace base
} // namespace android
-
-#endif // ANDROID_BASE_FILE_H
diff --git a/base/include/android-base/logging.h b/base/include/android-base/logging.h
index 05a12e71a..7f0801f6c 100644
--- a/base/include/android-base/logging.h
+++ b/base/include/android-base/logging.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_LOGGING_H
-#define ANDROID_BASE_LOGGING_H
+#pragma once
//
// Google-style C++ logging.
@@ -506,5 +505,3 @@ inline std::ostream& operator<<(std::ostream& stream, const std::string* string_
#undef OSTREAM_STRING_POINTER_USAGE_WARNING
} // namespace std
-
-#endif // ANDROID_BASE_LOGGING_H
diff --git a/base/include/android-base/macros.h b/base/include/android-base/macros.h
index fd6efb2a8..0c8eac03c 100644
--- a/base/include/android-base/macros.h
+++ b/base/include/android-base/macros.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_MACROS_H
-#define ANDROID_BASE_MACROS_H
+#pragma once
#include <stddef.h> // for size_t
#include <unistd.h> // for TEMP_FAILURE_RETRY
@@ -197,5 +196,3 @@ void UNUSED(const T&...) {
#elif defined(__mips__) && defined(__LP64__)
#define ABI_STRING "mips64"
#endif
-
-#endif // ANDROID_BASE_MACROS_H
diff --git a/base/include/android-base/memory.h b/base/include/android-base/memory.h
index 997122623..0277a034e 100644
--- a/base/include/android-base/memory.h
+++ b/base/include/android-base/memory.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_MEMORY_H
-#define ANDROID_BASE_MEMORY_H
+#pragma once
namespace android {
namespace base {
@@ -37,5 +36,3 @@ static inline void put_unaligned(void* address, T v) {
} // namespace base
} // namespace android
-
-#endif // ANDROID_BASE_MEMORY_H
diff --git a/base/include/android-base/parsedouble.h b/base/include/android-base/parsedouble.h
index daa69024c..c273c61d3 100644
--- a/base/include/android-base/parsedouble.h
+++ b/base/include/android-base/parsedouble.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_PARSEDOUBLE_H
-#define ANDROID_BASE_PARSEDOUBLE_H
+#pragma once
#include <errno.h>
#include <stdlib.h>
@@ -46,5 +45,3 @@ static inline bool ParseDouble(const char* s, double* out,
} // namespace base
} // namespace android
-
-#endif // ANDROID_BASE_PARSEDOUBLE_H
diff --git a/base/include/android-base/parseint.h b/base/include/android-base/parseint.h
index 1b7cc5fa6..b0fc7c3f3 100644
--- a/base/include/android-base/parseint.h
+++ b/base/include/android-base/parseint.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_PARSEINT_H
-#define ANDROID_BASE_PARSEINT_H
+#pragma once
#include <errno.h>
#include <stdlib.h>
@@ -104,5 +103,3 @@ bool ParseInt(const std::string& s, T* out,
} // namespace base
} // namespace android
-
-#endif // ANDROID_BASE_PARSEINT_H
diff --git a/base/include/android-base/parsenetaddress.h b/base/include/android-base/parsenetaddress.h
index b4ac0256b..47f8b5f6e 100644
--- a/base/include/android-base/parsenetaddress.h
+++ b/base/include/android-base/parsenetaddress.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_PARSENETADDRESS_H
-#define ANDROID_BASE_PARSENETADDRESS_H
+#pragma once
#include <string>
@@ -34,5 +33,3 @@ bool ParseNetAddress(const std::string& address, std::string* host, int* port,
} // namespace base
} // namespace android
-
-#endif // ANDROID_BASE_PARSENETADDRESS_H
diff --git a/base/include/android-base/properties.h b/base/include/android-base/properties.h
index 3a051435c..31e52731d 100644
--- a/base/include/android-base/properties.h
+++ b/base/include/android-base/properties.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_PROPERTIES_H
-#define ANDROID_BASE_PROPERTIES_H
+#pragma once
#include <sys/cdefs.h>
@@ -73,5 +72,3 @@ bool WaitForPropertyCreation(const std::string& key, std::chrono::milliseconds r
} // namespace base
} // namespace android
-
-#endif // ANDROID_BASE_PROPERTIES_H
diff --git a/base/include/android-base/scopeguard.h b/base/include/android-base/scopeguard.h
index c314e0263..e6a9d109d 100644
--- a/base/include/android-base/scopeguard.h
+++ b/base/include/android-base/scopeguard.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_SCOPEGUARD_H
-#define ANDROID_BASE_SCOPEGUARD_H
+#pragma once
#include <utility> // for std::move, std::forward
@@ -66,5 +65,3 @@ ScopeGuard<F> make_scope_guard(F&& f) {
} // namespace base
} // namespace android
-
-#endif // ANDROID_BASE_SCOPEGUARD_H
diff --git a/base/include/android-base/stringprintf.h b/base/include/android-base/stringprintf.h
index c13d25d37..93c56afd7 100644
--- a/base/include/android-base/stringprintf.h
+++ b/base/include/android-base/stringprintf.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_STRINGPRINTF_H
-#define ANDROID_BASE_STRINGPRINTF_H
+#pragma once
#include <stdarg.h>
#include <string>
@@ -39,5 +38,3 @@ void StringAppendV(std::string* dst, const char* format, va_list ap)
} // namespace base
} // namespace android
-
-#endif // ANDROID_BASE_STRINGPRINTF_H
diff --git a/base/include/android-base/strings.h b/base/include/android-base/strings.h
index 4d9fa3404..9c3556084 100644
--- a/base/include/android-base/strings.h
+++ b/base/include/android-base/strings.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_STRINGS_H
-#define ANDROID_BASE_STRINGS_H
+#pragma once
#include <sstream>
#include <string>
@@ -75,5 +74,3 @@ bool EqualsIgnoreCase(const std::string& lhs, const std::string& rhs);
} // namespace base
} // namespace android
-
-#endif // ANDROID_BASE_STRINGS_H
diff --git a/base/include/android-base/test_utils.h b/base/include/android-base/test_utils.h
index b29676f7c..9e2ea97f2 100644
--- a/base/include/android-base/test_utils.h
+++ b/base/include/android-base/test_utils.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_TEST_UTILS_H
-#define ANDROID_BASE_TEST_UTILS_H
+#pragma once
#include <regex>
#include <string>
@@ -114,5 +113,3 @@ class CapturedStdout : public CapturedStdFd {
ADD_FAILURE() << "regex mismatch: expected to not find " << (pattern) << " in:\n" << (str); \
} \
} while (0)
-
-#endif // ANDROID_BASE_TEST_UTILS_H
diff --git a/base/include/android-base/thread_annotations.h b/base/include/android-base/thread_annotations.h
index 1307f0e2c..d56e9355d 100644
--- a/base/include/android-base/thread_annotations.h
+++ b/base/include/android-base/thread_annotations.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_THREAD_ANNOTATIONS_H
-#define ANDROID_BASE_THREAD_ANNOTATIONS_H
+#pragma once
#if defined(__SUPPORT_TS_ANNOTATION__) || defined(__clang__)
#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
@@ -109,5 +108,3 @@
#define NO_THREAD_SAFETY_ANALYSIS \
THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
-
-#endif // ANDROID_BASE_THREAD_ANNOTATIONS_H
diff --git a/base/include/android-base/threads.h b/base/include/android-base/threads.h
index 85e65ba65..f4ba8091f 100644
--- a/base/include/android-base/threads.h
+++ b/base/include/android-base/threads.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_THREADS_H
-#define ANDROID_BASE_THREADS_H
+#pragma once
#include <stdint.h>
@@ -24,5 +23,3 @@ namespace base {
uint64_t GetThreadId();
}
} // namespace android
-
-#endif
diff --git a/base/include/android-base/unique_fd.h b/base/include/android-base/unique_fd.h
index 5d8927198..d334e30ed 100644
--- a/base/include/android-base/unique_fd.h
+++ b/base/include/android-base/unique_fd.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_UNIQUE_FD_H
-#define ANDROID_BASE_UNIQUE_FD_H
+#pragma once
#include <fcntl.h>
@@ -150,5 +149,3 @@ int close(const android::base::unique_fd_impl<T>&)
#endif
"close called on unique_fd"
)));
-
-#endif // ANDROID_BASE_UNIQUE_FD_H
diff --git a/base/include/android-base/utf8.h b/base/include/android-base/utf8.h
index c9cc1ab0c..4b916232c 100755
--- a/base/include/android-base/utf8.h
+++ b/base/include/android-base/utf8.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_BASE_UTF8_H
-#define ANDROID_BASE_UTF8_H
+#pragma once
#ifdef _WIN32
#include <string>
@@ -102,5 +101,3 @@ using ::unlink;
} // namespace utf8
} // namespace base
} // namespace android
-
-#endif // ANDROID_BASE_UTF8_H