Skip to content

Commit 299a43f

Browse files
committed
issue doxygen#12009 Doctest/Catch2, requirements links and layout
In the preprocessor the standard defined macros are not expanded by doxygen, resulting in names like `DOCTEST_ANON_FUNC___LINE__()` . The standard macro `__LINE__` will now be expanded in the doxygen preprocessor.
1 parent 9d5b9fc commit 299a43f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/pre.l

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3078,7 +3078,13 @@ static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,in
30783078
bool replaced=FALSE;
30793079
macroName=expr.mid(p,l);
30803080
//printf(" p=%d macroName=%s\n",p,qPrint(macroName));
3081-
if (p<2 || !(expr.at(p-2)=='@' && expr.at(p-1)=='-')) // no-rescan marker?
3081+
if (macroName == "__LINE__")
3082+
{
3083+
QCString resultExpr = QCString().setNum(yyextra->yyLineNr);
3084+
QCString restExpr=expr.right(expr.length()-8-p);
3085+
expr=expr.left(p)+resultExpr+restExpr;
3086+
}
3087+
else if (p<2 || !(expr.at(p-2)=='@' && expr.at(p-1)=='-')) // no-rescan marker?
30823088
{
30833089
if (state->expandedDict.find(macroName.str())==state->expandedDict.end()) // expand macro
30843090
{

0 commit comments

Comments
 (0)