Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvs2svn <>2002-02-10 01:54:17 +0300
committercvs2svn <>2002-02-10 01:54:17 +0300
commit34124a07180b9c8c7479517436c49292cfd12dcd (patch)
tree75b8ab96fbc6007f3c2f5289a74119190b1c246c /include/nlm/common.h
parent53c570dbbc783190848fb72380c42664c4a5e808 (diff)
This commit was manufactured by cvs2svn to create branch 'binutils-binutils-2_12-branchpoint
2_12-branch'. Sprout from gdb_5_1-2001-07-29-branch 2001-07-26 14:20:06 UTC cvs2svn 'This commit was manufactured by cvs2svn to create branch' Cherrypick from master 2002-02-09 22:54:16 UTC Richard Henderson <rth@redhat.com> ' * alpha.h (R_ALPHA_BRSGP): New.': COPYING.NEWLIB ChangeLog MAINTAINERS Makefile.in config.guess config.sub configure configure.in etc/ChangeLog etc/Makefile.in gettext.m4 include/ChangeLog include/ansidecl.h include/aout/ChangeLog include/aout/aout64.h include/aout/hp300hpux.h include/bfdlink.h include/coff/ChangeLog include/coff/arm.h include/coff/external.h include/coff/internal.h include/coff/m88k.h include/coff/or32.h include/coff/ti.h include/coff/tic54x.h include/coff/xcoff.h include/demangle.h include/dis-asm.h include/dyn-string.h include/elf/ChangeLog include/elf/alpha.h include/elf/arm.h include/elf/common.h include/elf/dwarf2.h include/elf/external.h include/elf/h8.h include/elf/ia64.h include/elf/internal.h include/elf/mips.h include/elf/mmix.h include/elf/or32.h include/elf/ppc.h include/elf/sh.h include/elf/xstormy16.h include/fibheap.h include/filenames.h include/floatformat.h include/hashtab.h include/libiberty.h include/nlm/ChangeLog include/nlm/common.h include/objalloc.h include/opcode/ChangeLog include/opcode/alpha.h include/opcode/arc.h include/opcode/avr.h include/opcode/cgen.h include/opcode/d10v.h include/opcode/d30v.h include/opcode/h8300.h include/opcode/hppa.h include/opcode/i386.h include/opcode/mips.h include/opcode/mmix.h include/opcode/or32.h include/opcode/ppc.h include/opcode/tic54x.h include/opcode/v850.h include/partition.h include/safe-ctype.h include/sort.h include/splay-tree.h include/xregex.h libtool.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh ltconfig ltmain.sh symlink-tree
Diffstat (limited to 'include/nlm/common.h')
-rw-r--r--include/nlm/common.h51
1 files changed, 25 insertions, 26 deletions
diff --git a/include/nlm/common.h b/include/nlm/common.h
index 70ec186fa..208f4cfa7 100644
--- a/include/nlm/common.h
+++ b/include/nlm/common.h
@@ -1,5 +1,5 @@
/* NLM (NetWare Loadable Module) support for BFD.
- Copyright 1993 Free Software Foundation, Inc.
+ Copyright 1993, 2001 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support
@@ -23,31 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This file is part of NLM support for BFD, and contains the portions
that are common to both the internal and external representations. */
-/* Semi-portable string concatenation in cpp.
- The NLM_CAT4 hack is to avoid a problem with some strict ANSI C
- preprocessors. The problem is, "32_" or "64_" are not a valid
- preprocessing tokens, and we don't want extra underscores (e.g.,
- "nlm_32_"). The XNLM_CAT2 macro will cause the inner NLM_CAT macros
- to be evaluated first, producing still-valid pp-tokens. Then the
- final concatenation can be done. (Sigh.) */
-
-#ifdef SABER
-# define NLM_CAT(a,b) a##b
-# define NLM_CAT3(a,b,c) a##b##c
-# define NLM_CAT4(a,b,c,d) a##b##c##d
-#else
-# ifdef __STDC__
-# define NLM_CAT(a,b) a##b
-# define NLM_CAT3(a,b,c) a##b##c
-# define XNLM_CAT2(a,b) NLM_CAT(a,b)
-# define NLM_CAT4(a,b,c,d) XNLM_CAT2(NLM_CAT(a,b),NLM_CAT(c,d))
-# else
-# define NLM_CAT(a,b) a/**/b
-# define NLM_CAT3(a,b,c) a/**/b/**/c
-# define NLM_CAT4(a,b,c,d) a/**/b/**/c/**/d
-# endif
-#endif
-
/* If NLM_ARCH_SIZE is not defined, default to 32. NLM_ARCH_SIZE is
optionally defined by the application. */
@@ -55,6 +30,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# define NLM_ARCH_SIZE 32
#endif
+/* Due to horrible details of ANSI macro expansion, we can't use CONCAT4
+ for NLM_NAME. CONCAT2 is used in BFD_JUMP_TABLE macros, and some of
+ them will expand to tokens that themselves are macros defined in terms
+ of NLM_NAME. If NLM_NAME were defined using CONCAT4 (which is itself
+ defined in bfd-in.h using CONCAT2), ANSI preprocessor rules say that
+ the CONCAT2 within NLM_NAME should not be expanded.
+ So use another name. */
+#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
+#ifdef SABER
+#define NLM_CAT4(a,b,c,d) a##b##c##d
+#else
+/* This hack is to avoid a problem with some strict ANSI C preprocessors.
+ The problem is, "32_" is not a valid preprocessing token, and we don't
+ want extra underscores (e.g., "nlm_32_"). The NLM_XCAT2 macro will
+ cause the inner CAT2 macros to be evaluated first, producing
+ still-valid pp-tokens. Then the final concatenation can be done. */
+#define NLM_CAT2(a,b) a##b
+#define NLM_XCAT2(a,b) NLM_CAT2(a,b)
+#define NLM_CAT4(a,b,c,d) NLM_XCAT2(NLM_CAT2(a,b),NLM_CAT2(c,d))
+#endif
+#else
+#define NLM_CAT4(a,b,c,d) a/**/b/**/c/**/d
+#endif
+
#if NLM_ARCH_SIZE == 32
# define NLM_TARGET_LONG_SIZE 4
# define NLM_TARGET_ADDRESS_SIZE 4