Mercurial > hg > CbC > CbC_gcc
comparison include/symcat.h @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | a06113de4d67 |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
56:3c8a44c06a95 | 63:b7f97abdc517 |
---|---|
1 /* Symbol concatenation utilities. | 1 /* Symbol concatenation utilities. |
2 | 2 |
3 Copyright (C) 1998, 2000 Free Software Foundation, Inc. | 3 Copyright (C) 1998, 2000, 2010 Free Software Foundation, Inc. |
4 | 4 |
5 This program is free software; you can redistribute it and/or modify | 5 This program is free software; you can redistribute it and/or modify |
6 it under the terms of the GNU General Public License as published by | 6 it under the terms of the GNU General Public License as published by |
7 the Free Software Foundation; either version 2 of the License, or | 7 the Free Software Foundation; either version 2 of the License, or |
8 (at your option) any later version. | 8 (at your option) any later version. |
21 | 21 |
22 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) | 22 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) |
23 #define CONCAT2(a,b) a##b | 23 #define CONCAT2(a,b) a##b |
24 #define CONCAT3(a,b,c) a##b##c | 24 #define CONCAT3(a,b,c) a##b##c |
25 #define CONCAT4(a,b,c,d) a##b##c##d | 25 #define CONCAT4(a,b,c,d) a##b##c##d |
26 #define CONCAT5(a,b,c,d,e) a##b##c##d##e | |
27 #define CONCAT6(a,b,c,d,e,f) a##b##c##d##e##f | |
26 #define STRINGX(s) #s | 28 #define STRINGX(s) #s |
27 #else | 29 #else |
28 /* Note one should never pass extra whitespace to the CONCATn macros, | 30 /* Note one should never pass extra whitespace to the CONCATn macros, |
29 e.g. CONCAT2(foo, bar) because traditonal C will keep the space between | 31 e.g. CONCAT2(foo, bar) because traditonal C will keep the space between |
30 the two labels instead of concatenating them. Instead, make sure to | 32 the two labels instead of concatenating them. Instead, make sure to |
31 write CONCAT2(foo,bar). */ | 33 write CONCAT2(foo,bar). */ |
32 #define CONCAT2(a,b) a/**/b | 34 #define CONCAT2(a,b) a/**/b |
33 #define CONCAT3(a,b,c) a/**/b/**/c | 35 #define CONCAT3(a,b,c) a/**/b/**/c |
34 #define CONCAT4(a,b,c,d) a/**/b/**/c/**/d | 36 #define CONCAT4(a,b,c,d) a/**/b/**/c/**/d |
37 #define CONCAT5(a,b,c,d,e) a/**/b/**/c/**/d/**/e | |
38 #define CONCAT6(a,b,c,d,e,f) a/**/b/**/c/**/d/**/e/**/f | |
35 #define STRINGX(s) "s" | 39 #define STRINGX(s) "s" |
36 #endif | 40 #endif |
37 | 41 |
38 #define XCONCAT2(a,b) CONCAT2(a,b) | 42 #define XCONCAT2(a,b) CONCAT2(a,b) |
39 #define XCONCAT3(a,b,c) CONCAT3(a,b,c) | 43 #define XCONCAT3(a,b,c) CONCAT3(a,b,c) |
40 #define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d) | 44 #define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d) |
45 #define XCONCAT5(a,b,c,d,e) CONCAT5(a,b,c,d,e) | |
46 #define XCONCAT6(a,b,c,d,e,f) CONCAT6(a,b,c,d,e,f) | |
41 | 47 |
42 /* Note the layer of indirection here is typically used to allow | 48 /* Note the layer of indirection here is typically used to allow |
43 stringification of the expansion of macros. I.e. "#define foo | 49 stringification of the expansion of macros. I.e. "#define foo |
44 bar", "XSTRING(foo)", to yield "bar". Be aware that this only | 50 bar", "XSTRING(foo)", to yield "bar". Be aware that this only |
45 works for __STDC__, not for traditional C which will still resolve | 51 works for __STDC__, not for traditional C which will still resolve |