Index: ppapi/c/pp_macros.h |
=================================================================== |
--- ppapi/c/pp_macros.h (revision 68374) |
+++ ppapi/c/pp_macros.h (working copy) |
@@ -53,7 +53,7 @@ |
SIZE is the expected size in bytes. |
*/ |
#define PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, CTYPENAME, SIZE) \ |
-struct _dummy_struct_for_##NAME { \ |
+struct PP_Dummy_Struct_For_##NAME { \ |
char _COMPILE_ASSERT_FAILED_The_type_named_ \ |
## NAME ## _is_not_ ## SIZE ## \ |
_bytes_wide[(sizeof(CTYPENAME) == SIZE) ? 1 : -1]; } |
@@ -76,6 +76,39 @@ |
#define PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(NAME, SIZE) \ |
PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, struct NAME, SIZE) |
+/* PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES is for typenames that contain 'enum' |
+ in C. That is, enum names that are not typedefs. |
+ E.g.: |
+ enum Bar { A = 0, B = 1 }; |
+ PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(Foo, 4); |
+ */ |
+#define PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(NAME, SIZE) \ |
+PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, enum NAME, SIZE) |
+ |
+/* Processor architecture detection. This was copied from: |
+ chromium/src/build/build_config.h |
+ For more info on what's defined, see: |
+ http://msdn.microsoft.com/en-us/library/b0084kay.aspx |
+ http://www.agner.org/optimize/calling_conventions.pdf |
+ or with gcc, run: "echo | gcc -E -dM -" |
+ */ |
+#if defined(_M_X64) || defined(__x86_64__) |
+#define ARCH_CPU_X86_FAMILY 1 |
+#define ARCH_CPU_X86_64 1 |
+#define ARCH_CPU_64_BITS 1 |
+#elif defined(_M_IX86) || defined(__i386__) |
+#define ARCH_CPU_X86_FAMILY 1 |
+#define ARCH_CPU_X86 1 |
+#define ARCH_CPU_32_BITS 1 |
+#elif defined(__ARMEL__) |
+#define ARCH_CPU_ARM_FAMILY 1 |
+#define ARCH_CPU_ARMEL 1 |
+#define ARCH_CPU_32_BITS 1 |
+#define WCHAR_T_IS_UNSIGNED 1 |
+#else |
+#error Please add support for your architecture in ppapi/c/pp_macros.h |
+#endif |
+ |
/** |
* @} |
* End of addtogroup PP |