Fix visibility of g_linked_ptr_mutex on Windows
authorLeszek Swirski <leszek@swirski.co.uk>
Wed, 15 May 2013 13:42:28 +0000 (14:42 +0100)
committerLeszek Swirski <leszek@swirski.co.uk>
Wed, 15 May 2013 13:42:28 +0000 (14:42 +0100)
Reverts some changes in b8ed00bd642971877e1dfda6e0815d7211a7ace2

modules/ts/include/opencv2/ts.hpp
modules/ts/include/opencv2/ts/ts_gtest.h
modules/ts/include/opencv2/ts/ts_perf.hpp

index b0416da..2cd0776 100644 (file)
@@ -4,6 +4,14 @@
 #include "opencv2/core/cvdef.h"
 #include <stdarg.h> // for va_list
 
+#include "cvconfig.h"
+
+#ifndef GTEST_CREATE_SHARED_LIBRARY
+#ifdef BUILD_SHARED_LIBS
+#define GTEST_LINKED_AS_SHARED_LIBRARY 1
+#endif
+#endif
+
 #ifdef _MSC_VER
 #pragma warning( disable: 4127 )
 #endif
index 4bce308..3ccf485 100644 (file)
@@ -1912,7 +1912,19 @@ using ::std::tuple_size;
 
 #endif  // GTEST_HAS_SEH
 
-#define GTEST_API_ CV_EXPORTS
+#ifdef _MSC_VER
+
+# if GTEST_LINKED_AS_SHARED_LIBRARY
+#  define GTEST_API_ __declspec(dllimport)
+# elif GTEST_CREATE_SHARED_LIBRARY
+#  define GTEST_API_ __declspec(dllexport)
+# endif
+
+#endif  // _MSC_VER
+
+#ifndef GTEST_API_
+# define GTEST_API_ CV_EXPORTS
+#endif
 
 #ifdef __GNUC__
 // Ask the compiler to never inline a given function.
index 93e5d28..2f55576 100644 (file)
@@ -1,6 +1,14 @@
 #ifndef __OPENCV_TS_PERF_HPP__
 #define __OPENCV_TS_PERF_HPP__
 
+#include "cvconfig.h"
+
+#ifndef GTEST_CREATE_SHARED_LIBRARY
+#  ifdef BUILD_SHARED_LIBS
+#    define GTEST_LINKED_AS_SHARED_LIBRARY 1
+#  endif
+#endif
+
 #include "opencv2/core.hpp"
 #include "ts_gtest.h"