Fix building as shared library with MSVC.
This commit is contained in:
1 parent
0de60d8e7e
commit
c0e582e659
6 files changed
+22
-3
No files matched your search
@@ -296,13 +296,13 @@ namespace Catch {
|
||||
template<>
|
||||
struct StringMaker<float> {
|
||||
static std::string convert(float value);
|
||||
static int precision;
|
||||
CATCH_EXPORT static int precision;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct StringMaker<double> {
|
||||
static std::string convert(double value);
|
||||
static int precision;
|
||||
CATCH_EXPORT static int precision;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -181,6 +181,8 @@
|
||||
#cmakedefine CATCH_CONFIG_PREFIX_ALL
|
||||
#cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG
|
||||
|
||||
#cmakedefine CATCH_CONFIG_SHARED_LIBRARY
|
||||
|
||||
|
||||
// ------
|
||||
// "Variable" defines, these have actual values
|
||||
|
||||
@@ -382,5 +382,15 @@
|
||||
# define CATCH_CONFIG_COLOUR_WIN32
|
||||
#endif
|
||||
|
||||
#if defined( CATCH_CONFIG_SHARED_LIBRARY ) && defined( _MSC_VER ) && \
|
||||
!defined( CATCH_CONFIG_STATIC )
|
||||
# ifdef Catch2_EXPORTS
|
||||
# define CATCH_EXPORT //__declspec( dllexport ) // not needed
|
||||
# else
|
||||
# define CATCH_EXPORT __declspec( dllimport )
|
||||
# endif
|
||||
#else
|
||||
# define CATCH_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
|
||||
@@ -8,6 +8,8 @@
|
||||
#ifndef CATCH_CONTEXT_HPP_INCLUDED
|
||||
#define CATCH_CONTEXT_HPP_INCLUDED
|
||||
|
||||
#include <catch2/internal/catch_compiler_capabilities.hpp>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
class IResultCapture;
|
||||
@@ -28,7 +30,7 @@ namespace Catch {
|
||||
virtual void setConfig( IConfig const* config ) = 0;
|
||||
|
||||
private:
|
||||
static IMutableContext *currentContext;
|
||||
CATCH_EXPORT static IMutableContext* currentContext;
|
||||
friend IMutableContext& getCurrentMutableContext();
|
||||
friend void cleanUpContext();
|
||||
static void createContext();
|
||||
|
||||
Reference in new issue
Block a user