Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Unified Diff: components/mus/public/cpp/window_property.h

Issue 1468803002: Switch to static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assert1
Patch Set: win Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/mus/public/cpp/window_property.h
diff --git a/components/mus/public/cpp/window_property.h b/components/mus/public/cpp/window_property.h
index cd5dd2b508a42c768f5f035326ddad0e61ddcafa..ab7fdaf70aa3f4259af22ba34c0a697a96bd6745 100644
--- a/components/mus/public/cpp/window_property.h
+++ b/components/mus/public/cpp/window_property.h
@@ -128,18 +128,18 @@ void Window::ClearLocalProperty(const WindowProperty<T>* property) {
#define DECLARE_WINDOW_PROPERTY_TYPE(T) \
DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(, T)
-#define DEFINE_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \
- COMPILE_ASSERT(sizeof(TYPE) <= sizeof(int64_t), property_type_too_large); \
- namespace { \
- const mus::WindowProperty<TYPE> NAME##_Value = {DEFAULT, #NAME, nullptr}; \
- } \
+#define DEFINE_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \
+ static_assert(sizeof(TYPE) <= sizeof(int64_t), "property_type_too_large"); \
+ namespace { \
+ const mus::WindowProperty<TYPE> NAME##_Value = {DEFAULT, #NAME, nullptr}; \
+ } \
const mus::WindowProperty<TYPE>* const NAME = &NAME##_Value;
-#define DEFINE_LOCAL_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \
- COMPILE_ASSERT(sizeof(TYPE) <= sizeof(int64_t), property_type_too_large); \
- namespace { \
- const mus::WindowProperty<TYPE> NAME##_Value = {DEFAULT, #NAME, nullptr}; \
- const mus::WindowProperty<TYPE>* const NAME = &NAME##_Value; \
+#define DEFINE_LOCAL_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \
+ static_assert(sizeof(TYPE) <= sizeof(int64_t), "property_type_too_large"); \
+ namespace { \
+ const mus::WindowProperty<TYPE> NAME##_Value = {DEFAULT, #NAME, nullptr}; \
+ const mus::WindowProperty<TYPE>* const NAME = &NAME##_Value; \
}
#define DEFINE_OWNED_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \

Powered by Google App Engine
This is Rietveld 408576698