Patch #3502 2013-10-01 09:42

mojca

Allow C++11 compiler
Download
3502-Allow_C_11_com.patch (921 bytes)
Category
Application::Bugfix
Status
Accepted
Close date
2013-10-01 20:31
Assigned to
tpetrov
Index: src/include/prep.h
===================================================================
--- src/include/prep.h    (revision 9374)
+++ src/include/prep.h    (working copy)
@@ -406,14 +406,27 @@
 inline ID GetID() { return GetID<void>(); }
 inline ID ConstructID(wxIntPtr i) { return ID(i); }
 
+// Just included to possibly set _LIBCPP_VERSION
+#include <ciso646>
+
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <memory>
+#else
 #include <tr1/memory>
+#endif
 
 // Add std::shared_ptr in a namespace, so different implementations can be used with different compilers
 namespace cb
 {
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+    using std::shared_ptr;
+    using std::static_pointer_cast;
+    using std::weak_ptr;
+#else
     using std::tr1::shared_ptr;
     using std::tr1::static_pointer_cast;
     using std::tr1::weak_ptr;
+#endif
 }
 
 #if defined(__APPLE__) && defined(__MACH__)
mojca 2013-10-01 09:42