OLD | NEW |
(Empty) | |
| 1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. |
| 4 * |
| 5 * This header ensures (at compile time) that each type has the expected size. |
| 6 * The purpose is to ensure that the ABI of PPAPI is known, consistent, and |
| 7 * stable. If the size of one of these types changes, then it is necessary to |
| 8 * change the version of any interfaces that rely on the changed type(s). |
| 9 * |
| 10 * Note that the ABI only consists of the headers under ppapi/c. But they may |
| 11 * be compiled by either a C or C++ compiler, so we want to make sure they are |
| 12 * consistent regardless of whether a C or C++ compiler is used. See |
| 13 * test_struct_sizes_c.c and test_struct_sizes_cpp.cc for more information. |
| 14 */ |
| 15 |
| 16 #ifndef PPAPI_TESTS_ALL_C_SIZES_H_ |
| 17 #define PPAPI_TESTS_ALL_C_SIZES_H_ |
| 18 |
| 19 #include "ppapi/tests/all_c_includes.h" |
| 20 |
| 21 #if !defined(__native_client__) && (defined(_M_X64) || defined(__x86_64__)) |
| 22 /* These sizes are for 64-bit compilation on Windows, Mac, and Linux. Native |
| 23 client follows ILP32 even if -m64 is used. This means pointers are always |
| 24 4 bytes in native client, and it matches Win32 (see below). |
| 25 |
| 26 Each of these structs uses at least one type which differs in size or |
| 27 alignment between 64-bit and 32-bit (e.g. pointers, int64_t, uint64_t, |
| 28 or double), and they are not padded to keep their size consistent. */ |
| 29 #include "ppapi/tests/all_sizes_64.h" |
| 30 #else |
| 31 /* This section is for compilation on 32-bit targets plus native client (in both |
| 32 32-bit and 64-bit mode, since native client always conforms to ILP32). |
| 33 |
| 34 These types all contain pointers and have no types that are 8-byte aligned on |
| 35 Windows/NaCl. The pointers cause the sizes to differ between 32-bit and |
| 36 64-bit, but the lack of 8-byte-aligned types allows them to be consistent |
| 37 between Windows 32-bit, Native Client, and Mac/Linux 32-bit. */ |
| 38 #include "ppapi/tests/all_sizes_32.h" |
| 39 #endif |
| 40 |
| 41 #endif // PPAPI_TESTS_ALL_C_SIZES_H_ |
| 42 |
OLD | NEW |