From 6388395cd3959459662a93cd3f2ca0576a4f3a5a Mon Sep 17 00:00:00 2001 From: OBATA Akio Date: Sat, 22 Jan 2022 14:26:43 +0900 Subject: ksvg/libtext2path: use c++11 std:shared_ptr instead of bundled old boost one Signed-off-by: OBATA Akio (cherry picked from commit 9cdb76ebff291001528f1adc74f67966e24c08b5) --- ksvg/impl/libs/libtext2path/src/Cache.h | 5 +- ksvg/impl/libs/libtext2path/src/Converter.cpp | 1 - ksvg/impl/libs/libtext2path/src/Converter.h | 4 +- ksvg/impl/libs/libtext2path/src/myboost/assert.h | 24 -- .../libs/libtext2path/src/myboost/checked_delete.h | 61 ---- .../libtext2path/src/myboost/lightweight_mutex.h | 74 ---- .../libs/libtext2path/src/myboost/shared_count.h | 367 ------------------- .../libs/libtext2path/src/myboost/shared_ptr.h | 395 --------------------- .../libtext2path/src/myboost/throw_exception.h | 30 -- 9 files changed, 4 insertions(+), 957 deletions(-) delete mode 100644 ksvg/impl/libs/libtext2path/src/myboost/assert.h delete mode 100644 ksvg/impl/libs/libtext2path/src/myboost/checked_delete.h delete mode 100644 ksvg/impl/libs/libtext2path/src/myboost/lightweight_mutex.h delete mode 100644 ksvg/impl/libs/libtext2path/src/myboost/shared_count.h delete mode 100644 ksvg/impl/libs/libtext2path/src/myboost/shared_ptr.h delete mode 100644 ksvg/impl/libs/libtext2path/src/myboost/throw_exception.h diff --git a/ksvg/impl/libs/libtext2path/src/Cache.h b/ksvg/impl/libs/libtext2path/src/Cache.h index 6f6ca705..531135e0 100644 --- a/ksvg/impl/libs/libtext2path/src/Cache.h +++ b/ksvg/impl/libs/libtext2path/src/Cache.h @@ -25,8 +25,7 @@ #include #include #include - -#include "myboost/shared_ptr.h" +#include namespace T2P { @@ -50,7 +49,7 @@ namespace T2P class Cache { public: - typedef myboost::shared_ptr SharedT; + typedef std::shared_ptr SharedT; Cache(int maxSize = 10) : m_size(0), m_maxSize(maxSize) { } ~Cache() { clear(); } diff --git a/ksvg/impl/libs/libtext2path/src/Converter.cpp b/ksvg/impl/libs/libtext2path/src/Converter.cpp index 88af02ae..6434798e 100644 --- a/ksvg/impl/libs/libtext2path/src/Converter.cpp +++ b/ksvg/impl/libs/libtext2path/src/Converter.cpp @@ -22,7 +22,6 @@ #include -#include "myboost/shared_ptr.h" #include #include diff --git a/ksvg/impl/libs/libtext2path/src/Converter.h b/ksvg/impl/libs/libtext2path/src/Converter.h index 864812be..7f76533f 100644 --- a/ksvg/impl/libs/libtext2path/src/Converter.h +++ b/ksvg/impl/libs/libtext2path/src/Converter.h @@ -44,8 +44,8 @@ namespace T2P class GlyphLayoutParams; class GlyphRenderParams; - typedef myboost::shared_ptr SharedFont; - typedef myboost::shared_ptr SharedGlyph; + typedef std::shared_ptr SharedFont; + typedef std::shared_ptr SharedGlyph; class Converter { diff --git a/ksvg/impl/libs/libtext2path/src/myboost/assert.h b/ksvg/impl/libs/libtext2path/src/myboost/assert.h deleted file mode 100644 index ebedcd32..00000000 --- a/ksvg/impl/libs/libtext2path/src/myboost/assert.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// boost/assert.h - BOOST_ASSERT(expr) -// -// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. -// -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. -// This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. -// -// Note: There are no include guards. This is intentional. -// -// See http://www.boost.org/libs/utility/assert.html for documentation. -// - -#ifndef ASSERT_H -#define ASSERT_H - -#undef BOOST_ASSERT - -# include -# define BOOST_ASSERT(expr) assert(expr) - -#endif diff --git a/ksvg/impl/libs/libtext2path/src/myboost/checked_delete.h b/ksvg/impl/libs/libtext2path/src/myboost/checked_delete.h deleted file mode 100644 index ba5b534c..00000000 --- a/ksvg/impl/libs/libtext2path/src/myboost/checked_delete.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef BOOST_CHECKED_DELETE_H_INCLUDED -#define BOOST_CHECKED_DELETE_H_INCLUDED - -// -// boost/checked_delete.h -// -// Copyright (c) 1999, 2000, 2001, 2002 boost.org -// Copyright (c) 2002, 2003 Peter Dimov -// -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. -// This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. -// -// See http://www.boost.org/libs/utility/checked_delete.html for documentation. -// - -namespace myboost -{ - -// verify that types are complete for increased safety - -template inline void checked_delete(T * x) -{ - // Intel 7 accepts sizeof(incomplete) as 0 in system headers - typedef char type_must_be_complete[ sizeof(T)? 1: -1 ]; - delete x; -} - -template inline void checked_array_delete(T * x) -{ - typedef char type_must_be_complete[ sizeof(T)? 1: -1 ]; - delete [] x; -} - -template struct checked_deleter -{ - typedef void result_type; - typedef T * argument_type; - - void operator()(T * x) const - { - // boost:: disables ADL - myboost::checked_delete(x); - } -}; - -template struct checked_array_deleter -{ - typedef void result_type; - typedef T * argument_type; - - void operator()(T * x) const - { - myboost::checked_array_delete(x); - } -}; - -} // namespace myboost - -#endif // #ifndef BOOST_CHECKED_DELETE_H_INCLUDED diff --git a/ksvg/impl/libs/libtext2path/src/myboost/lightweight_mutex.h b/ksvg/impl/libs/libtext2path/src/myboost/lightweight_mutex.h deleted file mode 100644 index 2c09ca8b..00000000 --- a/ksvg/impl/libs/libtext2path/src/myboost/lightweight_mutex.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef BOOST_DETAIL_LWM_PTHREADS_H_INCLUDED -#define BOOST_DETAIL_LWM_PTHREADS_H_INCLUDED - -// -// boost/detail/lwm_pthreads.h -// -// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. -// -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. -// This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. -// - -#include - -namespace myboost -{ - -namespace detail -{ - -class lightweight_mutex -{ -private: - - pthread_mutex_t m_; - - lightweight_mutex(lightweight_mutex const &); - lightweight_mutex & operator=(lightweight_mutex const &); - -public: - - lightweight_mutex() - { - pthread_mutex_init(&m_, 0); - } - - ~lightweight_mutex() - { - pthread_mutex_destroy(&m_); - } - - class scoped_lock; - friend class scoped_lock; - - class scoped_lock - { - private: - - pthread_mutex_t & m_; - - scoped_lock(scoped_lock const &); - scoped_lock & operator=(scoped_lock const &); - - public: - - scoped_lock(lightweight_mutex & m): m_(m.m_) - { - pthread_mutex_lock(&m_); - } - - ~scoped_lock() - { - pthread_mutex_unlock(&m_); - } - }; -}; - -} // namespace detail - -} // namespace myboost - -#endif // #ifndef BOOST_DETAIL_LWM_PTHREADS_H_INCLUDED diff --git a/ksvg/impl/libs/libtext2path/src/myboost/shared_count.h b/ksvg/impl/libs/libtext2path/src/myboost/shared_count.h deleted file mode 100644 index b240ff8f..00000000 --- a/ksvg/impl/libs/libtext2path/src/myboost/shared_count.h +++ /dev/null @@ -1,367 +0,0 @@ -#ifndef BOOST_DETAIL_SHARED_COUNT_H_INCLUDED -#define BOOST_DETAIL_SHARED_COUNT_H_INCLUDED - -// -// detail/shared_count.h -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. -// This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. -// - -#include "myboost/checked_delete.h" -#include "myboost/throw_exception.h" -#include "myboost/lightweight_mutex.h" - -#include // std::auto_ptr, std::allocator -#include // std::less -#include // std::exception -#include // std::bad_alloc -#include // std::type_info in get_deleter -#include // std::size_t - -namespace myboost -{ - -class bad_weak_ptr: public std::exception -{ -public: - - virtual char const * what() const throw() - { - return "myboost::bad_weak_ptr"; - } -}; - -namespace detail -{ - -class sp_counted_base -{ -private: - - typedef detail::lightweight_mutex mutex_type; - -public: - - sp_counted_base(): use_count_(1), weak_count_(1) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destruct() is called when weak_count_ drops to zero. - - virtual void destruct() // nothrow - { - delete this; - } - - virtual void * get_deleter(std::type_info const & ti) = 0; - - void add_ref_copy() - { - mutex_type::scoped_lock lock(mtx_); - ++use_count_; - } - - void add_ref_lock() - { - mutex_type::scoped_lock lock(mtx_); - if(use_count_ == 0) myboost::throw_exception(myboost::bad_weak_ptr()); - ++use_count_; - } - - void release() // nothrow - { - { - mutex_type::scoped_lock lock(mtx_); - long new_use_count = --use_count_; - - if(new_use_count != 0) return; - } - - dispose(); - weak_release(); - } - - void weak_add_ref() // nothrow - { - mutex_type::scoped_lock lock(mtx_); - ++weak_count_; - } - - void weak_release() // nothrow - { - long new_weak_count; - - { - mutex_type::scoped_lock lock(mtx_); - new_weak_count = --weak_count_; - } - - if(new_weak_count == 0) - { - destruct(); - } - } - - long use_count() const // nothrow - { - mutex_type::scoped_lock lock(mtx_); - return use_count_; - } - -private: - - sp_counted_base(sp_counted_base const &); - sp_counted_base & operator= (sp_counted_base const &); - - long use_count_; // #shared - long weak_count_; // #weak + (#shared != 0) - - mutable mutex_type mtx_; -}; - -template class sp_counted_base_impl: public sp_counted_base -{ -private: - - P ptr; // copy constructor must not throw - D del; // copy constructor must not throw - - sp_counted_base_impl(sp_counted_base_impl const &); - sp_counted_base_impl & operator= (sp_counted_base_impl const &); - - typedef sp_counted_base_impl this_type; - -public: - - // pre: initial_use_count <= initial_weak_count, d(p) must not throw - - sp_counted_base_impl(P p, D d): ptr(p), del(d) - { - } - - virtual void dispose() // nothrow - { - del(ptr); - } - - virtual void * get_deleter(std::type_info const & ti) - { - return ti == typeid(D)? &del: 0; - } - - void * operator new(std::size_t) - { - return std::allocator().allocate(1, static_cast(0)); - } - - void operator delete(void * p) - { - std::allocator().deallocate(static_cast(p), 1); - } -}; - -class weak_count; - -class shared_count -{ -private: - - sp_counted_base * pi_; - - friend class weak_count; - -public: - - shared_count(): pi_(0) // nothrow - { - } - - template shared_count(P p, D d): pi_(0) - { - - try - { - pi_ = new sp_counted_base_impl(p, d); - } - catch(...) - { - d(p); // delete p - throw; - } - - - pi_ = new sp_counted_base_impl(p, d); - - if(pi_ == 0) - { - d(p); // delete p - myboost::throw_exception(std::bad_alloc()); - } - } - - // auto_ptr is special cased to provide the strong guarantee - - template - explicit shared_count(std::auto_ptr & r): pi_(new sp_counted_base_impl< Y *, checked_deleter >(r.get(), checked_deleter())) - { - r.release(); - } - - ~shared_count() // nothrow - { - if(pi_ != 0) pi_->release(); - } - - shared_count(shared_count const & r): pi_(r.pi_) // nothrow - { - if(pi_ != 0) pi_->add_ref_copy(); - } - - explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0 - - shared_count & operator= (shared_count const & r) // nothrow - { - sp_counted_base * tmp = r.pi_; - if(tmp != 0) tmp->add_ref_copy(); - if(pi_ != 0) pi_->release(); - pi_ = tmp; - - return *this; - } - - void swap(shared_count & r) // nothrow - { - sp_counted_base * tmp = r.pi_; - r.pi_ = pi_; - pi_ = tmp; - } - - long use_count() const // nothrow - { - return pi_ != 0? pi_->use_count(): 0; - } - - bool unique() const // nothrow - { - return use_count() == 1; - } - - friend inline bool operator==(shared_count const & a, shared_count const & b) - { - return a.pi_ == b.pi_; - } - - friend inline bool operator<(shared_count const & a, shared_count const & b) - { - return std::less()(a.pi_, b.pi_); - } - - void * get_deleter(std::type_info const & ti) const - { - return pi_? pi_->get_deleter(ti): 0; - } -}; - -class weak_count -{ -private: - - sp_counted_base * pi_; - - friend class shared_count; - -public: - - weak_count(): pi_(0) // nothrow - { - } - - weak_count(shared_count const & r): pi_(r.pi_) // nothrow - { - if(pi_ != 0) pi_->weak_add_ref(); - } - - weak_count(weak_count const & r): pi_(r.pi_) // nothrow - { - if(pi_ != 0) pi_->weak_add_ref(); - } - - ~weak_count() // nothrow - { - if(pi_ != 0) pi_->weak_release(); - } - - weak_count & operator= (shared_count const & r) // nothrow - { - sp_counted_base * tmp = r.pi_; - if(tmp != 0) tmp->weak_add_ref(); - if(pi_ != 0) pi_->weak_release(); - pi_ = tmp; - - return *this; - } - - weak_count & operator= (weak_count const & r) // nothrow - { - sp_counted_base * tmp = r.pi_; - if(tmp != 0) tmp->weak_add_ref(); - if(pi_ != 0) pi_->weak_release(); - pi_ = tmp; - - return *this; - } - - void swap(weak_count & r) // nothrow - { - sp_counted_base * tmp = r.pi_; - r.pi_ = pi_; - pi_ = tmp; - } - - long use_count() const // nothrow - { - return pi_ != 0? pi_->use_count(): 0; - } - - friend inline bool operator==(weak_count const & a, weak_count const & b) - { - return a.pi_ == b.pi_; - } - - friend inline bool operator<(weak_count const & a, weak_count const & b) - { - return std::less()(a.pi_, b.pi_); - } -}; - -inline shared_count::shared_count(weak_count const & r): pi_(r.pi_) -{ - if(pi_ != 0) - { - pi_->add_ref_lock(); - } - else - { - myboost::throw_exception(myboost::bad_weak_ptr()); - } -} - -} // namespace detail - -} // namespace myboost - -#endif // #ifndef BOOST_DETAIL_SHARED_COUNT_H_INCLUDED diff --git a/ksvg/impl/libs/libtext2path/src/myboost/shared_ptr.h b/ksvg/impl/libs/libtext2path/src/myboost/shared_ptr.h deleted file mode 100644 index 435be678..00000000 --- a/ksvg/impl/libs/libtext2path/src/myboost/shared_ptr.h +++ /dev/null @@ -1,395 +0,0 @@ -#ifndef BOOST_SHARED_PTR_H_INCLUDED -#define BOOST_SHARED_PTR_H_INCLUDED - -// shared_ptr.h -// -// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. -// Copyright (c) 2001, 2002, 2003 Peter Dimov -// -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. -// This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. -// -// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation. -// - -#include "myboost/assert.h" -#include "myboost/checked_delete.h" -#include "myboost/throw_exception.h" -#include "myboost/shared_count.h" - -#include // for std::auto_ptr -#include // for std::swap -#include // for std::less -#include // for std::bad_cast -#include // for std::basic_ostream - -namespace myboost -{ - -template class weak_ptr; -template class enable_shared_from_this; - -namespace detail -{ - -struct static_cast_tag {}; -struct const_cast_tag {}; -struct dynamic_cast_tag {}; -struct polymorphic_cast_tag {}; - -template struct shared_ptr_traits -{ - typedef T & reference; -}; - -template<> struct shared_ptr_traits -{ - typedef void reference; -}; - -template<> struct shared_ptr_traits -{ - typedef void reference; -}; - -template<> struct shared_ptr_traits -{ - typedef void reference; -}; - -template<> struct shared_ptr_traits -{ - typedef void reference; -}; - -// enable_shared_from_this support - -template void sp_enable_shared_from_this(myboost::enable_shared_from_this * pe, Y * px, shared_count const & pn) -{ - if(pe != 0) pe->_internal_weak_this._internal_assign(px, pn); -} - -inline void sp_enable_shared_from_this(void const *, void const *, shared_count const &) -{ -} - -} // namespace detail - - -// -// shared_ptr -// -// An enhanced relative of scoped_ptr with reference counted copy semantics. -// The object pointed to is deleted when the last shared_ptr pointing to it -// is destroyed or reset. -// - -template class shared_ptr -{ -private: - - // Borland 5.5.1 specific workaround - typedef shared_ptr this_type; - -public: - - typedef T element_type; - typedef T value_type; - typedef T * pointer; - typedef typename detail::shared_ptr_traits::reference reference; - - shared_ptr(): px(0), pn() // never throws in 1.30+ - { - } - - template - explicit shared_ptr(Y * p): px(p), pn(p, checked_deleter()) // Y must be complete - { - detail::sp_enable_shared_from_this(p, p, pn); - } - - // - // Requirements: D's copy constructor must not throw - // - // shared_ptr will release p by calling d(p) - // - - template shared_ptr(Y * p, D d): px(p), pn(p, d) - { - detail::sp_enable_shared_from_this(p, p, pn); - } - -// generated copy constructor, assignment, destructor are fine... -// except that Borland C++ has a bug, and g++ with -Wsynth warns - shared_ptr & operator=(shared_ptr const & r) // never throws - { - px = r.px; - pn = r.pn; // shared_count::op= doesn't throw - return *this; - } - - template - explicit shared_ptr(weak_ptr const & r): pn(r.pn) // may throw - { - // it is now safe to copy r.px, as pn(r.pn) did not throw - px = r.px; - } - - template - shared_ptr(shared_ptr const & r): px(r.px), pn(r.pn) // never throws - { - } - - template - shared_ptr(shared_ptr const & r, detail::static_cast_tag): px(static_cast(r.px)), pn(r.pn) - { - } - - template - shared_ptr(shared_ptr const & r, detail::const_cast_tag): px(const_cast(r.px)), pn(r.pn) - { - } - - template - shared_ptr(shared_ptr const & r, detail::dynamic_cast_tag): px(dynamic_cast(r.px)), pn(r.pn) - { - if(px == 0) // need to allocate new counter -- the cast failed - { - pn = detail::shared_count(); - } - } - - template - shared_ptr(shared_ptr const & r, detail::polymorphic_cast_tag): px(dynamic_cast(r.px)), pn(r.pn) - { - if(px == 0) - { - myboost::throw_exception(std::bad_cast()); - } - } - - template - explicit shared_ptr(std::auto_ptr & r): px(r.get()), pn() - { - Y * tmp = r.get(); - pn = detail::shared_count(r); - detail::sp_enable_shared_from_this(tmp, tmp, pn); - } - - template - shared_ptr & operator=(shared_ptr const & r) // never throws - { - px = r.px; - pn = r.pn; // shared_count::op= doesn't throw - return *this; - } - - template - shared_ptr & operator=(std::auto_ptr & r) - { - this_type(r).swap(*this); - return *this; - } - - void reset() // never throws in 1.30+ - { - this_type().swap(*this); - } - - template void reset(Y * p) // Y must be complete - { - BOOST_ASSERT(p == 0 || p != px); // catch self-reset errors - this_type(p).swap(*this); - } - - template void reset(Y * p, D d) - { - this_type(p, d).swap(*this); - } - - reference operator* () const // never throws - { - BOOST_ASSERT(px != 0); - return *px; - } - - T * operator-> () const // never throws - { - BOOST_ASSERT(px != 0); - return px; - } - - T * get() const // never throws - { - return px; - } - - typedef T * (this_type::*unspecified_bool_type)() const; - - operator unspecified_bool_type() const // never throws - { - return px == 0? 0: &this_type::get; - } - - // operator! is redundant, but some compilers need it - - bool operator! () const // never throws - { - return px == 0; - } - - bool unique() const // never throws - { - return pn.unique(); - } - - long use_count() const // never throws - { - return pn.use_count(); - } - - void swap(shared_ptr & other) // never throws - { - std::swap(px, other.px); - pn.swap(other.pn); - } - - template bool _internal_less(shared_ptr const & rhs) const - { - return pn < rhs.pn; - } - - void * _internal_get_deleter(std::type_info const & ti) const - { - return pn.get_deleter(ti); - } - -// Tasteless as this may seem, making all members public allows member templates -// to work in the absence of member template friends. (Matthew Langston) - -# if __GNUC__ >= 2 && __GNUC_MINOR__ >= 97 -private: - - template friend class shared_ptr; - template friend class weak_ptr; -#endif - - T * px; // contained pointer - detail::shared_count pn; // reference counter - -}; // shared_ptr - -template inline bool operator==(shared_ptr const & a, shared_ptr const & b) -{ - return a.get() == b.get(); -} - -template inline bool operator!=(shared_ptr const & a, shared_ptr const & b) -{ - return a.get() != b.get(); -} - -#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 - -// Resolve the ambiguity between our op!= and the one in rel_ops - -template inline bool operator!=(shared_ptr const & a, shared_ptr const & b) -{ - return a.get() != b.get(); -} - -#endif - -template inline bool operator<(shared_ptr const & a, shared_ptr const & b) -{ - return a._internal_less(b); -} - -template inline void swap(shared_ptr & a, shared_ptr & b) -{ - a.swap(b); -} - -template shared_ptr static_pointer_cast(shared_ptr const & r) -{ - return shared_ptr(r, detail::static_cast_tag()); -} - -template shared_ptr const_pointer_cast(shared_ptr const & r) -{ - return shared_ptr(r, detail::const_cast_tag()); -} - -template shared_ptr dynamic_pointer_cast(shared_ptr const & r) -{ - return shared_ptr(r, detail::dynamic_cast_tag()); -} - -// shared_*_cast names are deprecated. Use *_pointer_cast instead. - -template shared_ptr shared_static_cast(shared_ptr const & r) -{ - return shared_ptr(r, detail::static_cast_tag()); -} - -template shared_ptr shared_dynamic_cast(shared_ptr const & r) -{ - return shared_ptr(r, detail::dynamic_cast_tag()); -} - -template shared_ptr shared_polymorphic_cast(shared_ptr const & r) -{ - return shared_ptr(r, detail::polymorphic_cast_tag()); -} - -template shared_ptr shared_polymorphic_downcast(shared_ptr const & r) -{ - BOOST_ASSERT(dynamic_cast(r.get()) == r.get()); - return shared_static_cast(r); -} - -// get_pointer() enables boost::mem_fn to recognize shared_ptr - -template inline T * get_pointer(shared_ptr const & p) -{ - return p.get(); -} - -// operator<< - - -template std::ostream & operator<< (std::ostream & os, shared_ptr const & p) -{ - os << p.get(); - return os; -} - - -// get_deleter (experimental) - -#if (defined(__GNUC__) && (__GNUC__ < 3)) || (defined(__EDG_VERSION__) && (__EDG_VERSION__ <= 238)) - -// g++ 2.9x doesn't allow static_cast(void *) -// apparently EDG 2.38 also doesn't accept it - -template D * get_deleter(shared_ptr const & p) -{ - void const * q = p._internal_get_deleter(typeid(D)); - return const_cast(static_cast(q)); -} - -#else - -template D * get_deleter(shared_ptr const & p) -{ - return static_cast(p._internal_get_deleter(typeid(D))); -} - -#endif - -} // namespace boost - - -#endif // #ifndef BOOST_SHARED_PTR_H_INCLUDED diff --git a/ksvg/impl/libs/libtext2path/src/myboost/throw_exception.h b/ksvg/impl/libs/libtext2path/src/myboost/throw_exception.h deleted file mode 100644 index 3223b564..00000000 --- a/ksvg/impl/libs/libtext2path/src/myboost/throw_exception.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef BOOST_THROW_EXCEPTION_H_INCLUDED -#define BOOST_THROW_EXCEPTION_H_INCLUDED - - -// -// boost/throw_exception.h -// -// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. -// -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. -// This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. -// -// http://www.boost.org/libs/utility/throw_exception.html -// - -# include - -namespace myboost -{ - -template void throw_exception(E const & e) -{ - throw e; -} - -} // namespace myboost - -#endif // #ifndef BOOST_THROW_EXCEPTION_H_INCLUDED -- cgit v1.2.1