Skip to content

Commit

Permalink
Fix travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
Alik Aslanyan authored and In-line committed Apr 18, 2018
1 parent 6dd8231 commit 8498c77
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
14 changes: 6 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ addons:
apt:
sources:
- ubuntu-toolchain-r-test
- george-edison55/cmake-3.x
packages:
- gcc-6
- g++-6
- gcc-7
- g++-7
- gcc-7-multilib
- g++-7-multilib
- libboost-dev
- gcc-multilib
- gcc-6-multilib
- g++-multilib
- g++-6-multilib
- libc6-dev-i386
- libc6-i386
- linux-libc-dev:i386
- cxxtest
- cmake

Expand All @@ -29,7 +27,7 @@ before_install:
- lsb_release -c
- lsb_release -r
install:
- if [ "$CXX" = "g++" ]; then export CXX="g++-6" CC="gcc-6"; fi
- if [ "$CXX" = "g++" ]; then export CXX="g++-7" CC="gcc-7"; fi
before_script:
- cmake --version
- cmake .
Expand Down
30 changes: 20 additions & 10 deletions src/helper/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,31 @@
#define COLD
#endif

#include <boost/smart_ptr/local_shared_ptr.hpp>
#include <boost/smart_ptr/make_local_shared.hpp>
#if __has_include(<boost/smart_ptr/local_shared_ptr.hpp>)
#include <boost/smart_ptr/local_shared_ptr.hpp>
#include <boost/smart_ptr/make_local_shared.hpp>

namespace up
{
template<typename T>
using shared_ptr = boost::local_shared_ptr<T>;
namespace up
{
template<typename T>
using shared_ptr = boost::local_shared_ptr<T>;

template<class T, class... Args>
inline auto make_shared(Args&&... args)
template<class T, class... Args>
inline auto make_shared(Args&&... args)
{
return boost::make_local_shared<T>(std::forward<Args>(args)...);
}
}
#else
#include <memory>

namespace up
{
return boost::make_local_shared<T>(std::forward<Args>(args)...);
using std::shared_ptr;
using std::make_shared;
}
#endif

}
// Here we can put typedefs that shared by many files

#endif // SHARED_H

0 comments on commit 8498c77

Please sign in to comment.