Fixed MSVC2010 compilation issues

This commit is contained in:
Alex Zolotarev 2011-05-22 16:55:16 +02:00 committed by Alex Zolotarev
parent 93219f070f
commit d05a95d469
8 changed files with 23 additions and 9 deletions

View file

@ -18,7 +18,7 @@ SOURCES += \
src/gflags_completions.cc \
src/gflags_reporting.cc
win32-msvc2008 {
win32-msvc* {
SOURCES += src/windows/port.cc
}

View file

@ -48,7 +48,7 @@ QT -= core gui
CONFIG += warn_on
# Libraries' dependencies hack.
win32-msvc2008|symbian {
win32-msvc*|symbian {
LIB_EXT = .lib
LIB_PREFIX =
}
@ -74,7 +74,7 @@ win32 {
}
# Windows-specific options for all projects
win32-msvc2008 {
win32-msvc* {
QMAKE_CLEAN += *.user
DEFINES += _SCL_SECURE_NO_WARNINGS _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS NOMINMAX NO_MIN_MAX
QMAKE_CXXFLAGS += -wd4100 -Zi
@ -89,13 +89,17 @@ win32-msvc2008 {
QMAKE_LFLAGS_RELEASE += /MACHINE:X86
}
win32-msvc2010 {
DEFINES += _HAS_CPP0X=0 # disable tr1 and c++0x features to avoid build errors
}
unix|win32-g++ {
QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-compare -Wno-strict-aliasing
# experimental
QMAKE_CFLAGS_RELEASE -= -O2
QMAKE_CFLAGS_RELEASE += -O3
QMAKE_CXXFLAGS_RELEASE -= -O2
QMAKE_CXXFLAGS_RELEASE += -O3
QMAKE_CXXFLAGS_RELEASE += -O3
QMAKE_CFLAGS_RELEASE *= -ffast-math
QMAKE_CXXFLAGS_RELEASE *= -ffast-math
}

View file

@ -14,7 +14,7 @@ win32 {
LIBS += -lopengl32 -lws2_32 -lshell32 -liphlpapi
RC_FILE = res/windows.rc
}
win32-msvc2008 {
win32-msvc* {
LIBS += -lwlanapi
}

View file

@ -6,7 +6,7 @@
#undef new
#endif
#ifdef _MSC_VER
#if defined(_MSC_VER) && _MSC_VER < 1600 // in VS2010 types below are defined
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;

View file

@ -5,6 +5,11 @@
#undef new
#endif
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
// to avoid compilation errors on VS2010
#define BOOST_NO_0X_HDR_TYPEINDEX
#endif
#include <boost/unordered_map.hpp>
using boost::unordered_map;
using boost::unordered_multimap;

View file

@ -5,6 +5,11 @@
#undef new
#endif
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
// to avoid compilation errors on VS2010
#define BOOST_NO_0X_HDR_TYPEINDEX
#endif
#include <boost/unordered_set.hpp>
using boost::unordered_set;

View file

@ -63,7 +63,7 @@ namespace yg
TChars m_chars;
mutable pair<ResourceStyle *, ResourceStyle *> m_invalidChar;
FontInfo() : m_invalidChar(0, 0){}
FontInfo() : m_invalidChar(static_cast<ResourceStyle *>(0), static_cast<ResourceStyle *>(0)) {}
ResourceStyle * fromID(uint32_t id, bool isMask = false) const;
};

View file

@ -17,7 +17,7 @@
#include "../3party/fribidi/lib/fribidi-deprecated.h"
#include "../base/logging.hpp"
#include "../base/start_mem_debug.hpp"
#include "../base/stl_add.hpp"
namespace yg
@ -188,7 +188,7 @@ namespace yg
{
ASSERT(m_useTextTree, ());
vector<TextObj> texts;
m_tree.ForEach(bind(&vector<TextObj>::push_back, ref(texts), _1));
m_tree.ForEach(MakeBackInsertFunctor(texts));
m_tree.Clear();
for (vector<TextObj>::iterator it = texts.begin(); it != texts.end(); ++it)
{