~pac72/ubuntu/lucid/ddd/devel

« back to all changes in this revision

Viewing changes to include/symcat.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-07-22 03:49:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040722034937-cysl08t1jvba4jrx
Tags: 1:3.3.9-3
USERINFO has been renamed to USERINFO.txt; adjust debian/rules code
to match, to get correct information on the About DDD dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Symbol concatenation utilities.
2
2
 
3
 
   Copyright (C) 1998, Free Software Foundation, Inc.
 
3
   Copyright (C) 1998, 2000 Free Software Foundation, Inc.
4
4
 
5
5
   This program is free software; you can redistribute it and/or modify
6
6
   it under the terms of the GNU General Public License as published by
19
19
#ifndef SYM_CAT_H
20
20
#define SYM_CAT_H
21
21
 
22
 
#if defined (__STDC__) || defined (ALMOST_STDC)
 
22
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
23
23
#define CONCAT2(a,b)     a##b
24
24
#define CONCAT3(a,b,c)   a##b##c
25
25
#define CONCAT4(a,b,c,d) a##b##c##d
26
26
#define STRINGX(s) #s
27
27
#else
 
28
/* 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
 
30
   the two labels instead of concatenating them.  Instead, make sure to
 
31
   write CONCAT2(foo,bar).  */
28
32
#define CONCAT2(a,b)     a/**/b
29
33
#define CONCAT3(a,b,c)   a/**/b/**/c
30
34
#define CONCAT4(a,b,c,d) a/**/b/**/c/**/d
31
 
#define STRINGX(s) "?"
 
35
#define STRINGX(s) "s"
32
36
#endif
33
37
 
34
38
#define XCONCAT2(a,b)     CONCAT2(a,b)
35
39
#define XCONCAT3(a,b,c)   CONCAT3(a,b,c)
36
40
#define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d)
37
41
 
 
42
/* Note the layer of indirection here is typically used to allow
 
43
   stringification of the expansion of macros.  I.e. "#define foo
 
44
   bar", "XSTRING(foo)", to yield "bar".  Be aware that this only
 
45
   works for __STDC__, not for traditional C which will still resolve
 
46
   to "foo".  */
38
47
#define XSTRING(s) STRINGX(s) 
39
48
 
40
 
#endif SYM_CAT_H
 
49
#endif /* SYM_CAT_H */