From a43d4251fd32b88569884ca41d4ba22e3de8b045 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Tue, 5 Aug 2014 23:31:02 +0300 Subject: Base libraries C++11 sources compatibility --- std/bind.hpp | 16 ++++++++++++++++ std/function.hpp | 13 +++++++++++-- std/target_os.hpp | 5 ++++- 3 files changed, 31 insertions(+), 3 deletions(-) (limited to 'std') 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 +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 -using boost::function; +#if __cplusplus > 199711L + + #include + using std::function; + +#else + + #include + 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 -- cgit v1.2.3