diff options
author | pfg <pfg@FreeBSD.org> | 2014-01-05 00:32:38 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2014-01-05 00:32:38 +0000 |
commit | c5e9a8143da358a2c480a64c9782d5eedda3b002 (patch) | |
tree | 41352df67b0bde40419570461e43784752e49325 /contrib/gcclibs/libcpp/directives.c | |
parent | 8da5238e28e25a3d2976ca05168766d942eaf703 (diff) | |
download | FreeBSD-src-c5e9a8143da358a2c480a64c9782d5eedda3b002.zip FreeBSD-src-c5e9a8143da358a2c480a64c9782d5eedda3b002.tar.gz |
libcpp: misc fixes from Apple's GCC.
Fixes some bugs detected by Apple:
#error with unmatched quotes
pragma mark
Obtained from: Apple GCC 4.2 - 5553
MFC after: 1 week
Diffstat (limited to 'contrib/gcclibs/libcpp/directives.c')
-rw-r--r-- | contrib/gcclibs/libcpp/directives.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/gcclibs/libcpp/directives.c b/contrib/gcclibs/libcpp/directives.c index 7011842..bf781b6 100644 --- a/contrib/gcclibs/libcpp/directives.c +++ b/contrib/gcclibs/libcpp/directives.c @@ -991,7 +991,11 @@ do_diagnostic (cpp_reader *pfile, int code, int print_dir) if (print_dir) fprintf (stderr, "#%s ", pfile->directive->name); pfile->state.prevent_expansion++; + /* APPLE LOCAL #error with unmatched quotes 5607574 */ + pfile->state.in_diagnostic++; cpp_output_line (pfile, stderr); + /* APPLE LOCAL #error with unmatched quotes 5607574 */ + pfile->state.in_diagnostic--; pfile->state.prevent_expansion--; } } @@ -1173,12 +1177,25 @@ cpp_register_deferred_pragma (cpp_reader *pfile, const char *space, } } +/* APPLE LOCAL begin pragma mark 5614511 */ +/* Handle #pragma mark. */ +static void +do_pragma_mark (cpp_reader *pfile) +{ + ++pfile->state.skipping; + skip_rest_of_line (pfile); + --pfile->state.skipping; +} +/* APPLE LOCAL end pragma mark 5614511 */ + /* Register the pragmas the preprocessor itself handles. */ void _cpp_init_internal_pragmas (cpp_reader *pfile) { /* Pragmas in the global namespace. */ register_pragma_internal (pfile, 0, "once", do_pragma_once); + /* APPLE LOCAL pragma mark 5614511 */ + register_pragma_internal (pfile, 0, "mark", do_pragma_mark); /* New GCC-specific pragmas should be put in the GCC namespace. */ register_pragma_internal (pfile, "GCC", "poison", do_pragma_poison); |