From: borutr Date: Thu, 7 Dec 2006 18:24:45 +0000 (+0000) Subject: * support/cpp2/cpplib.c: reverted sdcpp special handling of _Pragma() directive X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=101a547ed059a3892fb0ef143ec7f47b9bccffe0;p=fw%2Fsdcc * support/cpp2/cpplib.c: reverted sdcpp special handling of _Pragma() directive git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4504 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index a1c3a92a..2978b09f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-12-07 Borut Razem + + * support/cpp2/cpplib.c: reverted sdcpp special handling of _Pragma() + directive + 2006-12-06 Maarten Brock * src/SDCCsymt.c (addDecl): fixed bug 1609244 @@ -86,25 +91,25 @@ 2006-11-27 Borut Razem - * support\cpp2\cppexp.c, support\cpp2\hashtable.h, - support\cpp2\Makefile.in, support\cpp2\cppfiles.c, - support\cpp2\output.h, support\cpp2\cppinit.c, - support\cpp2\cpplib.c, support\cpp2\cpplib.h, - support\cpp2\Makefile.bcc, support\cpp2\cpphash.c, - support\cpp2\cppdefault.c, support\cpp2\system.h, - support\cpp2\cpphash.h, support\cpp2\cpplex.c, - support\cpp2\cppdefault.h, support\cpp2\mbchar.c, - support\cpp2\prefix.c, support\cpp2\except.h, - support\cpp2\hwint.h, support\cpp2\cppmacro.c, - support\cpp2\line-map.h, support\cpp2\sdcpp.dsp, - support\cpp2\sdcc.h, support\cpp2\mkdeps.c, - support\cpp2\version.c, support\cpp2\cppmain.c, - support\cpp2\version.h, support\cpp2\hashtable.c, - support\cpp2\cpperror.c: + * support/cpp2/cppexp.c, support/cpp2/hashtable.h, + support/cpp2/Makefile.in, support/cpp2/cppfiles.c, + support/cpp2/output.h, support/cpp2/cppinit.c, + support/cpp2/cpplib.c, support/cpp2/cpplib.h, + support/cpp2/Makefile.bcc, support/cpp2/cpphash.c, + support/cpp2/cppdefault.c, support/cpp2/system.h, + support/cpp2/cpphash.h, support/cpp2/cpplex.c, + support/cpp2/cppdefault.h, support/cpp2/mbchar.c, + support/cpp2/prefix.c, support/cpp2/except.h, + support/cpp2/hwint.h, support/cpp2/cppmacro.c, + support/cpp2/line-map.h, support/cpp2/sdcpp.dsp, + support/cpp2/sdcc.h, support/cpp2/mkdeps.c, + support/cpp2/version.c, support/cpp2/cppmain.c, + support/cpp2/version.h, support/cpp2/hashtable.c, + support/cpp2/cpperror.c: synchronized with GCC CPP release version 3.3.6, the latest where cppmain.c still exists. - * support\cpp2\cpptrad.c, support\cpp2\sdcppmain.c, - support\cpp2\sdcppinit.c: added + * support/cpp2/cpptrad.c, support/cpp2/sdcppmain.c, + support/cpp2/sdcppinit.c: added 2006-11-27 Borut Razem diff --git a/support/cpp2/cpplib.c b/support/cpp2/cpplib.c index 567147e4..e903bca8 100644 --- a/support/cpp2/cpplib.c +++ b/support/cpp2/cpplib.c @@ -128,7 +128,6 @@ static void do_pragma_dependency PARAMS ((cpp_reader *)); static void do_linemarker PARAMS ((cpp_reader *)); static const cpp_token *get_token_no_padding PARAMS ((cpp_reader *)); static const cpp_token *get__Pragma_string PARAMS ((cpp_reader *)); -static unsigned char *destringize PARAMS ((const cpp_string *, unsigned int *)); static void destringize_and_run PARAMS ((cpp_reader *, const cpp_string *)); static int parse_answer PARAMS ((cpp_reader *, struct answer **, int)); static cpp_hashnode *parse_assertion PARAMS ((cpp_reader *, struct answer **, @@ -1189,6 +1188,8 @@ do_pragma_poison (pfile) pfile->state.poisoned_ok = 0; } +/* SDCC specific + sdcc_hash pragma */ static void do_pragma_sdcc_hash (pfile) cpp_reader *pfile; @@ -1320,29 +1321,6 @@ get__Pragma_string (pfile) return string; } -/* Returns a malloced buffer containing a destringized cpp_string by - removing the first \ of \" and \\ sequences. */ -static unsigned char * -destringize (in, len) - const cpp_string *in; - unsigned int *len; -{ - const unsigned char *src, *limit; - unsigned char *dest, *result; - - dest = result = (unsigned char *) xmalloc (in->len); - for (src = in->text, limit = src + in->len; src < limit;) - { - /* We know there is a character following the backslash. */ - if (*src == '\\' && (src[1] == '\\' || src[1] == '"')) - src++; - *dest++ = *src++; - } - - *len = dest - result; - return result; -} - /* Destringize IN into a temporary buffer, by removing the first \ of \" and \\ sequences, and process the result as a #pragma directive. */ static void @@ -1412,16 +1390,7 @@ _cpp_do__Pragma (pfile) const cpp_token *string = get__Pragma_string (pfile); if (string) - { - unsigned int len; - - unsigned char *buffer = destringize (&string->val.str, &len); - buffer[len] = 0; - fputs ("\n#pragma ", pfile->print.outf); - fputs (buffer, pfile->print.outf); - putc ('\n', pfile->print.outf); - free ((PTR) buffer); - } + destringize_and_run (pfile, &string->val.str); else cpp_error (pfile, DL_ERROR, "_Pragma takes a parenthesized string literal");