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

Unified Diff: ppapi/c/ppb_var.h

Issue 5340003: Make a new test to enforce the sizes of all structs and enums in the C API.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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/c/ppb_url_response_info.h ('k') | ppapi/generate_ppapi_include_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/c/ppb_var.h
===================================================================
--- ppapi/c/ppb_var.h (revision 68374)
+++ ppapi/c/ppb_var.h (working copy)
@@ -33,6 +33,7 @@
PP_OBJECTPROPERTY_MODIFIER_DONTDELETE = 1 << 2,
PP_OBJECTPROPERTY_MODIFIER_HASVALUE = 1 << 3
};
+PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_ObjectProperty_Modifier, 4);
struct PP_ObjectProperty {
struct PP_Var name;
@@ -40,7 +41,16 @@
struct PP_Var getter;
struct PP_Var setter;
uint32_t modifiers;
+
+ /** Ensure that this struct is 72 bytes wide by padding the end. In some
+ * compilers, PP_Var is 8-byte aligned, so those compilers align this struct
+ * on 8-byte boundaries as well and pad it to 72 bytes even without this
+ * padding attribute. This padding makes its size consistent across
+ * compilers.
+ */
+ int32_t padding;
};
+PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_ObjectProperty, 72);
/**
* PPB_Var API
« no previous file with comments | « ppapi/c/ppb_url_response_info.h ('k') | ppapi/generate_ppapi_include_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698