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

Unified Diff: base/time/time_mac.cc

Issue 1467003002: Switch to static_assert in base/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: / 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
« no previous file with comments | « base/template_util_unittest.cc ('k') | base/time/time_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time_mac.cc
diff --git a/base/time/time_mac.cc b/base/time/time_mac.cc
index 578e03904b97c239024b3f9a070d9a3699f43572..139e0c9e297ad7ec3d95e61447c801c8689a45bc 100644
--- a/base/time/time_mac.cc
+++ b/base/time/time_mac.cc
@@ -135,8 +135,8 @@ Time Time::Now() {
// static
Time Time::FromCFAbsoluteTime(CFAbsoluteTime t) {
- COMPILE_ASSERT(std::numeric_limits<CFAbsoluteTime>::has_infinity,
- numeric_limits_infinity_is_undefined_when_not_has_infinity);
+ static_assert(std::numeric_limits<CFAbsoluteTime>::has_infinity,
+ "CFAbsoluteTime must have an infinity value");
if (t == 0)
return Time(); // Consider 0 as a null Time.
if (t == std::numeric_limits<CFAbsoluteTime>::infinity())
@@ -147,8 +147,8 @@ Time Time::FromCFAbsoluteTime(CFAbsoluteTime t) {
}
CFAbsoluteTime Time::ToCFAbsoluteTime() const {
- COMPILE_ASSERT(std::numeric_limits<CFAbsoluteTime>::has_infinity,
- numeric_limits_infinity_is_undefined_when_not_has_infinity);
+ static_assert(std::numeric_limits<CFAbsoluteTime>::has_infinity,
+ "CFAbsoluteTime must have an infinity value");
if (is_null())
return 0; // Consider 0 as a null Time.
if (is_max())
« no previous file with comments | « base/template_util_unittest.cc ('k') | base/time/time_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698