]> git.lyx.org Git - lyx.git/blobdiff - 3rdparty/boost/boost/core/typeinfo.hpp
Update to boost 1.72
[lyx.git] / 3rdparty / boost / boost / core / typeinfo.hpp
index e67b4a3198be1757a345dcdd74710b9fc907df18..d33d29ba6885662ae4644ee580fc277853251ad6 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <boost/current_function.hpp>
 #include <functional>
+#include <cstring>
 
 namespace boost
 {
@@ -36,26 +37,43 @@ private:
     typeinfo& operator=( typeinfo const& );
 
     char const * name_;
+    void (*lib_id_)();
 
 public:
 
-    explicit typeinfo( char const * name ): name_( name )
+    typeinfo( char const * name, void (*lib_id)() ): name_( name ), lib_id_( lib_id )
     {
     }
 
     bool operator==( typeinfo const& rhs ) const
     {
+#if ( defined(_WIN32) || defined(__CYGWIN__) ) && ( defined(__GNUC__) || defined(__clang__) ) && !defined(BOOST_DISABLE_CURRENT_FUNCTION)
+
+        return lib_id_ == rhs.lib_id_? this == &rhs: std::strcmp( name_, rhs.name_ ) == 0;
+
+#else
+
         return this == &rhs;
+
+#endif
     }
 
     bool operator!=( typeinfo const& rhs ) const
     {
-        return this != &rhs;
+        return !( *this == rhs );
     }
 
     bool before( typeinfo const& rhs ) const
     {
+#if ( defined(_WIN32) || defined(__CYGWIN__) ) && ( defined(__GNUC__) || defined(__clang__) ) && !defined(BOOST_DISABLE_CURRENT_FUNCTION)
+
+        return lib_id_ == rhs.lib_id_? std::less< typeinfo const* >()( this, &rhs ): std::strcmp( name_, rhs.name_ ) < 0;
+
+#else
+
         return std::less< typeinfo const* >()( this, &rhs );
+
+#endif
     }
 
     char const* name() const
@@ -74,7 +92,7 @@ inline char const * demangled_name( core::typeinfo const & ti )
 namespace detail
 {
 
-template<class T> struct core_typeid_
+template<class T> struct BOOST_SYMBOL_VISIBLE core_typeid_
 {
     static boost::core::typeinfo ti_;
 
@@ -84,13 +102,11 @@ template<class T> struct core_typeid_
     }
 };
 
-#if defined(__SUNPRO_CC)
-// see #4199, the Sun Studio compiler gets confused about static initialization 
-// constructor arguments. But an assignment works just fine. 
-template<class T> boost::core::typeinfo core_typeid_< T >::ti_ = core_typeid_< T >::name();
-#else
-template<class T> boost::core::typeinfo core_typeid_< T >::ti_(core_typeid_< T >::name());
-#endif
+BOOST_SYMBOL_VISIBLE inline void core_typeid_lib_id()
+{
+}
+
+template<class T> boost::core::typeinfo core_typeid_< T >::ti_( core_typeid_< T >::name(), &core_typeid_lib_id );
 
 template<class T> struct core_typeid_< T & >: core_typeid_< T >
 {