From 1ad2a1dbcde42412bb92c83fe5e0d6999ed00311 Mon Sep 17 00:00:00 2001 From: "dmichael@google.com" Date: Mon, 13 Dec 2010 20:04:31 +0000 Subject: 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 --- ppapi/c/pp_time.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ppapi/c/pp_time.h') diff --git a/ppapi/c/pp_time.h b/ppapi/c/pp_time.h index 7dec91a..330a16c 100644 --- a/ppapi/c/pp_time.h +++ b/ppapi/c/pp_time.h @@ -13,12 +13,15 @@ * @{ */ +#include "ppapi/c/pp_macros.h" + /** * PP_Time represents the "wall clock time" according to the browser and is * defined as the number of seconds since the Epoch (00:00:00 UTC, January 1, * 1970). */ typedef double PP_Time; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Time, 8); /** * Represents time ticks which is measured in seconds and is used for indicating @@ -30,6 +33,7 @@ typedef double PP_Time; * epoch, so the most you can do is compare two values. */ typedef double PP_TimeTicks; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TimeTicks, 8); /** * @} -- cgit v1.1