source: trunk/src/emx/include/symcat.h@ 1064

Last change on this file since 1064 was 123, checked in by zap, 22 years ago

Started the work for re-designing the EMX C runtime library to not require
EMX.DLL. The new design is projected to be as follows:

  • all emx syscalls are replaced with the routines from the old sys.lib library which is now compilable in both a.out and OMF formats.
  • the sys.a library should be made replaceable and selectable by some gcc switch (e.g. -msyslib=emx would link with emx.a instead of sys.a which would give almost full backward compatibility with emx).
  • All C functions names were renamed to not contain the starting underscore (e.g. fopen and not _fopen). The underscored aliases will be added later with the c_alias library (which will be generated automatically from all public symbols of libc; any exported symbol that do not start with an underscore will be given an underscored alias unless such a symbol is already defined).

Also a lot of updates to the building system. It is now much faster (thanks
to Knut's suggestion of using ash's builtin echo).
Also re-wrote thunk1.asm and thunk2.asm to GAS format; this removes the need
for MASM and makes it possible to use 16-bit functions in a.out programs
without the need for EMX.DLL.
Also made a lot of small changes I don't remember now.

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.9 KB
Line 
1/* Symbol concatenation utilities.
2
3 Copyright (C) 1998, 2000 Free Software Foundation, Inc.
4
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
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18
19#ifndef SYM_CAT_H
20#define SYM_CAT_H
21
22#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
23#define CONCAT2(a,b) a##b
24#define CONCAT3(a,b,c) a##b##c
25#define CONCAT4(a,b,c,d) a##b##c##d
26#define STRINGX(s) #s
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). */
32#define CONCAT2(a,b) a/**/b
33#define CONCAT3(a,b,c) a/**/b/**/c
34#define CONCAT4(a,b,c,d) a/**/b/**/c/**/d
35#define STRINGX(s) "s"
36#endif
37
38#define XCONCAT2(a,b) CONCAT2(a,b)
39#define XCONCAT3(a,b,c) CONCAT3(a,b,c)
40#define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d)
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". */
47#define XSTRING(s) STRINGX(s)
48
49#endif /* SYM_CAT_H */
Note: See TracBrowser for help on using the repository browser.