| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef Collections_h | 5 #ifndef Collections_h |
| 6 #define Collections_h | 6 #define Collections_h |
| 7 | 7 |
| 8 #if V8_INSPECTOR_USE_STL | 8 #if V8_INSPECTOR_USE_STL |
| 9 #include "platform/inspector_protocol/CollectionsSTL.h" | 9 #include "platform/inspector_protocol/CollectionsSTL.h" |
| 10 #else | 10 #else |
| 11 #include "platform/inspector_protocol/CollectionsWTF.h" | 11 #include "platform/inspector_protocol/CollectionsWTF.h" |
| 12 #endif // V8_INSPECTOR_USE_STL | 12 #endif // V8_INSPECTOR_USE_STL |
| 13 | 13 |
| 14 |
| 15 // Macro that returns a compile time constant with the length of an array, but g
ives an error if passed a non-array. |
| 16 template<typename T, size_t Size> char (&ArrayLengthHelperFunction(T (&)[Size]))
[Size]; |
| 17 // GCC needs some help to deduce a 0 length array. |
| 18 #if defined(__GNUC__) |
| 19 template<typename T> char (&ArrayLengthHelperFunction(T (&)[0]))[0]; |
| 20 #endif |
| 21 #define PROTOCOL_ARRAY_LENGTH(array) sizeof(::ArrayLengthHelperFunction(array)) |
| 22 |
| 14 #endif // !defined(Collections_h) | 23 #endif // !defined(Collections_h) |
| OLD | NEW |