Index: interprocess/mem_algo/rbtree_best_fit.hpp =================================================================== --- interprocess/mem_algo/rbtree_best_fit.hpp (Revision 43240) +++ interprocess/mem_algo/rbtree_best_fit.hpp (Arbeitskopie) @@ -325,8 +325,9 @@ public: + // warning: enumeral and non-enumeral type in conditional expression static const std::size_t Alignment = !MemAlignment - ? detail::alignment_of::value + ? static_cast(detail::alignment_of::value) : MemAlignment ; Index: interprocess/detail/segment_manager_helper.hpp =================================================================== --- interprocess/detail/segment_manager_helper.hpp (Revision 43240) +++ interprocess/detail/segment_manager_helper.hpp (Arbeitskopie) @@ -27,6 +27,7 @@ #include //char_traits #include //std::nothrow #include //std::pair +#include //assert #ifndef BOOST_NO_EXCEPTIONS #include #endif Index: interprocess/containers/slist.hpp =================================================================== --- interprocess/containers/slist.hpp (Revision 43240) +++ interprocess/containers/slist.hpp (Arbeitskopie) @@ -64,6 +64,7 @@ #include #include #include +#include namespace boost{ namespace interprocess{ Index: interprocess/smart_ptr/scoped_ptr.hpp =================================================================== --- interprocess/smart_ptr/scoped_ptr.hpp (Revision 43240) +++ interprocess/smart_ptr/scoped_ptr.hpp (Arbeitskopie) @@ -18,6 +18,7 @@ #include #include #include +#include // do_swap #include //!\file Index: interprocess/sync/emulation/interprocess_semaphore.hpp =================================================================== --- interprocess/sync/emulation/interprocess_semaphore.hpp (Revision 43240) +++ interprocess/sync/emulation/interprocess_semaphore.hpp (Arbeitskopie) @@ -8,7 +8,22 @@ // ////////////////////////////////////////////////////////////////////////////// -#include +#ifndef BOOST_INTERPROCESS_SYNC_EMULATION_INTERPROCESS_SEMAPHORE_HPP +#define BOOST_INTERPROCESS_SYNC_EMULATION_INTERPROCESS_SEMAPHORE_HPP + +// if one of the two macros is defined sync/interprocess_semaphore.hpp will aready +// include a definition of interprocess_semaphore members +// +// Puh, because of the #undef in sync/interprocess_semaphore.hpp be still get +// sync/emulation/interprocess_semaphore.hpp error: +// redefinition of 'boost::interprocess::interprocess_semaphore::~interprocess_semaphore()' +// sync/posix/interprocess_semaphore.hpp error: +// 'boost::interprocess::interprocess_semaphore::~interprocess_semaphore()' previously defined here +// +// Let's skip this file move to detail and trust that one of the macros is defined? +#if !defined(BOOST_INTERPROCESS_USE_GENERIC_EMULATION) && !defined(BOOST_INTERPROCESS_USE_POSIX) +#include // interprocess_semaphore +#include #include #include @@ -69,3 +84,7 @@ } //namespace interprocess { } //namespace boost { + +#endif +#endif + Index: interprocess/sync/emulation/interprocess_barrier.hpp =================================================================== --- interprocess/sync/emulation/interprocess_barrier.hpp (Revision 43240) +++ interprocess/sync/emulation/interprocess_barrier.hpp (Arbeitskopie) @@ -8,7 +8,11 @@ // ////////////////////////////////////////////////////////////////////////////// -#include +#ifndef BOOST_INTERPROCESS_SYNC_EMULATION_INTERPROCESS_BARRIER_HPP +#define BOOST_INTERPROCESS_SYNC_EMULATION_INTERPROCESS_BARRIER_HPP + +#include +#include #include #include @@ -44,3 +48,6 @@ } //namespace interprocess { } //namespace boost { + +#endif + Index: interprocess/sync/emulation/interprocess_condition.hpp =================================================================== --- interprocess/sync/emulation/interprocess_condition.hpp (Revision 43240) +++ interprocess/sync/emulation/interprocess_condition.hpp (Arbeitskopie) @@ -10,6 +10,9 @@ #include +// where is the definition of interprocess_condition? If used internally let's +// move to detail/! + namespace boost { namespace interprocess { Index: interprocess/sync/posix/interprocess_recursive_mutex.hpp =================================================================== --- interprocess/sync/posix/interprocess_recursive_mutex.hpp (Revision 43240) +++ interprocess/sync/posix/interprocess_recursive_mutex.hpp (Arbeitskopie) @@ -24,6 +24,10 @@ // It is provided "as is" without express or implied warranty. ////////////////////////////////////////////////////////////////////////////// +#ifndef BOOST_INTERPROCESS_SYNC_POSIX_INTERPROCESS_RECURSIVE_MUTEX_HPP +#define BOOST_INTERPROCESS_SYNC_POSIX_INTERPROCESS_RECURSIVE_MUTEX_HPP + +#include // interprocess_recursive_mutex #include #include #include @@ -105,3 +109,6 @@ } //namespace interprocess { } //namespace boost { + +#endif + Index: interprocess/sync/posix/interprocess_mutex.hpp =================================================================== --- interprocess/sync/posix/interprocess_mutex.hpp (Revision 43240) +++ interprocess/sync/posix/interprocess_mutex.hpp (Arbeitskopie) @@ -24,6 +24,10 @@ // It is provided "as is" without express or implied warranty. ////////////////////////////////////////////////////////////////////////////// +#ifndef BOOST_INTERPROCESS_SYNC_POSIX_INTERPROCESS_MUTEX_HPP +#define BOOST_INTERPROCESS_SYNC_POSIX_INTERPROCESS_MUTEX_HPP + +#include // interprocess_mutex #include #include #include @@ -104,3 +108,6 @@ } //namespace interprocess { } //namespace boost { + +#endif + Index: interprocess/sync/posix/interprocess_semaphore.hpp =================================================================== --- interprocess/sync/posix/interprocess_semaphore.hpp (Revision 43240) +++ interprocess/sync/posix/interprocess_semaphore.hpp (Arbeitskopie) @@ -8,6 +8,12 @@ // ////////////////////////////////////////////////////////////////////////////// +// let's avoid: +// error: redefinition of 'boost::interprocess::interprocess_semaphore::~interprocess_semaphore()' +#ifndef BOOST_INTERPROCESS_SEMAPHORE_HPP +#define BOOST_INTERPROCESS_SEMAPHORE_HPP + +#include // interprocess_semaphore #include #include @@ -41,3 +47,5 @@ } //namespace boost { +#endif + Index: interprocess/sync/posix/interprocess_barrier.hpp =================================================================== --- interprocess/sync/posix/interprocess_barrier.hpp (Revision 43240) +++ interprocess/sync/posix/interprocess_barrier.hpp (Arbeitskopie) @@ -8,7 +8,11 @@ // ////////////////////////////////////////////////////////////////////////////// -#include +#ifndef BOOST_INTERPROCESS_SYNC_POSIX_INTERPROCESS_BARRIER_HPP +#define BOOST_INTERPROCESS_SYNC_POSIX_INTERPROCESS_BARRIER_HPP + +#include // barrier +#include #include namespace boost { @@ -42,3 +46,6 @@ } //namespace interprocess { } //namespace boost { + +#endif + Index: interprocess/sync/posix/interprocess_condition.hpp =================================================================== --- interprocess/sync/posix/interprocess_condition.hpp (Revision 43240) +++ interprocess/sync/posix/interprocess_condition.hpp (Arbeitskopie) @@ -8,6 +8,10 @@ // ////////////////////////////////////////////////////////////////////////////// +#ifndef BOOST_INTERPROCESS_SYNC_POSIX_INTERPROCESS_CONDITION_HPP +#define BOOST_INTERPROCESS_SYNC_POSIX_INTERPROCESS_CONDITION_HPP + +#include // interprocess_condition #include #include @@ -79,3 +83,6 @@ } //namespace interprocess } // namespace boost + +#endif + Index: interprocess/sync/file_lock.hpp =================================================================== --- interprocess/sync/file_lock.hpp (Revision 43240) +++ interprocess/sync/file_lock.hpp (Arbeitskopie) @@ -28,6 +28,10 @@ namespace boost { namespace interprocess { +// will not be inline! +bool try_acquire_file_lock(file_handle_t hnd, bool &acquired); +bool try_acquire_file_lock_sharable(file_handle_t hnd, bool &acquired); + //!A file lock, is a mutual exclusion utility similar to a mutex using a //!file. A file lock has sharable and exclusive locking capabilities and //!can be used with scoped_lock and sharable_lock classes. @@ -129,7 +133,10 @@ return true; } // relinquish current time slice + #if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32) + // TODO: Add include statement! winapi::sched_yield(); + #endif } }while (true); } @@ -157,11 +164,15 @@ return true; } // relinquish current time slice + #if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32) + // TODO: Add include statement! winapi::sched_yield(); + #endif } }while (true); } +/* Defined twice in this file! bool timed_acquire_file_lock (file_handle_t hnd, bool &acquired, const boost::posix_time::ptime &abs_time) { @@ -217,6 +228,7 @@ } }while (true); } + */ /// @endcond }; @@ -259,7 +271,7 @@ inline bool file_lock::timed_lock(const boost::posix_time::ptime &abs_time) { bool result; - if(!detail::timed_acquire_file_lock(m_file_hnd, result, abs_time)){ + if(!timed_acquire_file_lock(m_file_hnd, result, abs_time)){ error_info err(system_error_code()); throw interprocess_exception(err); } @@ -295,7 +307,7 @@ inline bool file_lock::timed_lock_sharable(const boost::posix_time::ptime &abs_time) { bool result; - if(!detail::timed_acquire_file_lock_sharable(m_file_hnd, result, abs_time)){ + if(!timed_acquire_file_lock_sharable(m_file_hnd, result, abs_time)){ error_info err(system_error_code()); throw interprocess_exception(err); }