diff options
-rw-r--r-- | 0037-Fix-include-after-macro-expansion.patch | 85 | ||||
-rw-r--r-- | PKGBUILD | 4 |
2 files changed, 42 insertions, 47 deletions
diff --git a/0037-Fix-include-after-macro-expansion.patch b/0037-Fix-include-after-macro-expansion.patch index 634e7125baae..0e446cbfe6ee 100644 --- a/0037-Fix-include-after-macro-expansion.patch +++ b/0037-Fix-include-after-macro-expansion.patch @@ -1,66 +1,61 @@ -From: litvin <litvindev@gmail.com> -Date: Tue Oct 31 02:40:58 AM CET 2023 +From: Sergei Litvin <litvindev@gmail.com> +Date: Fri Nov 3 12:32:28 AM CET 2023 Subject: Fix include <> after macro expansion -*** a/src/yylex.c 2023-10-31 01:29:58.294785838 +0100 ---- b/src/yylex.c 2023-10-31 01:26:40.821234607 +0100 + +*** a/src/yylex.c 2023-11-03 00:28:16.546067621 +0100 +--- b/src/yylex.c 2023-11-02 23:33:53.413480826 +0100 *************** -*** 558,567 **** - static void processInclude(S_position *ipos, int nextFlag) { - FILE *nyyin; - char *fname; -! char *ccc, *cc, *cc2; -- char nn[MAX_FILE_NAME_SIZE]; - int lex,l,h,v,len; - S_position pos; - GetLexA(lex, cc2); - ccc = cInput.cc; - if (lex == STRING_LITERAL) { ---- 558,566 ---- - static void processInclude(S_position *ipos, int nextFlag) { +*** 559,564 **** +--- 559,565 ---- FILE *nyyin; char *fname; -! char *ccc, *cc2; + char *ccc, *cc2; ++ char fn[MAX_FILE_NAME_SIZE]; int lex,l,h,v,len; S_position pos; GetLexA(lex, cc2); - ccc = cInput.cc; - if (lex == STRING_LITERAL) { *************** -*** 581,605 **** - macStacki = 0; +*** 576,589 **** + cInput.cc = cc2; /* unget lexem */ + lex = yylex(); + if (lex == STRING_LITERAL) { +! cInput = macStack[0]; // hack, cut everything pending +! macStacki = 0; processInclude2(ipos, '\"', yytext, nextFlag); } else if (lex == '<') { -! cc = nn; -! sprintf(cc, "Include <> after macro expansion: "); -! cc += strlen(cc); -! ccc = cc; -! lex = yylex(); -! while (lex != '>' && lex != '\n' && lex != 0) { -! strcpy(cc, yytext); -! cc += strlen(cc); -! lex = yylex(); -! } -! if (s_opt.xref2) { -! ppcGenRecord(PPC_INFORMATION, nn, "\n"); -! } else { -! fprintf(dumpOut,"'%s'\n", nn); -! } -! if (ccc != cc) { -! processInclude2(ipos, '<', ccc, nextFlag); -! } +! // TODO!!!! +! warning(ERR_ST,"Include <> after macro expansion not yet implemented, sorry\n\tuse \"\" instead"); } +- //do lex = yylex(); while (lex != '\n'); } return; endOfMacArg: assert(0); ---- 580,589 ---- - macStacki = 0; +--- 577,603 ---- + cInput.cc = cc2; /* unget lexem */ + lex = yylex(); + if (lex == STRING_LITERAL) { +! if (macStacki != 0) { +! cInput = macStack[0]; // hack, cut everything pending +! macStacki = 0; +! } processInclude2(ipos, '\"', yytext, nextFlag); } else if (lex == '<') { -! // TODO!!!! -! warning(ERR_ST,"Include <> after macro expansion not yet implemented, sorry\n\tuse \"\" instead"); +! ccc = fn; +! lex = yylex(); +! while (lex != '>' && lex != '\n' && lex != 0) { +! strcpy(ccc, yytext); +! ccc += strlen(ccc); +! lex = yylex(); +! } +! if (ccc != fn) { +! if (macStacki != 0) { +! cInput = macStack[0]; // hack, cut everything pending +! macStacki = 0; +! } +! processInclude2(ipos, '<', fn, nextFlag); +! } } -+ //do lex = yylex(); while (lex != '\n'); } return; endOfMacArg: assert(0); @@ -74,7 +74,7 @@ md5sums=('63e10baa9a5dfce9165570e7c3897701' '633789164b37a833579fb23b1b16c5f1' 'ff4ac43651958f8e5f61f19858a87aa7' 'c84a7d60425c8210c7767c3df99e6d52' - '3bf3cf2ec5b1dd31cd6adce7dd3b18d0') + '602734cd3b425e3fbec646eab6804aed') prepare() { cd "$srcdir/xref-any" @@ -109,7 +109,7 @@ prepare() { patch --verbose -p1 -i "$srcdir/0034-Fix-Makefile.common.patch" patch --verbose -p1 -i "$srcdir/0035-Fix-clash-with-library-names.patch" patch --verbose -p1 -i "$srcdir/0036-Fix-Elisp-obsolete-functions-2.patch" - patch --verbose -R -p1 -i "$srcdir/0037-Fix-include-after-macro-expansion.patch" + patch --verbose -p1 -i "$srcdir/0037-Fix-include-after-macro-expansion.patch" cd "$srcdir/xref-any/doc" cat "INSTALL" "readme" "readme2" > README } |