filename | src/x86dasm/symcat.h |
changeset | 362:dc40e2064dc4 |
author | nkeynes |
date | Mon Jul 21 00:08:34 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Add gettext.h and build sanely without libintl if it's not available Remove x86dasm's config.h & opintl.h (no longer needed and actually wrong) |
file | annotate | diff | log | raw |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00001.2 +++ b/src/x86dasm/symcat.h Mon Jul 21 00:08:34 2008 +00001.3 @@ -0,0 +1,49 @@1.4 +/* Symbol concatenation utilities.1.5 +1.6 + Copyright (C) 1998, 2000 Free Software Foundation, Inc.1.7 +1.8 + This program is free software; you can redistribute it and/or modify1.9 + it under the terms of the GNU General Public License as published by1.10 + the Free Software Foundation; either version 2 of the License, or1.11 + (at your option) any later version.1.12 +1.13 + This program is distributed in the hope that it will be useful,1.14 + but WITHOUT ANY WARRANTY; without even the implied warranty of1.15 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1.16 + GNU General Public License for more details.1.17 +1.18 + You should have received a copy of the GNU General Public License along1.19 + with this program; if not, write to the Free Software Foundation, Inc.,1.20 + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */1.21 +1.22 +#ifndef SYM_CAT_H1.23 +#define SYM_CAT_H1.24 +1.25 +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)1.26 +#define CONCAT2(a,b) a##b1.27 +#define CONCAT3(a,b,c) a##b##c1.28 +#define CONCAT4(a,b,c,d) a##b##c##d1.29 +#define STRINGX(s) #s1.30 +#else1.31 +/* Note one should never pass extra whitespace to the CONCATn macros,1.32 + e.g. CONCAT2(foo, bar) because traditonal C will keep the space between1.33 + the two labels instead of concatenating them. Instead, make sure to1.34 + write CONCAT2(foo,bar). */1.35 +#define CONCAT2(a,b) a/**/b1.36 +#define CONCAT3(a,b,c) a/**/b/**/c1.37 +#define CONCAT4(a,b,c,d) a/**/b/**/c/**/d1.38 +#define STRINGX(s) "s"1.39 +#endif1.40 +1.41 +#define XCONCAT2(a,b) CONCAT2(a,b)1.42 +#define XCONCAT3(a,b,c) CONCAT3(a,b,c)1.43 +#define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d)1.44 +1.45 +/* Note the layer of indirection here is typically used to allow1.46 + stringification of the expansion of macros. I.e. "#define foo1.47 + bar", "XSTRING(foo)", to yield "bar". Be aware that this only1.48 + works for __STDC__, not for traditional C which will still resolve1.49 + to "foo". */1.50 +#define XSTRING(s) STRINGX(s)1.51 +1.52 +#endif /* SYM_CAT_H */
.