From 2fbb9932b0f517643c5f05e4056b939b73956b00 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 26 Oct 2010 16:38:51 +0200 Subject: fix compilation (bad internal:: stuff) --- unsupported/Eigen/OpenGLSupport | 91 +++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 44 deletions(-) (limited to 'unsupported/Eigen/OpenGLSupport') diff --git a/unsupported/Eigen/OpenGLSupport b/unsupported/Eigen/OpenGLSupport index b967f0d7a..0f09cee14 100644 --- a/unsupported/Eigen/OpenGLSupport +++ b/unsupported/Eigen/OpenGLSupport @@ -56,39 +56,45 @@ namespace Eigen { //@{ #define EIGEN_GL_FUNC_DECLARATION(FUNC) \ -template< typename XprType, \ - typename Scalar = typename XprType::Scalar, \ - int Rows = XprType::RowsAtCompileTime, \ - int Cols = XprType::ColsAtCompileTime, \ - bool IsGLCompatible = bool(XprType::Flags&LinearAccessBit) \ - && bool(XprType::Flags&DirectAccessBit) \ - && (XprType::IsVectorAtCompileTime || (XprType::Flags&RowMajorBit)==0)> \ -struct EIGEN_CAT(EIGEN_CAT(internal::gl_,FUNC),_impl); \ +namespace internal { \ + template< typename XprType, \ + typename Scalar = typename XprType::Scalar, \ + int Rows = XprType::RowsAtCompileTime, \ + int Cols = XprType::ColsAtCompileTime, \ + bool IsGLCompatible = bool(XprType::Flags&LinearAccessBit) \ + && bool(XprType::Flags&DirectAccessBit) \ + && (XprType::IsVectorAtCompileTime || (XprType::Flags&RowMajorBit)==0)> \ + struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl); \ \ -template \ -struct EIGEN_CAT(EIGEN_CAT(internal::gl_,FUNC),_impl) { \ - inline static void run(const XprType& p) { \ - EIGEN_CAT(EIGEN_CAT(internal::gl_,FUNC),_impl)::type>::run(p); } \ -}; \ + template \ + struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl) { \ + inline static void run(const XprType& p) { \ + EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl)::type>::run(p); } \ + }; \ +} \ \ template inline void FUNC(const Eigen::DenseBase& p) { \ - EIGEN_CAT(EIGEN_CAT(internal::gl_,FUNC),_impl)::run(p.derived()); \ + EIGEN_CAT(EIGEN_CAT(internal::gl_,FUNC),_impl)::run(p.derived()); \ } #define EIGEN_GL_FUNC_SPECIALIZATION_MAT(FUNC,SCALAR,ROWS,COLS,SUFFIX) \ - template< typename XprType> struct EIGEN_CAT(EIGEN_CAT(internal::gl_,FUNC),_impl) { \ +namespace internal { \ + template< typename XprType> struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl) { \ inline static void run(const XprType& p) { FUNC##SUFFIX(p.data()); } \ - }; + }; \ +} #define EIGEN_GL_FUNC_SPECIALIZATION_VEC(FUNC,SCALAR,SIZE,SUFFIX) \ - template< typename XprType> struct EIGEN_CAT(EIGEN_CAT(internal::gl_,FUNC),_impl) { \ +namespace internal { \ + template< typename XprType> struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl) { \ inline static void run(const XprType& p) { FUNC##SUFFIX(p.data()); } \ }; \ - template< typename XprType> struct EIGEN_CAT(EIGEN_CAT(internal::gl_,FUNC),_impl) { \ + template< typename XprType> struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl) { \ inline static void run(const XprType& p) { FUNC##SUFFIX(p.data()); } \ - }; + }; \ +} EIGEN_GL_FUNC_DECLARATION (glVertex) @@ -202,47 +208,44 @@ template void glRotate(const RotationBase& rot) #define EIGEN_GL_EVAL(X) X #define EIGEN_GL_FUNC1_DECLARATION(FUNC,ARG1,CONST) \ +namespace internal { \ + template< typename XprType, \ + typename Scalar = typename XprType::Scalar, \ + int Rows = XprType::RowsAtCompileTime, \ + int Cols = XprType::ColsAtCompileTime, \ + bool IsGLCompatible = bool(XprType::Flags&LinearAccessBit) \ + && bool(XprType::Flags&DirectAccessBit) \ + && (XprType::IsVectorAtCompileTime || (XprType::Flags&RowMajorBit)==0)> \ + struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl); \ \ -namespace internal { \ - \ -template< typename XprType, \ - typename Scalar = typename XprType::Scalar, \ - int Rows = XprType::RowsAtCompileTime, \ - int Cols = XprType::ColsAtCompileTime, \ - bool IsGLCompatible = bool(XprType::Flags&LinearAccessBit) \ - && bool(XprType::Flags&DirectAccessBit) \ - && (XprType::IsVectorAtCompileTime || (XprType::Flags&RowMajorBit)==0)> \ -struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl); \ - \ -template \ -struct EIGEN_CAT(EIGEN_CAT(internal::gl_,FUNC),_impl) { \ - inline static void run(ARG1 a,EIGEN_GL_EVAL(EIGEN_GL_MAKE_CONST_##CONST) XprType& p) { \ - EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl)::type>::run(a,p); } \ -}; \ - \ -} // end namespace internal \ + template \ + struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl) { \ + inline static void run(ARG1 a,EIGEN_GL_EVAL(EIGEN_GL_MAKE_CONST_##CONST) XprType& p) { \ + EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl)::type>::run(a,p); } \ + }; \ +} \ \ template inline void FUNC(ARG1 a,EIGEN_GL_EVAL(EIGEN_GL_MAKE_CONST_##CONST) Eigen::DenseBase& p) { \ - EIGEN_CAT(EIGEN_CAT(internal::gl_,FUNC),_impl)::run(a,p.derived()); \ + EIGEN_CAT(EIGEN_CAT(internal::gl_,FUNC),_impl)::run(a,p.derived()); \ } #define EIGEN_GL_FUNC1_SPECIALIZATION_MAT(FUNC,ARG1,CONST,SCALAR,ROWS,COLS,SUFFIX) \ -namespace internal { \ - template< typename XprType> struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl) { \ +namespace internal { \ + template< typename XprType> struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl) { \ inline static void run(ARG1 a, EIGEN_GL_EVAL(EIGEN_GL_MAKE_CONST_##CONST) XprType& p) { FUNC##SUFFIX(a,p.data()); } \ }; \ } #define EIGEN_GL_FUNC1_SPECIALIZATION_VEC(FUNC,ARG1,CONST,SCALAR,SIZE,SUFFIX) \ -namespace internal { \ - template< typename XprType> struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl) { \ +namespace internal { \ + template< typename XprType> struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl) { \ inline static void run(ARG1 a, EIGEN_GL_EVAL(EIGEN_GL_MAKE_CONST_##CONST) XprType& p) { FUNC##SUFFIX(a,p.data()); } \ }; \ - template< typename XprType> struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl) { \ + template< typename XprType> struct EIGEN_CAT(EIGEN_CAT(gl_,FUNC),_impl) { \ inline static void run(ARG1 a, EIGEN_GL_EVAL(EIGEN_GL_MAKE_CONST_##CONST) XprType& p) { FUNC##SUFFIX(a,p.data()); } \ - }; \ + }; \ } EIGEN_GL_FUNC1_DECLARATION (glGet,GLenum,_) -- cgit v1.2.3