#ifndef LYX_SHARED_PTR_H
#define LYX_SHARED_PTR_H
-#if defined(_MSC_VER) && (_MSC_VER >= 1600)
+#ifdef LYX_USE_TR1
#include <memory>
-using std::tr1::shared_ptr;
+
+#ifdef __GNUC__
+#include <tr1/memory>
+#endif
+
+namespace lyx
+{
+ using std::tr1::shared_ptr;
+ using std::tr1::const_pointer_cast;
+}
#else
#include <boost/shared_ptr.hpp>
-using boost::shared_ptr;
+
+namespace lyx
+{
+ using boost::shared_ptr;
+ using boost::const_pointer_cast;
+}
#endif