commit | 1ad2a1dbcde42412bb92c83fe5e0d6999ed00311 | [log] [tgz] |
---|---|---|
author | [email protected] <[email protected]@0039d316-1c4b-4281-b951-d872f2087c98> | Mon Dec 13 20:04:31 2010 |
committer | [email protected] <[email protected]@0039d316-1c4b-4281-b951-d872f2087c98> | Mon Dec 13 20:04:31 2010 |
tree | bec94376d42b1943e2830e695956252232283b4d | |
parent | f68fbd1b300401c79df8df9773bbe7aa36ff6062 [diff] [blame] |
Add compile assertions to enforce the sizes of all structs and enums in the C API. Adjust some structs to make their sizes consistent across architectures. Note that some structs contain pointers, so are difficult to make consistent between 32-bit and 64-bit. Those types are in test_struct_sizes.c. Other types have a compile assertion immediately after their definition. This was broken off from a bigger CL: http://codereview.chromium.org/5340003/ BUG=61004,92983 TEST=test_struct_sizes.c, compile assertions throughout See this CL for the code that helped generate the static assertions and find affected interfaces: http://codereview.chromium.org/5730003 Review URL: http://codereview.chromium.org/5674004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69038 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ppapi/c/pp_point.h b/ppapi/c/pp_point.h index 0ff85621..675a5522 100644 --- a/ppapi/c/pp_point.h +++ b/ppapi/c/pp_point.h
@@ -20,6 +20,7 @@ int32_t x; int32_t y; }; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Point, 8); PP_INLINE struct PP_Point PP_MakePoint(int32_t x, int32_t y) { struct PP_Point ret;