From 56957324a7ab8ba76950f96d6c2e6b97fe50ac39 Mon Sep 17 00:00:00 2001 From: Edward Rosten Date: Tue, 13 Aug 2013 14:08:37 +0100 Subject: [PATCH] Add in warning for VS2012 compile errors This is to do with the maximum tuple size. http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx --- doc/tag.h | 24 ++++++++++++++++++++---- src/polynomial.cc | 10 ++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/doc/tag.h b/doc/tag.h index 068abb9..f20b469 100644 --- a/doc/tag.h +++ b/doc/tag.h @@ -28,10 +28,10 @@ Why use this library ? @section sDownload Getting the code and installing -To get the code from cvs use: +To get the code from use: @code -cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/toon co tag +git clone git://github.com/edrosten/tag.git @endcode @subsection unix Unix @@ -52,8 +52,24 @@ library and binary files (for DLLs). - @c LIBDIR contains library files. tag static libraries (debug and release verions) will be copied into @c \%LIBDIR\% - @c BINDIR is not used for tag, but would be the default directory for DLLs + +@subsubsection vs2012 Visual Studio 2012 + +By default the compile fails on VS 2012. This is because visual studio does not yet +support variadic templates but simulates them with multiply included headers. The maximum +depth for templates has been reduced from 10 to 5 in VS 2012. + +To correct, you need to set the macro _VARIADIC_MAX to 10. + +This is covered in more detail here: + +http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx + + + @section sLinks Links - - TooN - http://mi.eng.cam.ac.uk/~twd20/TooN/html/index.html - - CVS web interface - http://cvs.savannah.gnu.org/viewvc/tag/?root=toon + - TooN - http://www.edwardrosten.com/cvd/toon.html + + */ diff --git a/src/polynomial.cc b/src/polynomial.cc index 6d4f829..ad0d883 100644 --- a/src/polynomial.cc +++ b/src/polynomial.cc @@ -21,6 +21,16 @@ inline bool signbit( const double & d ){ } #endif +//Check for VisualStudio and variadic template hacks. + +#ifdef _MSC_VER + #if _VARIADIC_MAX < 10 + #error Visual Studio does not yet support variadic templates properly. Please define _VARIADIC_MAX project wide to 10 + #error Visit http:/blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx for more information. + #endif +#endif + + template Vector poly_mul(const Vector& a, const Vector& b) { //Polynomials are stored with the coefficient of zero in the first