OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 | 5 |
6 /** | 6 /** |
7 * Defines the common macros such as assert, inline, ... | 7 * Defines the common macros such as assert, inline, ... |
8 */ | 8 */ |
9 | 9 |
10 #inline c | 10 #inline c |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 /* PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES is for typenames that contain 'enum' | 80 /* PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES is for typenames that contain 'enum' |
81 in C. That is, enum names that are not typedefs. | 81 in C. That is, enum names that are not typedefs. |
82 E.g.: | 82 E.g.: |
83 enum Bar { A = 0, B = 1 }; | 83 enum Bar { A = 0, B = 1 }; |
84 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(Foo, 4); | 84 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(Foo, 4); |
85 */ | 85 */ |
86 #define PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(NAME, SIZE) \ | 86 #define PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(NAME, SIZE) \ |
87 PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, enum NAME, SIZE) | 87 PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, enum NAME, SIZE) |
88 | 88 |
89 /* This is roughly copied from base/compiler_specific.h, and makes it possible | |
90 to pass 'this' in a constructor initializer list, when you really mean it. | |
91 E.g.: | |
92 Foo::Foo(MyInstance* instance) | |
93 : PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) {} | |
94 */ | |
95 #if defined(_MSC_VER) | |
96 # define PP_ALLOW_THIS_IN_INITIALIZER_LIST(code) \ | |
97 __pragma(warning(push)) \ | |
98 __pragma(warning(disable:4355)) \ | |
99 code \ | |
100 __pragma(warning(pop)) | |
101 #else | |
102 # define PP_ALLOW_THIS_IN_INITIALIZER_LIST(code) code | |
103 #endif | |
104 | |
105 /** | 89 /** |
106 * @} | 90 * @} |
107 * End of addtogroup PP | 91 * End of addtogroup PP |
108 */ | 92 */ |
109 | 93 |
110 #endinl | 94 #endinl |
OLD | NEW |