the preprocessor command #warning is not standard.

use #pragma message WARN("xD") to make it work on gcc and msvc
This commit is contained in:
Rasmus Karlsson 2017-01-05 16:42:26 +01:00
parent e68f885dff
commit 7262c11458
5 changed files with 23 additions and 5 deletions

View file

@ -84,7 +84,10 @@ HEADERS += mainwindow.h \
message.h \
word.h \
link.h \
fonts.h
fonts.h \
common.h
PRECOMPILED_HEADER = common.h
FORMS += \
dialog.ui

15
common.h Normal file
View file

@ -0,0 +1,15 @@
#ifndef COMMON_H
#define COMMON_H
#define STRINGISE_IMPL(x) #x
#define STRINGISE(x) STRINGISE_IMPL(x)
// Use: #pragma message WARN("My message")
#if _MSC_VER
# define FILE_LINE_LINK __FILE__ "(" STRINGISE(__LINE__) ") : "
# define WARN(exp) (FILE_LINE_LINK "WARNING: " exp)
#else//__GNUC__ - may need other defines for different compilers
# define WARN(exp) ("WARNING: " exp)
#endif
#endif // COMMON_H

View file

@ -16,7 +16,7 @@ Emotes::Emotes()
LazyLoadedImage* Emotes::getCheerImage(long long amount, bool animated)
{
#warning "xD"
#pragma message WARN("Implement Emotes::getCheerImage")
// object image;
// if (cheer >= 100000)

View file

@ -208,7 +208,7 @@ void IrcManager::addIgnoredUser(QString const &username)
{
QString errorMessage;
if (!tryAddIgnoredUser(username, errorMessage)) {
#warning "xD"
#pragma message WARN("Implement IrcManager::addIgnoredUser")
}
}
@ -241,6 +241,6 @@ void IrcManager::removeIgnoredUser(QString const &username)
{
QString errorMessage;
if (!tryRemoveIgnoredUser(username, errorMessage)) {
#warning "xD"
#pragma message WARN("TODO: Implement IrcManager::removeIgnoredUser")
}
}

View file

@ -70,7 +70,7 @@ Message::Message(const IrcPrivateMessage& ircMessage, const Channel& Channel)
}
// highlights
#warning "xD"
#pragma message WARN("xD")
// color
QColor usernameColor = ColorScheme::getInstance().SystemMessageColor;