Index: webkit/plugins/ppapi/usb_key_code_conversion.h |
diff --git a/webkit/plugins/ppapi/usb_key_code_conversion.h b/webkit/plugins/ppapi/usb_key_code_conversion.h |
index fc3da163c2c0f7ad85caabb4f6a853de4f27bbcf..b37ad42be118f227fa8a2b144737888f4d295d05 100644 |
--- a/webkit/plugins/ppapi/usb_key_code_conversion.h |
+++ b/webkit/plugins/ppapi/usb_key_code_conversion.h |
@@ -21,6 +21,14 @@ namespace ppapi { |
// is returned. |
uint32_t UsbKeyCodeForKeyboardEvent(const WebKit::WebKeyboardEvent& key_event); |
+// Compile time check to verify that the given array (of type CTYPENAME) has |
+// exactly SIZE elements. |
+#define COMPILE_ASSERT_ARRAY_SIZE(NAME, CTYPENAME, SIZE) \ |
+struct Dummy_Struct_For_##NAME { \ |
+char _COMPILE_ASSERT_FAILED_The_array_named_ \ |
+## NAME ## _does_not_have_ ## SIZE ## \ |
+_elements[(sizeof(NAME) == (SIZE * sizeof(CTYPENAME))) ? 1 : -1]; } |
Wez
2012/03/07 23:25:18
PPAPI headers already use macros of this sort; can
dmichael (off chromium)
2012/03/07 23:45:07
since here we're free to use things in base, it wo
garykac
2012/03/14 13:47:47
Done.
|
+ |
} // namespace ppapi |
} // namespace webkit |