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

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: message cleanup 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..71f0749aa179c038f59257b8c2f587fe35050ce7 100644
--- a/components/mus/public/cpp/window_property.h
+++ b/components/mus/public/cpp/window_property.h
@@ -129,14 +129,16 @@ void Window::ClearLocalProperty(const WindowProperty<T>* property) {
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); \
+ static_assert(sizeof(TYPE) <= sizeof(int64_t), \
+ "Property type must fit in 64 bits"); \
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); \
+ static_assert(sizeof(TYPE) <= sizeof(int64_t), \
+ "Property type must fit in 64 bits"); \
namespace { \
const mus::WindowProperty<TYPE> NAME##_Value = {DEFAULT, #NAME, nullptr}; \
const mus::WindowProperty<TYPE>* const NAME = &NAME##_Value; \
« no previous file with comments | « components/html_viewer/web_socket_handle_impl.cc ('k') | components/password_manager/core/browser/login_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698