summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml6
-rw-r--r--include/astra/Singleton.h8
-rw-r--r--src/AstraObjectFactory.cpp6
-rw-r--r--src/AstraObjectManager.cpp16
4 files changed, 21 insertions, 15 deletions
diff --git a/.travis.yml b/.travis.yml
index 58c7e0a..d6f7976 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,6 +21,11 @@ env:
- CUDA=yes
- CUDA=no
+matrix:
+ include:
+ - env: CUDA=no CLANG=yes
+ python: "3.5"
+
before_install:
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
@@ -37,6 +42,7 @@ install:
- conda info -a
- cd build/linux
- ./autogen.sh
+ - if [ x$CLANG == xyes ]; then export CXX=clang++; export CC=clang; fi
- if [ $CUDA == yes ]; then ./configure --prefix=$HOME/astra --with-python --with-cuda --with-install-type=module; else ./configure --prefix=$HOME/astra --with-python --without-cuda --with-install-type=module; fi
- make -j 4
- make install
diff --git a/include/astra/Singleton.h b/include/astra/Singleton.h
index 9d3c088..7271691 100644
--- a/include/astra/Singleton.h
+++ b/include/astra/Singleton.h
@@ -82,15 +82,15 @@ class Singleton {
// libastra. This situation would cause issues when .mex files are unloaded.
#define DEFINE_SINGLETON(T) \
-template<> void Singleton<T >::construct() { assert(!m_singleton); m_singleton = new T(); } \
-template<> T* Singleton<T >::m_singleton = 0
+template<> T* Singleton<T >::m_singleton = 0; \
+template<> void Singleton<T >::construct() { assert(!m_singleton); m_singleton = new T(); }
// This is a hack to support statements like
// DEFINE_SINGLETON2(CTemplatedClass<C1, C2>);
#define DEFINE_SINGLETON2(A,B) \
-template<> void Singleton<A,B >::construct() { assert(!m_singleton); m_singleton = new A,B(); } \
-template<> A,B* Singleton<A,B >::m_singleton = 0
+template<> A,B* Singleton<A,B >::m_singleton = 0; \
+template<> void Singleton<A,B >::construct() { assert(!m_singleton); m_singleton = new A,B(); }
} // end namespace
diff --git a/src/AstraObjectFactory.cpp b/src/AstraObjectFactory.cpp
index 35132d0..1dda3b2 100644
--- a/src/AstraObjectFactory.cpp
+++ b/src/AstraObjectFactory.cpp
@@ -32,8 +32,8 @@ using namespace std;
namespace astra {
-DEFINE_SINGLETON2(CAstraObjectFactory<CAlgorithm, AlgorithmTypeList>);
-DEFINE_SINGLETON2(CAstraObjectFactory<CProjector2D, Projector2DTypeList>);
-DEFINE_SINGLETON2(CAstraObjectFactory<CProjector3D, Projector3DTypeList>);
+DEFINE_SINGLETON2(CAstraObjectFactory<CAlgorithm, AlgorithmTypeList>)
+DEFINE_SINGLETON2(CAstraObjectFactory<CProjector2D, Projector2DTypeList>)
+DEFINE_SINGLETON2(CAstraObjectFactory<CProjector3D, Projector3DTypeList>)
} // end namespace
diff --git a/src/AstraObjectManager.cpp b/src/AstraObjectManager.cpp
index 46eae4b..3b818d3 100644
--- a/src/AstraObjectManager.cpp
+++ b/src/AstraObjectManager.cpp
@@ -31,13 +31,13 @@ $Id$
namespace astra {
-DEFINE_SINGLETON(CProjector2DManager);
-DEFINE_SINGLETON(CProjector3DManager);
-DEFINE_SINGLETON(CData2DManager);
-DEFINE_SINGLETON(CData3DManager);
-DEFINE_SINGLETON(CAlgorithmManager);
-DEFINE_SINGLETON(CMatrixManager);
-
-DEFINE_SINGLETON(CAstraIndexManager);
+DEFINE_SINGLETON(CProjector2DManager)
+DEFINE_SINGLETON(CProjector3DManager)
+DEFINE_SINGLETON(CData2DManager)
+DEFINE_SINGLETON(CData3DManager)
+DEFINE_SINGLETON(CAlgorithmManager)
+DEFINE_SINGLETON(CMatrixManager)
+
+DEFINE_SINGLETON(CAstraIndexManager)
} // end namespace