OLD | NEW |
| (Empty) |
1 // Copyright 2005-2009 Google Inc. | |
2 // | |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 // you may not use this file except in compliance with the License. | |
5 // You may obtain a copy of the License at | |
6 // | |
7 // http://www.apache.org/licenses/LICENSE-2.0 | |
8 // | |
9 // Unless required by applicable law or agreed to in writing, software | |
10 // distributed under the License is distributed on an "AS IS" BASIS, | |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 // See the License for the specific language governing permissions and | |
13 // limitations under the License. | |
14 // ======================================================================== | |
15 | |
16 // PP_STRINGIZE - expands arguments before stringizing | |
17 // PP_STRINGIZE(PP_CAT(a,b)) => "ab" | |
18 | |
19 #define PP_STRINGIZE(text) PP_STRINGIZE_A((text)) | |
20 #define PP_STRINGIZE_A(arg) PP_STRINGIZE_B ## (arg) | |
21 #define PP_STRINGIZE_B(arg) PP_STRINGIZE_I ## arg | |
22 #define PP_STRINGIZE_I(text) #text | |
23 | |
24 // T_PP_STRINGIZE - expands arguments before stringizing | |
25 // T_PP_STRINGIZE(PP_CAT(a,b)) => _T("ab") | |
26 | |
27 #define T_PP_STRINGIZE(text) T_PP_STRINGIZE_A((text)) | |
28 #define T_PP_STRINGIZE_A(arg) T_PP_STRINGIZE_B ## (arg) | |
29 #define T_PP_STRINGIZE_B(arg) T_PP_STRINGIZE_I ## arg | |
30 #define T_PP_STRINGIZE_I(text) _T(#text) | |
31 | |
32 // PP_CAT - concatenates arguments after they have been expanded | |
33 // PP_CAT(x, PP_CAT(y,z)) => xyz | |
34 #define PP_CAT(a,b) PP_CAT_I(a,b) | |
35 #define PP_CAT_I(a,b) PP_CAT_J(a##b) | |
36 #define PP_CAT_J(arg) arg | |
OLD | NEW |