Commit 49df5f37 by Richard Stallman

(main): Handle -U before -D (and -A).

(rescan): If traditional, recognize # only at bol.

(main) [VMS]: Use .obj, not .o, in dependencies output.

(do_include): Delete unreachable goto after '"' case.

(do_xifdef): Skip all kinds of whitespace, in bof test.

From-SVN: r2333
parent 7a0347ff
......@@ -1447,6 +1447,14 @@ main (argc, argv)
/* Now handle the command line options. */
/* Do undefines specified with -U. */
for (i = 1; i < argc; i++)
if (pend_undefs[i]) {
if (debug_output)
output_line_command (fp, &outbuf, 0, same_file);
make_undef (pend_undefs[i], &outbuf);
}
/* Do assertions specified with -A. */
for (i = 1; i < argc; i++)
if (pend_assertions[i])
......@@ -1460,14 +1468,6 @@ main (argc, argv)
make_definition (pend_defs[i], &outbuf);
}
/* Do undefines specified with -U. */
for (i = 1; i < argc; i++)
if (pend_undefs[i]) {
if (debug_output)
output_line_command (fp, &outbuf, 0, same_file);
make_undef (pend_undefs[i], &outbuf);
}
done_initializing = 1;
{ /* read the appropriate environment variable and if it exists
......@@ -1697,7 +1697,11 @@ main (argc, argv)
else
deps_output (p, 0);
/* Supply our own suffix. */
#ifndef VMS
deps_output (".o : ", 0);
#else
deps_output (".obj : ", 0);
#endif
deps_output (in_fname, 0);
deps_output (" ", 0);
}
......@@ -2270,6 +2274,8 @@ do { ip = &instack[indepth]; \
and backslash-newlines, and see if we reach this #.
If not, this # is not special. */
bp = beg_of_line;
/* If -traditional, require # to be at beginning of line. */
if (!traditional)
while (1) {
if (is_hor_space[*bp])
bp++;
......@@ -3735,7 +3741,6 @@ get_filename:
}
break;
}
goto fail;
case '<':
fend = fbeg;
......@@ -6082,22 +6087,16 @@ do_xifdef (buf, limit, op, keyword)
U_CHAR *p = ip->buf;
while (p != directive_start) {
char c = *p++;
switch (c) {
case ' ':
case '\t':
case '\n':
break;
case '/':
if (p != ip->bufp && *p == '*') {
if (is_space[c])
;
else if (c == '/' && p != ip->bufp && *p == '*') {
/* Skip this comment. */
int junk;
U_CHAR *save_bufp = ip->bufp;
ip->bufp = p + 1;
p = skip_to_end_of_comment (ip, &junk, 1);
ip->bufp = save_bufp;
}
break;
default:
} else {
goto fail;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment