Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / pdfium / third_party / macros.h
1 // Copyright 2014 The Chromium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4 \r
5 // This file contains macros and macro-like constructs (e.g., templates) that\r
6 // are commonly used throughout Chromium source. (It may also contain things\r
7 // that are closely related to things that are commonly used that belong in this\r
8 // file.)\r
9 \r
10 #ifndef BASE_MACROS_H_\r
11 #define BASE_MACROS_H_\r
12 \r
13 // The COMPILE_ASSERT macro can be used to verify that a compile time\r
14 // expression is true. For example, you could use it to verify the\r
15 // size of a static array:\r
16 //\r
17 //   COMPILE_ASSERT(ARRAYSIZE_UNSAFE(content_type_names) == CONTENT_NUM_TYPES,\r
18 //                  content_type_names_incorrect_size);\r
19 //\r
20 // or to make sure a struct is smaller than a certain size:\r
21 //\r
22 //   COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large);\r
23 //\r
24 // The second argument to the macro is the name of the variable. If\r
25 // the expression is false, most compilers will issue a warning/error\r
26 // containing the name of the variable.\r
27 \r
28 #undef COMPILE_ASSERT\r
29 #define COMPILE_ASSERT(expr, msg) static_assert(expr, #msg)\r
30 \r
31 #endif  // BASE_MACROS_H_\r