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

Unified Diff: include/svg/parser/SkSVGAttribute.h

Issue 1309523003: Remove SK_OFFSETOF from SkTypes, clean up offsetof usage. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Speling 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/private/SkTemplates.h ('k') | src/animator/SkDisplayInclude.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/svg/parser/SkSVGAttribute.h
diff --git a/include/svg/parser/SkSVGAttribute.h b/include/svg/parser/SkSVGAttribute.h
index 940ca5a951431169634a853e568f6907a519b5d4..5ba2916b742699cf1fc7d02284a3403e99e2c37d 100644
--- a/include/svg/parser/SkSVGAttribute.h
+++ b/include/svg/parser/SkSVGAttribute.h
@@ -20,7 +20,8 @@ struct SkSVGAttribute {
};
#ifndef SK_OFFSETOF
-#define SK_OFFSETOF(a, b) (((size_t) (&(((a*) 1)->b)))-1)
+ // This is offsetof for types which are not standard layout.
+ #define SK_OFFSETOF(type, field) (size_t)((char*)&(((type*)1024)->field) - (char*)1024)
#endif
#ifdef SK_DEBUG
« no previous file with comments | « include/private/SkTemplates.h ('k') | src/animator/SkDisplayInclude.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698