diff options
author | YamaArashi <shadow962@live.com> | 2016-05-27 15:08:48 -0700 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-05-30 02:19:25 -0700 |
commit | 0ebfe95d65fc2852a6b7f0528a2a114de7fe698e (patch) | |
tree | a20b2e0e839661df88664d6547841a3a79e07222 /tools/preproc/c_file.cpp | |
parent | 1d8ca2c1b995be87bb78dcf9bdfdc1d924a48979 (diff) |
text.c
Diffstat (limited to 'tools/preproc/c_file.cpp')
-rw-r--r-- | tools/preproc/c_file.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/preproc/c_file.cpp b/tools/preproc/c_file.cpp index 1e4dea359..aed53d44b 100644 --- a/tools/preproc/c_file.cpp +++ b/tools/preproc/c_file.cpp @@ -73,6 +73,7 @@ CFile::~CFile() void CFile::Preproc() { bool inConcatMode = false; + bool noTerminator = false; char stringChar = 0; while (m_pos < m_size) @@ -100,10 +101,13 @@ void CFile::Preproc() else { if (inConcatMode ? m_buffer[m_pos] == '"' - : m_buffer[m_pos] == '_' && m_buffer[m_pos + 1] == '"') + : (m_buffer[m_pos] == '_' || m_buffer[m_pos] == '@') && m_buffer[m_pos + 1] == '"') { if (!inConcatMode) - m_pos++; // skip past underscore + { + noTerminator = (m_buffer[m_pos] == '@'); + m_pos++; // skip past underscore or at-sign + } unsigned char s[kMaxStringLength]; int length; @@ -144,7 +148,11 @@ void CFile::Preproc() if ((c != ' ' && c != '\t' && c != '\n') && inConcatMode) { - std::printf("0xFF }"); + if (noTerminator) + std::printf(" }"); + else + std::printf("0xFF }"); + inConcatMode = false; } |