From 09f3e22390b4eb909547578f1e62f7ed988defb5 Mon Sep 17 00:00:00 2001 From: Coos Baakman Date: Tue, 16 Oct 2018 09:19:46 +0200 Subject: [PATCH] always use the atomic class from the standard library --- README.md | 3 +++ src/progress.cpp | 34 ---------------------------------- src/progress.h | 32 -------------------------------- 3 files changed, 3 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index c085c6c..0e7d6e8 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,9 @@ Pre-compiled *old* versions of DSSP are available from the ### Pre-requisites +Compiler: +* Must support at least the c++ 11 standard. + System libraries: * libzeep version >= 3.0 (for mkhssp --fetch-dbrefs only) diff --git a/src/progress.cpp b/src/progress.cpp index 4a9bb65..f1fab47 100644 --- a/src/progress.cpp +++ b/src/progress.cpp @@ -29,38 +29,6 @@ #include "progress.h" -#ifdef _MSC_VER - -#include - -uint32 get_terminal_width() -{ - return TERM_WIDTH; -} - -int64 MCounter::operator++(int) -{ - return ::InterlockedExchangeAdd64(&m_value, 1); -} - -int64 MCounter::operator+=(int64 inValue) -{ - return ::InterlockedExchangeAdd64(&m_value, inValue); -} - -int64 MCounter::operator=(int64 inValue) -{ - ::InterlockedExchange64(&m_value, inValue); - return inValue; -} - -// -------------------------------------------------------------------- - -#define STDOUT_FILENO 1 -bool isatty(int) { return true; } - -#else - uint32 get_terminal_width() { struct winsize w; @@ -68,8 +36,6 @@ uint32 get_terminal_width() return w.ws_col; } -#endif - struct MProgressImpl { MProgressImpl(int64 inMax, const std::string& inAction) diff --git a/src/progress.h b/src/progress.h index 49106ae..c4a0e28 100644 --- a/src/progress.h +++ b/src/progress.h @@ -6,40 +6,8 @@ #pragma once -#if defined(__linux__) - -#if defined(__INTEL_COMPILER_BUILD_DATE) || \ - (defined(__GNUC__) && (__GNUC__ > 4 || \ - ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6))) #include typedef std::atomic MCounter; -#else -#include -typedef boost::detail::atomic_count MCounter; -#endif - -#else - -struct MCounter -{ - MCounter(int64 inValue) : m_value(inValue) {} - - operator int64() const { return m_value; } - - int64 operator++(int); - int64 operator+=(int64 inValue); - int64 operator=(int64 inValue); - - int64 m_value; -}; - - -//typedef int64 MCounter; -// -//int64 add(MCounter& ioCounter, int64 inIncrement); -//int64 set(MCounter& ioCounter, int64 inValue); - -#endif // --------------------------------------------------------------------