* support/cpp2/cpplib.c: reverted sdcpp special handling of _Pragma() directive
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 7 Dec 2006 18:24:45 +0000 (18:24 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 7 Dec 2006 18:24:45 +0000 (18:24 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4504 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
support/cpp2/cpplib.c

index a1c3a92a24a868cebc7a64d2403a1f69663a5342..2978b09fc419f35442dd41aabb121f48cde027d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-07 Borut Razem <borut.razem AT siol.net>
+
+       * support/cpp2/cpplib.c: reverted sdcpp special handling of _Pragma()
+         directive
+
 2006-12-06 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * src/SDCCsymt.c (addDecl): fixed bug 1609244
 
 2006-11-27 Borut Razem <borut.razem AT siol.net>
 
-       * 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 <borut.razem AT siol.net>
 
index 567147e4dc4da6a5e55de83c19754857a9b63f06..e903bca8c798e90062165d7dab1c2a2ab691dd54 100644 (file)
@@ -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");