Chromium Code Reviews

Unified Diff: media/blink/webmediaplayer_util.cc

Issue 826953002: replace COMPILE_ASSERT with static_assert in media/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | media/blink/webmediasource_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_util.cc
diff --git a/media/blink/webmediaplayer_util.cc b/media/blink/webmediaplayer_util.cc
index bcaf13567aa21e143f2ae637bd50367953d8454d..64f01ff567448ec6676619b2e74bd080fbb91e50 100644
--- a/media/blink/webmediaplayer_util.cc
+++ b/media/blink/webmediaplayer_util.cc
@@ -14,14 +14,14 @@ namespace media {
// Compile asserts shared by all platforms.
-#define COMPILE_ASSERT_MATCHING_ENUM(name) \
- COMPILE_ASSERT( \
+#define STATIC_ASSERT_MATCHING_ENUM(name) \
+ static_assert( \
static_cast<int>(blink::WebMediaPlayerClient::MediaKeyErrorCode ## name) == \
static_cast<int>(MediaKeys::k ## name ## Error), \
- mismatching_enums)
-COMPILE_ASSERT_MATCHING_ENUM(Unknown);
-COMPILE_ASSERT_MATCHING_ENUM(Client);
-#undef COMPILE_ASSERT_MATCHING_ENUM
+ "mismatching enum values: " #name)
+STATIC_ASSERT_MATCHING_ENUM(Unknown);
+STATIC_ASSERT_MATCHING_ENUM(Client);
+#undef STATIC_ASSERT_MATCHING_ENUM
base::TimeDelta ConvertSecondsToTimestamp(double seconds) {
double microseconds = seconds * base::Time::kMicrosecondsPerSecond;
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | media/blink/webmediasource_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine