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

Unified Diff: include/core/SkTypes.h

Issue 1306443004: Use static_assert instead of SK_COMPILE_ASSERT. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « include/core/SkPath.h ('k') | include/gpu/GrTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTypes.h
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 2e495117d83b5dc80c156dea636882626e1cf22f..bed33fb8b2db500004f5932b3b06453f7db25c61 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -154,20 +154,6 @@ inline void operator delete(void* p) {
#define SK_TO_STRING_OVERRIDE() void toString(SkString* str) const override;
#endif
-template <bool>
-struct SkCompileAssert {
-};
-
-// Uses static_cast<bool>(expr) instead of bool(expr) due to
-// https://connect.microsoft.com/VisualStudio/feedback/details/832915
-
-// The extra parentheses in SkCompileAssert<(...)> are a work around for
-// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57771
-// which was fixed in gcc 4.8.2.
-#define SK_COMPILE_ASSERT(expr, msg) \
- typedef SkCompileAssert<(static_cast<bool>(expr))> \
- msg[static_cast<bool>(expr) ? 1 : -1] SK_UNUSED
-
/*
* Usage: SK_MACRO_CONCAT(a, b) to construct the symbol ab
*
@@ -209,7 +195,7 @@ struct SkCompileAssert {
* Take a look at SkAutoFree and SkAutoMalloc in this file for examples.
*/
#define SK_REQUIRE_LOCAL_VAR(classname) \
- SK_COMPILE_ASSERT(false, missing_name_for_##classname)
+ static_assert(false, "missing name for " #classname)
///////////////////////////////////////////////////////////////////////
« no previous file with comments | « include/core/SkPath.h ('k') | include/gpu/GrTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698