Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Zolotarev <alex@mapswithme.com>2014-08-06 00:31:02 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:23:42 +0300
commita43d4251fd32b88569884ca41d4ba22e3de8b045 (patch)
treef93e85a40fa718a54b5fe58e5bfef7110b237048
parent63c2234ba46f95020f158a440dc675c8b6e16c0a (diff)
Base libraries C++11 sources compatibility
-rw-r--r--3party/boost/boost/gil/channel_algorithm.hpp2
-rw-r--r--3party/gflags/src/gflags.cc6
-rw-r--r--3party/protobuf/config.h18
-rw-r--r--coding/file_container.cpp8
-rw-r--r--common.pri9
-rw-r--r--drape/drape_tests/batcher_tests.cpp18
-rw-r--r--drape/drape_tests/pointers_tests.cpp2
-rw-r--r--drape_frontend/area_shape.cpp11
-rw-r--r--drape_frontend/poi_symbol_shape.cpp4
-rw-r--r--drape_frontend/poi_symbol_shape.hpp4
-rw-r--r--generator/tesselator.cpp5
-rw-r--r--generator/update_generator.cpp2
-rw-r--r--graphics/glyph_cache_impl.cpp22
-rw-r--r--graphics/overlay.cpp9
-rw-r--r--graphics/pipeline_manager.cpp13
-rw-r--r--gui/controller.cpp2
-rw-r--r--indexer/drawing_rules.cpp2
-rw-r--r--map/navigator.cpp8
-rw-r--r--map/pin_click_manager.cpp4
-rw-r--r--map/pin_click_manager.hpp6
-rw-r--r--search/search_query.cpp2
-rw-r--r--std/bind.hpp16
-rw-r--r--std/function.hpp13
-rw-r--r--std/target_os.hpp5
24 files changed, 135 insertions, 56 deletions
diff --git a/3party/boost/boost/gil/channel_algorithm.hpp b/3party/boost/boost/gil/channel_algorithm.hpp
index 1361219a33..957dd52951 100644
--- a/3party/boost/boost/gil/channel_algorithm.hpp
+++ b/3party/boost/boost/gil/channel_algorithm.hpp
@@ -51,7 +51,7 @@ template <typename SrcChannelV, typename DstChannelV, bool SrcLessThanDst, bool
template <typename UnsignedIntegralChannel>
-struct unsigned_integral_max_value : public mpl::integral_c<UnsignedIntegralChannel,-1> {};
+struct unsigned_integral_max_value : public mpl::integral_c<UnsignedIntegralChannel,static_cast<UnsignedIntegralChannel>(-1)> {};
template <>
struct unsigned_integral_max_value<uint8_t> : public mpl::integral_c<uint32_t,0xFF> {};
diff --git a/3party/gflags/src/gflags.cc b/3party/gflags/src/gflags.cc
index 9c81c7a685..01acd09d7e 100644
--- a/3party/gflags/src/gflags.cc
+++ b/3party/gflags/src/gflags.cc
@@ -348,13 +348,13 @@ string FlagValue::ToString() const {
case FV_BOOL:
return VALUE_AS(bool) ? "true" : "false";
case FV_INT32:
- snprintf(intbuf, sizeof(intbuf), "%"PRId32, VALUE_AS(int32));
+ snprintf(intbuf, sizeof(intbuf), "%" PRId32, VALUE_AS(int32));
return intbuf;
case FV_INT64:
- snprintf(intbuf, sizeof(intbuf), "%"PRId64, VALUE_AS(int64));
+ snprintf(intbuf, sizeof(intbuf), "%" PRId64, VALUE_AS(int64));
return intbuf;
case FV_UINT64:
- snprintf(intbuf, sizeof(intbuf), "%"PRIu64, VALUE_AS(uint64));
+ snprintf(intbuf, sizeof(intbuf), "%" PRIu64, VALUE_AS(uint64));
return intbuf;
case FV_DOUBLE:
snprintf(intbuf, sizeof(intbuf), "%.17g", VALUE_AS(double));
diff --git a/3party/protobuf/config.h b/3party/protobuf/config.h
index b96a032b9a..e6b7816c94 100644
--- a/3party/protobuf/config.h
+++ b/3party/protobuf/config.h
@@ -8,14 +8,22 @@
#ifdef _MSC_VER
#define HASH_MAP_H <hash_map>
#else
- #define HASH_MAP_H <tr1/unordered_map>
+ #if __cplusplus > 199711L
+ #define HASH_MAP_H <unordered_map>
+ #else
+ #define HASH_MAP_H <tr1/unordered_map>
+ #endif
#endif
/* the namespace of hash_map/hash_set */
#ifdef _MSC_VER
#define HASH_NAMESPACE stdext
#else
- #define HASH_NAMESPACE std::tr1
+ #if __cplusplus > 199711L
+ #define HASH_NAMESPACE std
+ #else
+ #define HASH_NAMESPACE std::tr1
+ #endif
#endif
/* the name of <hash_set> */
@@ -25,7 +33,11 @@
#ifdef _MSC_VER
#define HASH_SET_H <hash_set>
#else
- #define HASH_SET_H <tr1/unordered_set>
+ #if __cplusplus > 199711L
+ #define HASH_SET_H <unordered_set>
+ #else
+ #define HASH_SET_H <tr1/unordered_set>
+ #endif
#endif
/* Define to 1 if you have the <dlfcn.h> header file. */
diff --git a/coding/file_container.cpp b/coding/file_container.cpp
index a14e493730..6af4112311 100644
--- a/coding/file_container.cpp
+++ b/coding/file_container.cpp
@@ -95,9 +95,11 @@ void FilesContainerW::Open(FileWriter::Op op)
case FileWriter::OP_WRITE_EXISTING:
{
- // read an existing service info
- FileReader reader(m_name);
- ReadInfo(reader);
+ {
+ // read an existing service info
+ FileReader reader(m_name);
+ ReadInfo(reader);
+ }
// Important: in append mode we should sort info-vector by offsets
sort(m_info.begin(), m_info.end(), LessOffset());
diff --git a/common.pri b/common.pri
index 66f534b1cc..9c241f8b36 100644
--- a/common.pri
+++ b/common.pri
@@ -13,7 +13,14 @@ VERSION = $${VERSION_MAJOR}.$${VERSION_MINOR}
INCLUDEPATH *= $$ROOT_DIR/3party/boost
# hack for Qt5 qmake to make it faster
-CONFIG-=depend_includepath
+CONFIG -= depend_includepath
+
+#CONFIG *= c++11
+
+CONFIG(c++11) {
+ QMAKE_CFLAGS *= -Wno-deprecated-register
+ QMAKE_CXXFLAGS *= -Wno-deprecated-register
+}
# Automatically enable release config for production
CONFIG(production) {
diff --git a/drape/drape_tests/batcher_tests.cpp b/drape/drape_tests/batcher_tests.cpp
index 0ab82b4132..235e057755 100644
--- a/drape/drape_tests/batcher_tests.cpp
+++ b/drape/drape_tests/batcher_tests.cpp
@@ -155,7 +155,11 @@ UNIT_TEST(BatchLists_Test)
indexes[i] = i;
BatcherExpectations expectations;
- expectations.RunTest(data, indexes, VERTEX_COUNT, 3, VERTEX_COUNT, bind(&Batcher::InsertTriangleList, _1, _2, _3));
+ // @TODO Avoid std::bind overload compile error in the better way
+ void (Batcher::*fn)(GLState const &,
+ RefPointer<AttributeProvider>) = &Batcher::InsertTriangleList;
+ expectations.RunTest(data, indexes, VERTEX_COUNT, 3, VERTEX_COUNT,
+ bind(fn, _1, _2, _3));
}
UNIT_TEST(BatchListOfStript_4stride)
@@ -171,7 +175,9 @@ UNIT_TEST(BatchListOfStript_4stride)
{ 0, 1, 2, 1, 2, 3, 4, 5, 6, 5, 6, 7, 8, 9, 10, 9, 10, 11};
BatcherExpectations expectations;
- expectations.RunTest(data, indexes, VERTEX_COUNT, 3, INDEX_COUNT, bind(&Batcher::InsertListOfStrip, _1, _2, _3, 4));
+ // @TODO Avoid std::bind overload compile error in the better way
+ void (Batcher::*fn)(GLState const &, RefPointer<AttributeProvider>, uint8_t) = &Batcher::InsertListOfStrip;
+ expectations.RunTest(data, indexes, VERTEX_COUNT, 3, INDEX_COUNT, bind(fn, _1, _2, _3, 4));
}
UNIT_TEST(BatchListOfStript_5stride)
@@ -195,7 +201,9 @@ UNIT_TEST(BatchListOfStript_5stride)
12, 13, 14 };
BatcherExpectations expectations;
- expectations.RunTest(data, indexes, VERTEX_COUNT, 3, INDEX_COUNT, bind(&Batcher::InsertListOfStrip, _1, _2, _3, 5));
+ // @TODO Avoid std::bind overload compile error in the better way
+ void (Batcher::*fn)(GLState const &, RefPointer<AttributeProvider>, uint8_t) = &Batcher::InsertListOfStrip;
+ expectations.RunTest(data, indexes, VERTEX_COUNT, 3, INDEX_COUNT, bind(fn, _1, _2, _3, 5));
}
UNIT_TEST(BatchListOfStript_6stride)
@@ -222,7 +230,9 @@ UNIT_TEST(BatchListOfStript_6stride)
15, 16, 17};
BatcherExpectations expectations;
- expectations.RunTest(data, indexes, VERTEX_COUNT, 3, INDEX_COUNT, bind(&Batcher::InsertListOfStrip, _1, _2, _3, 6));
+ // @TODO Avoid std::bind overload compile error in the better way
+ void (Batcher::*fn)(GLState const &, RefPointer<AttributeProvider>, uint8_t) = &Batcher::InsertListOfStrip;
+ expectations.RunTest(data, indexes, VERTEX_COUNT, 3, INDEX_COUNT, bind(fn, _1, _2, _3, 6));
}
UNIT_TEST(BatchListOfStript_partial)
diff --git a/drape/drape_tests/pointers_tests.cpp b/drape/drape_tests/pointers_tests.cpp
index 6448cfc7cb..c9b7ee446f 100644
--- a/drape/drape_tests/pointers_tests.cpp
+++ b/drape/drape_tests/pointers_tests.cpp
@@ -36,6 +36,7 @@ void PointerDeleter(TransferPointer<T> p)
}
#ifdef DEBUG
+#ifdef CHECK_POINTERS
class MockAssertExpector
{
public:
@@ -49,7 +50,6 @@ void MyOnAssertFailed(SrcPoint const & src, string const & msg)
g_asserter->Assert(src, msg);
}
-#if defined(CHECK_POINTERS)
MockAssertExpector * InitAsserter()
{
if (g_asserter != NULL)
diff --git a/drape_frontend/area_shape.cpp b/drape_frontend/area_shape.cpp
index 38ec803683..3972f6bba8 100644
--- a/drape_frontend/area_shape.cpp
+++ b/drape_frontend/area_shape.cpp
@@ -12,9 +12,16 @@ AreaShape::AreaShape(vector<m2::PointF> const & triangleList, AreaViewParams con
: m_params(params)
{
m_vertexes.reserve(triangleList.size());
+
+#if __cplusplus > 199711L
+ void (vector<Point3D>::* fn)(Point3D &&) =
+#else
+ void (vector<Point3D>::* fn)(Point3D const &) =
+#endif
+ &vector<Point3D>::push_back;
+
for_each(triangleList.begin(), triangleList.end(),
- bind(&vector<Point3D>::push_back, &m_vertexes,
- bind(&Point3D::From2D, _1, params.m_depth)));
+ bind(fn, &m_vertexes, bind(&Point3D::From2D, _1, params.m_depth)));
}
void AreaShape::Draw(dp::RefPointer<dp::Batcher> batcher, dp::RefPointer<dp::TextureSetHolder> /*textures*/) const
diff --git a/drape_frontend/poi_symbol_shape.cpp b/drape_frontend/poi_symbol_shape.cpp
index a556666748..4350946055 100644
--- a/drape_frontend/poi_symbol_shape.cpp
+++ b/drape_frontend/poi_symbol_shape.cpp
@@ -10,7 +10,7 @@
namespace df
{
-PoiSymbolShape::PoiSymbolShape(m2::PointD const & mercatorPt, PoiSymbolViewParams const & params)
+PoiSymbolShape::PoiSymbolShape(m2::PointF const & mercatorPt, PoiSymbolViewParams const & params)
: m_pt(mercatorPt)
, m_params(params)
{
@@ -31,7 +31,7 @@ void PoiSymbolShape::Draw(dp::RefPointer<dp::Batcher> batcher, dp::RefPointer<dp
m2::PointF const halfSize(pixelSize.x / 2.0, pixelSize.y / 2.0);
m2::RectF const & texRect = region.GetTexRect();
float const depth = m_params.m_depth;
- float const texture = (float)region.GetTextureNode().m_textureOffset;
+ float const texture = static_cast<float>(region.GetTextureNode().m_textureOffset);
float positions[] = {
m_pt.x, m_pt.y,
diff --git a/drape_frontend/poi_symbol_shape.hpp b/drape_frontend/poi_symbol_shape.hpp
index 91bcef5f90..61a30dc98b 100644
--- a/drape_frontend/poi_symbol_shape.hpp
+++ b/drape_frontend/poi_symbol_shape.hpp
@@ -9,12 +9,12 @@ namespace df
class PoiSymbolShape : public MapShape
{
public:
- PoiSymbolShape(m2::PointD const & mercatorPt, PoiSymbolViewParams const & params);
+ PoiSymbolShape(m2::PointF const & mercatorPt, PoiSymbolViewParams const & params);
virtual void Draw(dp::RefPointer<dp::Batcher> batcher, dp::RefPointer<dp::TextureSetHolder> textures) const;
private:
- m2::PointD const m_pt;
+ m2::PointF const m_pt;
PoiSymbolViewParams const m_params;
};
diff --git a/generator/tesselator.cpp b/generator/tesselator.cpp
index 1b4bf28fb1..3bac0e8215 100644
--- a/generator/tesselator.cpp
+++ b/generator/tesselator.cpp
@@ -88,7 +88,10 @@ namespace tesselator
void TrianglesInfo::ListInfo::Add(uintptr_t const * arr)
{
- int arr32[] = { arr[0], arr[1], arr[2] };
+ ASSERT_EQUAL(arr[0], static_cast<int>(arr[0]), ());
+ ASSERT_EQUAL(arr[1], static_cast<int>(arr[1]), ());
+ ASSERT_EQUAL(arr[2], static_cast<int>(arr[2]), ());
+ int const arr32[] = { static_cast<int>(arr[0]), static_cast<int>(arr[1]), static_cast<int>(arr[2]) };
m_triangles.push_back(Triangle(arr32));
size_t const trg = m_triangles.size()-1;
diff --git a/generator/update_generator.cpp b/generator/update_generator.cpp
index e18120af01..a327f10350 100644
--- a/generator/update_generator.cpp
+++ b/generator/update_generator.cpp
@@ -86,7 +86,7 @@ namespace update
// remove some files from list
char const * filesToRemove[] = {
- "minsk-pass"DATA_FILE_EXTENSION,
+ "minsk-pass" DATA_FILE_EXTENSION,
WORLD_FILE_NAME DATA_FILE_EXTENSION,
WORLD_COASTS_FILE_NAME DATA_FILE_EXTENSION
};
diff --git a/graphics/glyph_cache_impl.cpp b/graphics/glyph_cache_impl.cpp
index db0cc2f97f..83c39bc21f 100644
--- a/graphics/glyph_cache_impl.cpp
+++ b/graphics/glyph_cache_impl.cpp
@@ -518,9 +518,9 @@ namespace graphics
FTC_ScalerRec fontScaler =
{
- reinterpret_cast<FTC_FaceID>(charIDX.first),
- key.m_fontSize,
- key.m_fontSize,
+ static_cast<FTC_FaceID>(charIDX.first),
+ static_cast<FT_UInt>(key.m_fontSize),
+ static_cast<FT_UInt>(key.m_fontSize),
1,
0,
0
@@ -555,10 +555,12 @@ namespace graphics
GlyphMetrics m =
{
- glyph->advance.x >> 16,
- glyph->advance.y >> 16,
- cbox.xMin, cbox.yMin,
- cbox.xMax - cbox.xMin, cbox.yMax - cbox.yMin
+ static_cast<int>(glyph->advance.x >> 16),
+ static_cast<int>(glyph->advance.y >> 16),
+ static_cast<int>(cbox.xMin),
+ static_cast<int>(cbox.yMin),
+ static_cast<int>(cbox.xMax - cbox.xMin),
+ static_cast<int>(cbox.yMax - cbox.yMin)
};
return m;
@@ -570,9 +572,9 @@ namespace graphics
FTC_ScalerRec fontScaler =
{
- reinterpret_cast<FTC_FaceID>(charIDX.first),
- key.m_fontSize,
- key.m_fontSize,
+ static_cast<FTC_FaceID>(charIDX.first),
+ static_cast<FT_UInt>(key.m_fontSize),
+ static_cast<FT_UInt>(key.m_fontSize),
1,
0,
0
diff --git a/graphics/overlay.cpp b/graphics/overlay.cpp
index 5a8f341829..8cc8d7ecd3 100644
--- a/graphics/overlay.cpp
+++ b/graphics/overlay.cpp
@@ -294,7 +294,10 @@ namespace graphics
/// 3. merging them into the infoLayer starting from most
/// important one to optimize the space usage.
- for_each(v.begin(), v.end(), bind(&Overlay::processOverlayElement, this, _1, cref(m)));
+ // @TODO Avoid std::bind overload compile error in the better way
+ void (Overlay::*fn)(shared_ptr<OverlayElement> const &,
+ math::Matrix<double, 3, 3> const &) = &Overlay::processOverlayElement;
+ for_each(v.begin(), v.end(), bind(fn, this, _1, cref(m)));
}
void Overlay::merge(Overlay const & infoLayer)
@@ -309,7 +312,9 @@ namespace graphics
/// 3. merging them into the infoLayer starting from most
/// important one to optimize the space usage.
- for_each(v.begin(), v.end(), bind(&Overlay::processOverlayElement, this, _1));
+ // @TODO Avoid std::bind overload compile error in the better way
+ void (Overlay::*fn)(shared_ptr<OverlayElement> const &) = &Overlay::processOverlayElement;
+ for_each(v.begin(), v.end(), bind(fn, this, _1));
}
void Overlay::clip(m2::RectI const & r)
diff --git a/graphics/pipeline_manager.cpp b/graphics/pipeline_manager.cpp
index 7666ec1b00..17645d0d95 100644
--- a/graphics/pipeline_manager.cpp
+++ b/graphics/pipeline_manager.cpp
@@ -11,6 +11,7 @@
#include "../std/iterator.hpp"
#include "../std/bind.hpp"
#include "../std/numeric.hpp"
+#include "../std/utility.hpp"
namespace graphics
{
@@ -71,16 +72,16 @@ namespace graphics
pair<uint8_t, uint32_t> PipelinesManager::unpackID(uint32_t id) const
{
- uint8_t pipelineID = (id & 0xFF000000) >> 24;
- uint32_t h = (id & 0x00FFFFFF);
- return make_pair<uint8_t, uint32_t>(pipelineID, h);
+ uint8_t const pipelineID = (id & 0xFF000000) >> 24;
+ uint32_t const h = (id & 0x00FFFFFF);
+ return make_pair(pipelineID, h);
}
uint32_t PipelinesManager::packID(uint8_t pipelineID, uint32_t handle) const
{
- uint32_t pipelineIDMask = (uint32_t)pipelineID << 24;
- uint32_t h = (handle & 0x00FFFFFF);
- return (uint32_t)(pipelineIDMask | h);
+ uint32_t const pipelineIDMask = (uint32_t)pipelineID << 24;
+ uint32_t const h = (handle & 0x00FFFFFF);
+ return static_cast<uint32_t>(pipelineIDMask | h);
}
Resource const * PipelinesManager::fromID(uint32_t id)
diff --git a/gui/controller.cpp b/gui/controller.cpp
index d293adbb50..ec441d5116 100644
--- a/gui/controller.cpp
+++ b/gui/controller.cpp
@@ -173,7 +173,7 @@ namespace gui
{
m_GlyphCache = 0;
m_Density = graphics::EDensityLDPI;
- m_InvalidateFn.clear();
+ m_InvalidateFn = TInvalidateFn();
m_CacheScreen = 0;
PurgeElements();
diff --git a/indexer/drawing_rules.cpp b/indexer/drawing_rules.cpp
index 4eea7e4dd9..c901cbeecd 100644
--- a/indexer/drawing_rules.cpp
+++ b/indexer/drawing_rules.cpp
@@ -123,7 +123,7 @@ BaseRule const * RulesHolder::Find(Key const & k) const
void RulesHolder::ClearCaches()
{
- ForEachRule(bind(&BaseRule::MakeEmptyID, _4));
+ ForEachRule(bind(static_cast<void (BaseRule::*)()>(&BaseRule::MakeEmptyID), _4));
}
void RulesHolder::ResizeCaches(size_t s)
diff --git a/map/navigator.cpp b/map/navigator.cpp
index 90a113c844..d91096ce1b 100644
--- a/map/navigator.cpp
+++ b/map/navigator.cpp
@@ -448,10 +448,10 @@ namespace
class ZoomAnim : public anim::Task
{
public:
- typedef function<void (m2::PointD const &, m2::PointD const &,
- m2::PointD const &, m2::PointD const &)> scale_impl_fn;
+ typedef function<bool (m2::PointD const &, m2::PointD const &,
+ m2::PointD const &, m2::PointD const &)> TScaleImplFn;
ZoomAnim(m2::PointD const & startPt, m2::PointD const & endPt,
- m2::PointD const & target, scale_impl_fn const & fn, double deltaTime)
+ m2::PointD const & target, TScaleImplFn const & fn, double deltaTime)
: m_targetPt(target)
, m_startPt(startPt)
, m_endPt(endPt)
@@ -495,7 +495,7 @@ namespace
m2::PointD m_endPt;
m2::PointD m_prevPt;
- scale_impl_fn m_fn;
+ TScaleImplFn m_fn;
double m_startTime;
double m_deltaTime;
};
diff --git a/map/pin_click_manager.cpp b/map/pin_click_manager.cpp
index 9deec20b19..f95d844ead 100644
--- a/map/pin_click_manager.cpp
+++ b/map/pin_click_manager.cpp
@@ -53,8 +53,8 @@ void PinClickManager::Dismiss()
void PinClickManager::ClearListeners()
{
- m_userMarkListener.clear();
- m_dismissListener.clear();
+ m_userMarkListener = TUserMarkListener();
+ m_dismissListener = TDismissListener();
}
void PinClickManager::OnActivateUserMark(UserMarkCopy * mark)
diff --git a/map/pin_click_manager.hpp b/map/pin_click_manager.hpp
index 0a9d229ff4..8f9a5d0e66 100644
--- a/map/pin_click_manager.hpp
+++ b/map/pin_click_manager.hpp
@@ -41,8 +41,10 @@ private:
/// @name Platform dependent listeners to show special activities.
//@{
// You must delete UserMarkCopy obtained by this callback
- function<void (UserMarkCopy *)> m_userMarkListener;
- function<void (void)> m_dismissListener;
+ typedef function<void (UserMarkCopy *)> TUserMarkListener;
+ TUserMarkListener m_userMarkListener;
+ typedef function<void (void)> TDismissListener;
+ TDismissListener m_dismissListener;
public:
template <class T> void ConnectUserMarkListener(T const & t) { m_userMarkListener = t; }
diff --git a/search/search_query.cpp b/search/search_query.cpp
index 5e8268c8f1..3c00206564 100644
--- a/search/search_query.cpp
+++ b/search/search_query.cpp
@@ -2040,7 +2040,7 @@ void FillCategories(Query::Params const & params, TrieIterator const * pTrieRoot
break;
}
}
- ASSERT_NOT_EQUAL(pCategoriesRoot, 0, ());
+ ASSERT(pCategoriesRoot != 0, ());
GetFeaturesInTrie(params.m_tokens, params.m_prefixTokens,
TrieRootPrefix(*pCategoriesRoot, categoriesEdge),
diff --git a/std/bind.hpp b/std/bind.hpp
index 5968b26bd1..88a9e85cff 100644
--- a/std/bind.hpp
+++ b/std/bind.hpp
@@ -6,6 +6,20 @@
#undef new
#endif
+#if __cplusplus > 199711L
+
+#include <functional>
+using std::bind;
+using std::ref;
+using std::cref;
+using std::placeholders::_1;
+using std::placeholders::_2;
+using std::placeholders::_3;
+using std::placeholders::_4;
+using std::placeholders::_5;
+
+#else
+
#ifdef OMIM_OS_WINDOWS
#define BOOST_BIND_ENABLE_STDCALL
#endif
@@ -15,6 +29,8 @@ using boost::bind;
using boost::ref;
using boost::cref;
+#endif
+
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
diff --git a/std/function.hpp b/std/function.hpp
index 924b3a7b07..ca461298d5 100644
--- a/std/function.hpp
+++ b/std/function.hpp
@@ -5,8 +5,17 @@
#undef new
#endif
-#include <boost/function.hpp>
-using boost::function;
+#if __cplusplus > 199711L
+
+ #include <functional>
+ using std::function;
+
+#else
+
+ #include <boost/function.hpp>
+ using boost::function;
+
+#endif
#ifdef DEBUG_NEW
#define new DEBUG_NEW
diff --git a/std/target_os.hpp b/std/target_os.hpp
index 46e501505f..9474dedc24 100644
--- a/std/target_os.hpp
+++ b/std/target_os.hpp
@@ -28,7 +28,10 @@
#define OMIM_OS_NAME "mac"
#define OMIM_OS_DESKTOP
#endif
- #define OMIM_HAS_DEBUG_STL 1
+
+ #if __cplusplus <= 199711L
+ #define OMIM_HAS_DEBUG_STL 1
+ #endif
#elif defined(_WIN32)
#define OMIM_OS_WINDOWS