config.h cleanup (#834)

config.hpp and .travis.yml cleanup
This commit is contained in:
Alden Torres 2016-06-19 02:32:12 -04:00 committed by Arvid Norberg
parent 717ed8bd3b
commit 15bac1e9b5
9 changed files with 44 additions and 76 deletions

View File

@ -1,14 +1,20 @@
language: cpp
os:
- linux
- osx
env:
- variant=test_release coverage=1 docs=1
- variant=test_debug sim=1
- variant=test_barebones
- analyze=1
matrix:
include:
- env: variant=test_release coverage=1
- env: variant=test_debug sim=1
- env: variant=test_barebones
- env: analyze=1
- os: osx
osx_image: xcode6.4
env: variant=test_release docs=1
- os: osx
osx_image: xcode6.4
env: variant=test_debug
- os: osx
osx_image: xcode6.4
env: variant=test_barebones
git:
submodules: false
@ -43,7 +49,7 @@ before_install:
- git submodule update --init --recursive
- 'if [[ $TRAVIS_OS_NAME == "osx" && "$variant" != "" ]]; then brew update > /dev/null && brew install --quiet ccache boost-build boost-python; fi'
- 'if [[ $TRAVIS_OS_NAME == "osx" && "$docs" = "1" ]]; then
- 'if [ "$docs" = "1" ]; then
brew install --quiet https://raw.githubusercontent.com/catap/homebrew/docutils/Library/Formula/docutils.rb;
mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages;
echo ''import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")'' >> /Users/travis/Library/Python/2.7/lib/python/site-packages/homebrew.pth;
@ -57,7 +63,7 @@ before_install:
- if [ $TRAVIS_OS_NAME == "osx" ]; then export toolset="darwin"; export sim="0"; fi
- if [ $TRAVIS_OS_NAME == "osx" ]; then export target="osx-tests"; fi
- if [ $TRAVIS_OS_NAME == "linux" ]; then export toolset="gcc"; fi
- if [[ $TRAVIS_OS_NAME == "linux" && "$coverage" == "1" ]]; then
- if [ "$coverage" == "1" ]; then
export toolset=gcc-coverage;
pip install --user codecov;
fi
@ -78,13 +84,13 @@ install:
- 'echo "using darwin : : ccache clang++ : <cflags>-std=c11 <cxxflags>-std=c++11 <compileflags>-Wno-deprecated-declarations ;" >> ~/user-config.jam'
- 'echo "using python : 2.7 ;" >> ~/user-config.jam'
- 'if [[ "$variant" != "" ]]; then ccache -V && ccache --show-stats && ccache --zero-stats; fi'
- if [[ "$docs" == "1" && $TRAVIS_OS_NAME == "osx" ]]; then rst2html.py --version; fi
- if [ "$docs" == "1" ]; then rst2html.py --version; fi
script:
- cd docs
- 'if [[ "$docs" == "1" && $TRAVIS_OS_NAME == "osx" ]]; then
- 'if [ "$docs" == "1" ]; then
make RST2HTML=rst2html.py;
fi'
- cd ..
@ -94,7 +100,7 @@ script:
- cd test
- 'if [ "$variant" != "" ]; then
bjam -j3 warnings-as-errors=on variant=$variant -l900 $toolset $target &&
if [[ $TRAVIS_OS_NAME == "linux" && "$coverage" == "1" ]]; then
if [ "$coverage" == "1" ]; then
codecov --root .. --gcov-exec gcov-5;
fi;
fi'
@ -135,32 +141,27 @@ script:
# run cppcheck if enabled
- 'if [[ "$analyze" == "1" ]]; then
if [[ $TRAVIS_OS_NAME == "linux" ]]; then
cppcheck --version &&
find src test examples tools -type f | grep ".*\.cpp$" >cppcheck.files &&
find simulation -type f -depth -2 | grep ".*\.cpp$" >>cppcheck.files &&
cppcheck -DTORRENT_USE_IPV6="1" -DTORRENT_USE_I2P="1"
-DTORRENT_USE_OPENSSL="1" -DTORRENT_USE_INVARIANT_CHECKS="1"
-DTORRENT_EXPENSIVE_INVARIANT_CHECKS="1" -DTORRENT_USE_ASSERTS="1"
-UTORRENT_DISABLE_MUTABLE_TORRENTS -UTORRENT_DISABLE_LOGGING
-UTORRENT_DEBUG_BUFFERS -UTORRENT_EXPORT_EXTRA
--suppress=preprocessorErrorDirective
--suppress=noConstructor
--suppress=syntaxError
--enable=style
--template "{file}({line}): {severity} ({id}): {message}"
--inline-suppr --force --std=c++11 -j2 -I include -I /usr/local/include
--file-list=cppcheck.files 2> cppcheck.txt;
if [ -s cppcheck.txt ]; then
echo " ======= CPPCHECK ERRORS =====";
cat cppcheck.txt;
exit 1;
fi;
fi;
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
echo "nothing here yet";
fi;
fi'
cppcheck --version &&
find src test examples tools -type f | grep ".*\.cpp$" >cppcheck.files &&
find simulation -type f -depth -2 | grep ".*\.cpp$" >>cppcheck.files &&
cppcheck -DTORRENT_USE_IPV6="1" -DTORRENT_USE_I2P="1"
-DTORRENT_USE_OPENSSL="1" -DTORRENT_USE_INVARIANT_CHECKS="1"
-DTORRENT_EXPENSIVE_INVARIANT_CHECKS="1" -DTORRENT_USE_ASSERTS="1"
-UTORRENT_DISABLE_MUTABLE_TORRENTS -UTORRENT_DISABLE_LOGGING
-UTORRENT_DEBUG_BUFFERS -UTORRENT_EXPORT_EXTRA
--suppress=preprocessorErrorDirective
--suppress=noConstructor
--suppress=syntaxError
--enable=style
--template "{file}({line}): {severity} ({id}): {message}"
--inline-suppr --force --std=c++11 -j2 -I include -I /usr/local/include
--file-list=cppcheck.files 2> cppcheck.txt;
if [ -s cppcheck.txt ]; then
echo " ======= CPPCHECK ERRORS =====";
cat cppcheck.txt;
exit 1;
fi;
fi'
- 'if [[ "$variant" != "" ]]; then ccache --show-stats; fi'

View File

@ -275,8 +275,6 @@ endif()
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
# this works around a bug in asio in boost-1.39
add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 )
add_definitions(-DBOOST_ASIO_HAS_STD_CHRONO=1 )
if (WIN32)

