fork
Fork of cpputest by
Diff: include/CppUTest/CppUTestConfig.h
- Revision:
- 1:4769360130ed
- Parent:
- 0:0b799af9d58e
diff -r 0b799af9d58e -r 4769360130ed include/CppUTest/CppUTestConfig.h --- a/include/CppUTest/CppUTestConfig.h Tue Jan 28 09:27:41 2014 +0000 +++ b/include/CppUTest/CppUTestConfig.h Tue Jun 17 15:52:54 2014 +0100 @@ -62,8 +62,7 @@ #endif #endif - -#if NEED_TO_ENABLE_CPP_SUPPORT /* disabled by default because mbed's +#if NEED_TO_ENABLE_CPP_SUPPORT /* disabled by default because our * toolchain doesn't support exceptions. */ /* Do we use Standard C++ or not? */ #ifndef CPPUTEST_USE_STD_CPP_LIB @@ -124,17 +123,27 @@ #endif #else #define UT_THROW(exception) - #define UT_NOTHROW + #ifdef __clang__ + #define UT_NOTHROW throw() + #else + #define UT_NOTHROW + #endif #endif /* - * CLang's operator delete requires an NOTHROW block. For now, when we use CLang, then have an empty exception specifier. - * However, this ought to be done inside the configure.ac in the future. + * Visual C++ doesn't define __cplusplus as C++11 yet (201103), however it doesn't want the throw(exception) either, but + * it does want throw(). */ -#ifdef __clang__ -#undef UT_NOTHROW -#define UT_NOTHROW throw() +#ifdef _MSC_VER + #undef UT_THROW + #define UT_THROW(exception) +#endif + +#if defined(__cplusplus) && __cplusplus >= 201103L + #define DEFAULT_COPY_CONSTRUCTOR(classname) classname(const classname &) = default; +#else + #define DEFAULT_COPY_CONSTRUCTOR(classname) #endif /* @@ -163,7 +172,8 @@ #endif #endif -#if defined(__cplusplus) && __cplusplus >= 201103L +/* Visual C++ 10.0+ (2010+) supports the override keyword, but doesn't define the C++ version as C++11 */ +#if defined(__cplusplus) && ((__cplusplus >= 201103L) || (defined(_MSC_VER) && (_MSC_VER >= 1600))) #define _override override #else #define _override