summaryrefslogtreecommitdiff
path: root/source/slang/slang-preprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-preprocessor.cpp')
-rw-r--r--source/slang/slang-preprocessor.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/slang/slang-preprocessor.cpp b/source/slang/slang-preprocessor.cpp
index bc78e4d31..7bee5afd2 100644
--- a/source/slang/slang-preprocessor.cpp
+++ b/source/slang/slang-preprocessor.cpp
@@ -1051,9 +1051,8 @@ static void MaybeBeginMacroExpansion(
// We need to escape to a string
newToken.type = TokenType::StringLiteral;
- buf.appendChar('"');
- StringUtil::appendEscaped(humaneSourceLoc.pathInfo.foundPath.getUnownedSlice(), buf);
- buf.appendChar('"');
+ auto escapeHandler = StringEscapeUtil::getHandler(StringEscapeUtil::Style::Cpp);
+ StringEscapeUtil::appendQuoted(escapeHandler, humaneSourceLoc.pathInfo.foundPath.getUnownedSlice(), buf);
}
// We are going to keep the actual text in the slice pool, so it stays in scope