Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

Location:
branches/GNU/src/binutils/include/nlm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/include/nlm/ChangeLog

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    1 2001-06-07  Alan Modra  <amodra@bigpond.net.au>
     12001-10-02  Alan Modra  <amodra@bigpond.net.au>
    22
    3         * Many files: Update copyright notices.
     3        * common.h (NLM_CAT, NLM_CAT3): Don't define.
     4        (NLM_CAT4): Update conditions under which this is defined.  Document
     5        why CONCAT4 can't be used.
    46
    57Fri May  6 13:31:04 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
  • branches/GNU/src/binutils/include/nlm/common.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* NLM (NetWare Loadable Module) support for BFD.
    2    Copyright 1993 Free Software Foundation, Inc.
     2   Copyright 1993, 2001 Free Software Foundation, Inc.
    33
    44   Written by Fred Fish @ Cygnus Support
     
    2424   that are common to both the internal and external representations. */
    2525
    26 /* Semi-portable string concatenation in cpp.
    27    The NLM_CAT4 hack is to avoid a problem with some strict ANSI C
    28    preprocessors.  The problem is, "32_" or "64_" are not a valid
    29    preprocessing tokens, and we don't want extra underscores (e.g.,
    30    "nlm_32_").  The XNLM_CAT2 macro will cause the inner NLM_CAT macros
    31    to be evaluated first, producing still-valid pp-tokens.  Then the
    32    final concatenation can be done.  (Sigh.)  */
    33 
    34 #ifdef SABER
    35 #  define NLM_CAT(a,b)          a##b
    36 #  define NLM_CAT3(a,b,c)       a##b##c
    37 #  define NLM_CAT4(a,b,c,d)     a##b##c##d
    38 #else
    39 #  ifdef __STDC__
    40 #    define NLM_CAT(a,b)        a##b
    41 #    define NLM_CAT3(a,b,c)     a##b##c
    42 #    define XNLM_CAT2(a,b)      NLM_CAT(a,b)
    43 #    define NLM_CAT4(a,b,c,d)   XNLM_CAT2(NLM_CAT(a,b),NLM_CAT(c,d))
    44 #  else
    45 #    define NLM_CAT(a,b)        a/**/b
    46 #    define NLM_CAT3(a,b,c)     a/**/b/**/c
    47 #    define NLM_CAT4(a,b,c,d)   a/**/b/**/c/**/d
    48 #  endif
    49 #endif
    50 
    5126/* If NLM_ARCH_SIZE is not defined, default to 32.  NLM_ARCH_SIZE is
    5227   optionally defined by the application. */
     
    5429#ifndef NLM_ARCH_SIZE
    5530#  define NLM_ARCH_SIZE                 32
     31#endif
     32
     33/* Due to horrible details of ANSI macro expansion, we can't use CONCAT4
     34   for NLM_NAME.  CONCAT2 is used in BFD_JUMP_TABLE macros, and some of
     35   them will expand to tokens that themselves are macros defined in terms
     36   of NLM_NAME.  If NLM_NAME were defined using CONCAT4 (which is itself
     37   defined in bfd-in.h using CONCAT2), ANSI preprocessor rules say that
     38   the CONCAT2 within NLM_NAME should not be expanded.
     39   So use another name.  */
     40#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
     41#ifdef SABER
     42#define NLM_CAT4(a,b,c,d) a##b##c##d
     43#else
     44/* This hack is to avoid a problem with some strict ANSI C preprocessors.
     45   The problem is, "32_" is not a valid preprocessing token, and we don't
     46   want extra underscores (e.g., "nlm_32_").  The NLM_XCAT2 macro will
     47   cause the inner CAT2 macros to be evaluated first, producing
     48   still-valid pp-tokens.  Then the final concatenation can be done.  */
     49#define NLM_CAT2(a,b)     a##b
     50#define NLM_XCAT2(a,b)    NLM_CAT2(a,b)
     51#define NLM_CAT4(a,b,c,d) NLM_XCAT2(NLM_CAT2(a,b),NLM_CAT2(c,d))
     52#endif
     53#else
     54#define NLM_CAT4(a,b,c,d) a/**/b/**/c/**/d
    5655#endif
    5756
Note: See TracChangeset for help on using the changeset viewer.