diff options
| author | cvs2svn <cvs2svn@FreeBSD.org> | 1994-11-21 07:33:22 +0000 |
|---|---|---|
| committer | cvs2svn <cvs2svn@FreeBSD.org> | 1994-11-21 07:33:22 +0000 |
| commit | 01233029edba45b14c75afe36248d0df998b3cc3 (patch) | |
| tree | e3246a9664c2bcea9329b550600f6612589b3cd0 /gnu/usr.bin/cc/cpp | |
| parent | c264e2c65c3f4fe911fa70df828625a6b19c6d84 (diff) | |
Notes
Diffstat (limited to 'gnu/usr.bin/cc/cpp')
| -rw-r--r-- | gnu/usr.bin/cc/cpp/Makefile | 5 | ||||
| -rw-r--r-- | gnu/usr.bin/cc/cpp/cccp.c | 52 |
2 files changed, 32 insertions, 25 deletions
diff --git a/gnu/usr.bin/cc/cpp/Makefile b/gnu/usr.bin/cc/cpp/Makefile index 0bbc198d9d31..43ec78c3a49f 100644 --- a/gnu/usr.bin/cc/cpp/Makefile +++ b/gnu/usr.bin/cc/cpp/Makefile @@ -2,9 +2,10 @@ # $Id$ # -.PATH: ${.CURDIR}/../cc_int PROG = cpp -SRCS = cccp.c cexp.c obstack.c version.c +SRCS = cccp.c cexp.c BINDIR= /usr/libexec +.PATH: ${.CURDIR}/../cc_int +SRCS+= obstack.c version.c .include <bsd.prog.mk> diff --git a/gnu/usr.bin/cc/cpp/cccp.c b/gnu/usr.bin/cc/cpp/cccp.c index d5144669ddae..609249ba63b7 100644 --- a/gnu/usr.bin/cc/cpp/cccp.c +++ b/gnu/usr.bin/cc/cpp/cccp.c @@ -604,14 +604,14 @@ static struct default_include { automatically in Makefile.in. */ { CROSS_INCLUDE_DIR, 0, 0 }, /* This is another place that the target system's headers might be. */ - { TOOL_INCLUDE_DIR, 0, 1 }, + { TOOL_INCLUDE_DIR, 0, 0 }, #else /* not CROSS_COMPILE */ /* This should be /usr/local/include and should come before the fixincludes-fixed header files. */ { LOCAL_INCLUDE_DIR, 0, 1 }, /* This is here ahead of GCC_INCLUDE_DIR because assert.h goes here. Likewise, behind LOCAL_INCLUDE_DIR, where glibc puts its assert.h. */ - { TOOL_INCLUDE_DIR, 0, 1 }, + { TOOL_INCLUDE_DIR, 0, 0 }, /* This is the dir for fixincludes. Put it just before the files that we fix. */ { GCC_INCLUDE_DIR, 0, 0 }, @@ -3275,10 +3275,10 @@ startagain: /* This is now known to be a macro call. Discard the macro name from the output, along with any following whitespace just copied, - but preserve newlines at the top level since this + but preserve newlines if not outputting marks since this is more likely to do the right thing with line numbers. */ obp = op->buf + obufp_before_macroname; - if (ip->macro != 0) + if (output_marks) op->lineno = op_lineno_before_macroname; else { int newlines = op->lineno - op_lineno_before_macroname; @@ -9031,16 +9031,18 @@ dump_single_macro (hp, of) concat = 0; for (ap = defn->pattern; ap != NULL; ap = ap->next) { dump_defn_1 (defn->expansion, offset, ap->nchars, of); - if (ap->nchars != 0) - concat = 0; offset += ap->nchars; - if (ap->stringify) - fprintf (of, " #"); - if (ap->raw_before && !concat) - fprintf (of, " ## "); - concat = 0; + if (!traditional) { + if (ap->nchars != 0) + concat = 0; + if (ap->stringify) + fprintf (of, " #"); + if (ap->raw_before && !concat) + fprintf (of, " ## "); + concat = 0; + } dump_arg_n (defn, ap->argno, of); - if (ap->raw_after) { + if (!traditional && ap->raw_after) { fprintf (of, " ## "); concat = 1; } @@ -9069,7 +9071,7 @@ dump_all_macros () /* Output to OF a substring of a macro definition. BASE is the beginning of the definition. Output characters START thru LENGTH. - Discard newlines outside of strings, thus + Unless traditional, discard newlines outside of strings, thus converting funny-space markers to ordinary spaces. */ static void @@ -9082,16 +9084,20 @@ dump_defn_1 (base, start, length, of) U_CHAR *p = base + start; U_CHAR *limit = base + start + length; - while (p < limit) { - if (*p == '\"' || *p =='\'') { - U_CHAR *p1 = skip_quoted_string (p, limit, 0, NULL_PTR, - NULL_PTR, NULL_PTR); - fwrite (p, p1 - p, 1, of); - p = p1; - } else { - if (*p != '\n') - putc (*p, of); - p++; + if (traditional) + fwrite (p, sizeof (*p), length, of); + else { + while (p < limit) { + if (*p == '\"' || *p =='\'') { + U_CHAR *p1 = skip_quoted_string (p, limit, 0, NULL_PTR, + NULL_PTR, NULL_PTR); + fwrite (p, sizeof (*p), p1 - p, of); + p = p1; + } else { + if (*p != '\n') + putc (*p, of); + p++; + } } } } |
