From 832815151ff8a27c547c9c2b37954eac903993b9 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 17 Aug 2020 10:07:29 -0700 Subject: [PATCH] Deprecate . I stumbled across this because of the `#ifdef __cplusplus` inside an unguarded `namespace`, but this whole file should be deprecated and removed in favor of static_assert. Test: treehugger Change-Id: I2b65db67e694115e915f0cc9d762b0fd41a7d2af --- libutils/include/utils/Debug.h | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/libutils/include/utils/Debug.h b/libutils/include/utils/Debug.h index 96bd70eb0..c3b902617 100644 --- a/libutils/include/utils/Debug.h +++ b/libutils/include/utils/Debug.h @@ -14,27 +14,9 @@ * limitations under the License. */ -#ifndef ANDROID_UTILS_DEBUG_H -#define ANDROID_UTILS_DEBUG_H +#pragma once -#include -#include +// Note: new code should use static_assert directly. -namespace android { -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -template struct CompileTimeAssert; -template<> struct CompileTimeAssert {}; -#define COMPILE_TIME_ASSERT(_exp) \ - template class CompileTimeAssert< (_exp) >; -#endif - -// DO NOT USE: Please use static_assert instead -#define COMPILE_TIME_ASSERT_FUNCTION_SCOPE(_exp) \ - CompileTimeAssert<( _exp )>(); - -// --------------------------------------------------------------------------- -} // namespace android - -#endif // ANDROID_UTILS_DEBUG_H +#define COMPILE_TIME_ASSERT static_assert +#define COMPILE_TIME_ASSERT_FUNCTION_SCOPE static_assert