Skip to content

Commit

Permalink
Remove more references to Boost from logging code
Browse files Browse the repository at this point in the history
- this makes things compile with clang compile-only plugin for VS
  • Loading branch information
hkaiser committed Jan 1, 2018
1 parent a5ac8fc commit 03e291f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
1 change: 0 additions & 1 deletion hpx/util/logging/defaults.hpp
Expand Up @@ -24,7 +24,6 @@
#include <hpx/util/logging/detail/ts/ts.hpp>

#include <string>
#include <boost/config.hpp>

namespace hpx { namespace util { namespace logging {

Expand Down
13 changes: 6 additions & 7 deletions hpx/util/logging/detail/cache_before_init.hpp
Expand Up @@ -33,26 +33,24 @@
#include <utility>
#include <vector>

#if defined (BOOST_HAS_WINTHREADS)
#if defined (HPX_WINDOWS)
#include <windows.h>
#endif

namespace hpx { namespace util { namespace logging { namespace detail {


#if defined (BOOST_HAS_WINTHREADS)
#if defined (HPX_WINDOWS)
typedef DWORD thread_id_type;
#elif defined (BOOST_HAS_PTHREADS)
typedef pthread_t thread_id_type;
#else
#error Unknown threading type
typedef pthread_t thread_id_type;
#endif

inline thread_id_type get_thread_id()
{
#if defined (BOOST_HAS_WINTHREADS)
#if defined (HPX_WINDOWS)
return ::GetCurrentThreadId();
#elif defined (BOOST_HAS_PTHREADS)
#else
return pthread_self ();
#endif
}
Expand All @@ -66,6 +64,7 @@ struct thread_info {

#if defined( HPX_LOG_BEFORE_INIT_USE_CACHE_FILTER) \
|| defined( HPX_LOG_BEFORE_INIT_USE_LOG_ALL)

//////////////////////////////////////////////////////////////////
// Messages that were logged before initializing the log - Caching them

Expand Down
7 changes: 3 additions & 4 deletions hpx/util/logging/format/formatter/thread_id.hpp
Expand Up @@ -21,6 +21,7 @@
# pragma once
#endif

#include <hpx/config.hpp>
#include <hpx/util/logging/detail/fwd.hpp>
#include <hpx/util/logging/format/formatter/convert_format.hpp>
#include <hpx/util/logging/detail/manipulator.hpp> // is_generic
Expand All @@ -43,12 +44,10 @@ hpx::util::logging::op_equal::always_equal {
template<class msg_type> void operator()(msg_type & msg) const {
std::basic_ostringstream<char_type> out;
out
#if defined (BOOST_HAS_WINTHREADS)
#if defined (HPX_WINDOWS)
<< ::GetCurrentThreadId()
#elif defined (BOOST_HAS_PTHREADS)
#else
<< pthread_self ()
#elif defined (BOOST_HAS_MPTASKS)
<< MPCurrentTaskID()
#endif
;

Expand Down
13 changes: 5 additions & 8 deletions hpx/util/logging/tag/defaults.hpp
Expand Up @@ -21,10 +21,9 @@
# pragma once
#endif

#include <hpx/config.hpp>
#include <hpx/util/logging/detail/fwd.hpp>
#include <hpx/util/logging/logging.hpp>
//#include <boost/thread/detail/config.hpp>
#include <boost/config.hpp>

namespace hpx { namespace util { namespace logging { namespace tag {

Expand Down Expand Up @@ -84,18 +83,16 @@ See @ref hpx::util::logging::tag "how to use tags".
*/
struct thread_id {
thread_id() {
#if defined (BOOST_HAS_WINTHREADS)
#if defined (HPX_WINDOWS)
val = ::GetCurrentThreadId();
#elif defined (BOOST_HAS_PTHREADS)
val = pthread_self ();
#else
#error Unknown type of threads
val = pthread_self ();
#endif
}

#if defined (BOOST_HAS_WINTHREADS)
#if defined (HPX_WINDOWS)
DWORD val;
#elif defined (BOOST_HAS_PTHREADS)
#else
pthread_t val;
#endif
};
Expand Down

0 comments on commit 03e291f

Please sign in to comment.