From 1c7864f6d4380797b07c7149111066b61f69f689 Mon Sep 17 00:00:00 2001 From: tma Date: Tue, 4 Oct 2005 15:18:22 +0000 Subject: * Moved lcc and q3asm into code/tools git-svn-id: svn://svn.icculus.org/quake3/trunk@134 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/tools/lcc/cpp/unix.c | 116 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 code/tools/lcc/cpp/unix.c (limited to 'code/tools/lcc/cpp/unix.c') diff --git a/code/tools/lcc/cpp/unix.c b/code/tools/lcc/cpp/unix.c new file mode 100644 index 0000000..a845a60 --- /dev/null +++ b/code/tools/lcc/cpp/unix.c @@ -0,0 +1,116 @@ +#include +#include +#include +#include +#include "cpp.h" + +extern int getopt(int, char *const *, const char *); +extern char *optarg, rcsid[]; +extern int optind; +int verbose; +int Mflag; /* only print active include files */ +char *objname; /* "src.$O: " */ +int Cplusplus = 1; + +void +setup(int argc, char **argv) +{ + int c, fd, i; + char *fp, *dp; + Tokenrow tr; + extern void setup_kwtab(void); + + setup_kwtab(); + while ((c = getopt(argc, argv, "MNOVv+I:D:U:F:lg")) != -1) + switch (c) { + case 'N': + for (i=0; i=0; i--) { + if (includelist[i].file==NULL) { + includelist[i].always = 1; + includelist[i].file = optarg; + break; + } + } + if (i<0) + error(FATAL, "Too many -I directives"); + break; + case 'D': + case 'U': + setsource("", -1, optarg); + maketokenrow(3, &tr); + gettokens(&tr, 1); + doadefine(&tr, c); + unsetsource(); + break; + case 'M': + Mflag++; + break; + case 'v': + fprintf(stderr, "%s %s\n", argv[0], rcsid); + break; + case 'V': + verbose++; + break; + case '+': + Cplusplus++; + break; + default: + break; + } + dp = "."; + fp = ""; + fd = 0; + if (optind