From c2fb64201b75b6af7ddae9a3e6409a8fc0e46343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 22 Jul 2026 21:46:00 -0700 Subject: [PATCH] fcpp: Fixed expansion for ## operands, and enable FPPTAG_RIGHTCONCAT. Closes #3629." (#3842) --- 3rdparty/fcpp/cpp4.c | 4 ++-- 3rdparty/fcpp/cpp6.c | 10 +++++----- tools/shaderc/shaderc.cpp | 4 ++++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/3rdparty/fcpp/cpp4.c b/3rdparty/fcpp/cpp4.c index a3257b3e9..1d0caaa02 100644 --- a/3rdparty/fcpp/cpp4.c +++ b/3rdparty/fcpp/cpp4.c @@ -144,8 +144,8 @@ ReturnCode fpp_dodefine(struct Global *global) } while (global->workp > global->work && type[(unsigned)*(global->workp - 1)] == SPA) --global->workp; /* Erase leading spaces */ -// if ((ret=save(global, TOK_SEP))) /* Stuff a delimiter */ -// return(ret); + if ((ret=fpp_save(global, TOK_SEP))) /* Stuff a delimiter */ + return(ret); c = fpp_skipws(global); /* Eat whitespace */ continue; } diff --git a/3rdparty/fcpp/cpp6.c b/3rdparty/fcpp/cpp6.c index bb1de15b8..3473c7bc3 100644 --- a/3rdparty/fcpp/cpp6.c +++ b/3rdparty/fcpp/cpp6.c @@ -225,13 +225,13 @@ int fpp_catenate(struct Global *global, int lhs_number, ReturnCode *ret) } c= fpp_get(global); if(global->rightconcat) { - *ret=fpp_macroid(global, &c); /* Scan next token */ + *ret=fpp_macroid(global, &c); /* Scan and expand next token */ if(*ret) return(FPP_FALSE); - } /* BK - BUG? Parses token into global->tokenbuf but never uses it. - else - fpp_lookid(global, c); - */ + } + else if(type[c] == LET) { + fpp_lookid(global, c); /* Scan next token into tokenbuf */ + } switch(type[c]) { /* What was it? */ case LET: /* An identifier, ... */ if ((int)strlen(token1) + (int)strlen(global->tokenbuf) >= NWORK) { diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index e59708d48..51da8047b 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -916,6 +916,10 @@ namespace bgfx m_tagptr->data = (void*)0; m_tagptr++; + m_tagptr->tag = FPPTAG_RIGHTCONCAT; + m_tagptr->data = (void*)1; + m_tagptr++; + m_tagptr->tag = FPPTAG_INPUT_NAME; m_tagptr->data = scratch(_filePath); m_tagptr++;