View File

@ -491,6 +491,7 @@ variant test_release : release
: <asserts>production <debug-symbols>on
<invariant-checks>full <boost-link>shared <optimization>off
<export-extra>on <debug-iterators>on <threading>multi
<inlining>off
;
variant test_debug : debug
: <crypto>openssl <logging>on <disk-stats>on
@ -703,8 +704,6 @@ local usage-requirements =
<define>BOOST_ASIO_ENABLE_CANCELIO
# make sure asio uses std::chrono
<define>BOOST_ASIO_HAS_STD_CHRONO
# this works around a bug in asio in boost-1.39
<define>BOOST_ASIO_HASH_MAP_BUCKETS=1021
<conditional>@linking
# these compiler settings just makes the compiler standard conforming
<toolset>msvc:<cflags>/Zc:wchar_t

View File

@ -79,10 +79,6 @@ POSSIBILITY OF SUCH DAMAGE.
# define TORRENT_DEPRECATED __attribute__ ((deprecated))
# endif
# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 8)
# define TORRENT_NO_ATOMIC_DURATION 1
# endif
// ======= SUNPRO =========
#elif defined __SUNPRO_CC
@ -93,9 +89,6 @@ POSSIBILITY OF SUCH DAMAGE.
#elif defined BOOST_MSVC
#pragma warning(disable: 4258)
#pragma warning(disable: 4251)
// class X needs to have dll-interface to be used by clients of class Y
#pragma warning(disable:4251)
@ -439,12 +432,6 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_NO_FPU 0
#endif
// defined to 1 if the compiler does not support putting
// std::chrono::time_point in a std::atomic (which it's supposed to)
#ifndef TORRENT_NO_ATOMIC_DURATION
#define TORRENT_NO_ATOMIC_DURATION 0
#endif
#ifndef TORRENT_USE_IOSTREAM
#ifndef BOOST_NO_IOSTREAM
#define TORRENT_USE_IOSTREAM 1

View File

@ -361,7 +361,7 @@ namespace libtorrent
void set_share_mode(bool s);
bool share_mode() const { return m_share_mode; }
// TOOD: make graceful pause also finish all sending blocks
// TODO: make graceful pause also finish all sending blocks
// before disconnecting
bool graceful_pause() const { return m_graceful_pause_mode; }

View File

@ -69,7 +69,7 @@ namespace libtorrent
public:
// this is the constructor where the we are the active part.
// The peer_conenction should handshake and verify that the
// The peer_connection should handshake and verify that the
// other end has the correct id
web_peer_connection(peer_connection_args const& pack
, web_seed_t& web);

View File

@ -31,8 +31,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "libtorrent/config.hpp"
#include <cstring>
#include "libtorrent/aux_/cpuid.hpp"
#if defined _MSC_VER && TORRENT_HAS_SSE
@ -89,5 +87,3 @@ namespace libtorrent { namespace aux
bool sse42_support = supports_sse42();
bool mmx_support = supports_mmx();
} }

View File

@ -35,8 +35,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/socket_type.hpp"
#include "libtorrent/utp_socket_manager.hpp"
#include "libtorrent/instantiate_connection.hpp"
#include <boost/shared_ptr.hpp>
#include <stdexcept>
namespace libtorrent
{

View File

@ -30,7 +30,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "libtorrent/time.hpp"
#include "libtorrent/aux_/time.hpp"
#include <atomic>
@ -39,20 +38,10 @@ namespace libtorrent { namespace aux
// used to cache the current time regularly (update_time_now() is called by
// the session_impl main thread). This is cheaper than a system call and can
// be used where more accurate time is not necessary
#if !TORRENT_NO_ATOMIC_DURATION
namespace {
std::atomic<time_point> g_current_time(clock_type::now());
}
time_point time_now() { return aux::g_current_time.load(); }
void update_time_now() { g_current_time.store(clock_type::now()); }
#else
// work-around for not being able to put time_point in std::atomic
namespace {
std::atomic<time_duration::rep> g_current_time(clock_type::now().time_since_epoch().count());
}
time_point time_now() { return time_point(clock_type::duration(aux::g_current_time.load())); }
void update_time_now() { g_current_time.store(clock_type::now().time_since_epoch().count()); }
#endif
} }