don't use macros for the Latin1* magic

use typedefs and an inline function instead. that's namespace-safe and
does not produce unhelpful messages when closing parens are missing.
This commit is contained in:
Oswald Buddenhagen
2009-05-04 18:20:57 +02:00
parent 5ac81459fa
commit 6823cecba5

View File

@@ -92,16 +92,9 @@ Q_DECLARE_METATYPE(Debugger::Internal::GdbMi);
#define STRINGIFY_INTERNAL(x) #x
#define STRINGIFY(x) STRINGIFY_INTERNAL(x)
struct _c
{
inline _c(char c) : m_c(c) {}
inline operator QChar() const { return QLatin1Char(m_c); }
char m_c;
};
#define _c(c) QLatin1Char(c)
#define __(s) QLatin1String(s)
#define _(s) QString::fromLatin1(s)
typedef QLatin1Char _c;
typedef QLatin1String __;
static inline QString _(const char *s) { return QString::fromLatin1(s); }
static const QString tooltipIName = _("tooltip");