diff --git a/base/basictypes.h b/base/basictypes.h index 58a858625e..e54af02ad6 100644 --- a/base/basictypes.h +++ b/base/basictypes.h @@ -3,6 +3,18 @@ #include #include // for byte swapping +#ifdef _WIN32 +// We need this to compile without hundreds of std::bind errors in Visual Studio 2012 +// since by default VARIADIC_MAX is something low like 3, 4, or 5. +// It's a good idea to include this file wherever std::bind is being used with more than 3, 4 or 5 args. +// Visual Studio 2013 doesn't need this after all, so we can simply check for equality. +#if _MSC_VER == 1700 + #undef _VARIADIC_MAX + #define _VARIADIC_MAX 10 + #endif + +#endif + #ifdef _WIN32 #pragma warning(disable:4244) #pragma warning(disable:4996) diff --git a/thread/thread.h b/thread/thread.h index 58d60b725f..1a1b37615d 100644 --- a/thread/thread.h +++ b/thread/thread.h @@ -245,7 +245,17 @@ private: void Run() { func(); } private: -// Visual Studio 2012 needs this, or else it complains about losing const-volatile qualifiers. +// Both Visual Studio 2012 & 2013 need the following ifdef, or else they complain about losing const-volatile qualifiers: +// Error 23 error C3848: expression having type 'const std::_Bind' would lose some const-volatile qualifiers in order to call 'void std::_Bind::operator ()<>(void)' (thread\prioritizedworkqueue.cpp) + +// Error 24 error C3848: expression having type 'const std::_Bind,WorkerThread *const >' +// would lose some const-volatile qualifiers in order to call +// 'void std::_Bind,WorkerThread *const >::operator ()<>(void)' (thread\threadpool.cpp) + +// Error 25 error C3848 : expression having type 'const std::_Bind),void,http::Download,std::shared_ptr>,http::Download *const ,std::shared_ptr &>' +// would lose some const - volatile qualifiers in order to call +// 'void std::_Bind),void,http::Download,std::shared_ptr>,http::Download *const ,std::shared_ptr &>::operator ()<>(void)' (net\http_client.cpp) #if _MSC_VER >= 1700 C func; #else