Advertisement
Guest User

bug fix? or something lost?

a guest
Sep 10th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.73 KB | None | 0 0
  1. diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp
  2. index 0f678ad..541409e 100644
  3. --- a/src/libs/cplusplus/pp-engine.cpp
  4. +++ b/src/libs/cplusplus/pp-engine.cpp
  5. @@ -916,29 +916,7 @@ bool Preprocessor::handleIdentifier(PPToken *tk)
  6.      if (macroNameRef.size() == 8
  7.              && macroNameRef[0] == '_'
  8.              && macroNameRef[1] == '_') {
  9. -        PPToken newTk;
  10. -        if (macroNameRef == ppLine) {
  11. -            QByteArray txt = QByteArray::number(tk->lineno);
  12. -            newTk = generateToken(T_STRING_LITERAL, txt.constData(), txt.size(), tk->lineno, false);
  13. -        } else if (macroNameRef == ppFile) {
  14. -            QByteArray txt;
  15. -            txt.append('"');
  16. -            txt.append(m_env->currentFileUtf8);
  17. -            txt.append('"');
  18. -            newTk = generateToken(T_STRING_LITERAL, txt.constData(), txt.size(), tk->lineno, false);
  19. -        } else if (macroNameRef == ppDate) {
  20. -            QByteArray txt;
  21. -            txt.append('"');
  22. -            txt.append(QDate::currentDate().toString().toUtf8());
  23. -            txt.append('"');
  24. -            newTk = generateToken(T_STRING_LITERAL, txt.constData(), txt.size(), tk->lineno, false);
  25. -        } else if (macroNameRef == ppTime) {
  26. -            QByteArray txt;
  27. -            txt.append('"');
  28. -            txt.append(QTime::currentTime().toString().toUtf8());
  29. -            txt.append('"');
  30. -            newTk = generateToken(T_STRING_LITERAL, txt.constData(), txt.size(), tk->lineno, false);
  31. -        }
  32. +        PPToken newTk = generateToken(T_STRING_LITERAL, macroNameRef.toByteArray().constData(), macroNameRef.toByteArray().size(), tk->lineno, false);
  33.  
  34.          if (newTk.hasSource()) {
  35.              newTk.f.newline = tk->newline();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement