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

Unified Diff: third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.cpp

Issue 1676703002: Stop using macros to paste together names for static_asserts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: static-asserts-enums: a,b,#a Created 4 years, 10 months 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
« no previous file with comments | « ppapi/thunk/ppb_text_input_thunk.cc ('k') | third_party/WebKit/Source/web/AssertMatchingEnums.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.cpp
diff --git a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.cpp b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.cpp
index 2fa03ae3bfc42851057da60fdda0e556527880c6..e0afb0835ab114aa80cdad1dc7fbd081582a2ab4 100644
--- a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.cpp
+++ b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.cpp
@@ -16,12 +16,13 @@
#include "public/platform/modules/screen_orientation/WebScreenOrientationType.h"
// This code assumes that WebScreenOrientationType values are included in WebScreenOrientationLockType.
-#define STATIC_ASSERT_MATCHING_ENUM(enum1, enum2) \
- static_assert(static_cast<unsigned>(blink::enum1) == static_cast<unsigned>(blink::enum2), "mismatching enum values")
-STATIC_ASSERT_MATCHING_ENUM(WebScreenOrientationPortraitPrimary, WebScreenOrientationLockPortraitPrimary);
-STATIC_ASSERT_MATCHING_ENUM(WebScreenOrientationPortraitSecondary, WebScreenOrientationLockPortraitSecondary);
-STATIC_ASSERT_MATCHING_ENUM(WebScreenOrientationLandscapePrimary, WebScreenOrientationLockLandscapePrimary);
-STATIC_ASSERT_MATCHING_ENUM(WebScreenOrientationLandscapeSecondary, WebScreenOrientationLockLandscapeSecondary);
+#define STATIC_ASSERT_ENUM(a, b) \
+ static_assert(static_cast<int>(a) == static_cast<int>(b), \
+ "mismatching enum: " #a)
+STATIC_ASSERT_ENUM(blink::WebScreenOrientationPortraitPrimary, blink::WebScreenOrientationLockPortraitPrimary);
+STATIC_ASSERT_ENUM(blink::WebScreenOrientationPortraitSecondary, blink::WebScreenOrientationLockPortraitSecondary);
+STATIC_ASSERT_ENUM(blink::WebScreenOrientationLandscapePrimary, blink::WebScreenOrientationLockLandscapePrimary);
+STATIC_ASSERT_ENUM(blink::WebScreenOrientationLandscapeSecondary, blink::WebScreenOrientationLockLandscapeSecondary);
namespace blink {
« no previous file with comments | « ppapi/thunk/ppb_text_input_thunk.cc ('k') | third_party/WebKit/Source/web/AssertMatchingEnums.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698