From 076eeffd4d63264301735bc813d27cc82fe419d8 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 8 Oct 2013 19:13:10 +0400 Subject: [PATCH] ocl: fix CL_RUNTIME_EXPORT for master branch --- modules/ocl/src/cl_runtime/cl_runtime.cpp | 7 ------- modules/ocl/src/match_template.cpp | 2 +- modules/ocl/src/precomp.hpp | 8 +++++++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/ocl/src/cl_runtime/cl_runtime.cpp b/modules/ocl/src/cl_runtime/cl_runtime.cpp index c237afe74..6752467cb 100644 --- a/modules/ocl/src/cl_runtime/cl_runtime.cpp +++ b/modules/ocl/src/cl_runtime/cl_runtime.cpp @@ -2,13 +2,6 @@ #if defined(HAVE_OPENCL) && (!defined(__APPLE__) || defined(IOS)) -#if defined(BUILD_SHARED_LIBS) && (defined WIN32 || defined _WIN32 || defined WINCE) -#define CL_RUNTIME_EXPORT __declspec(dllexport) -#else -#define CL_RUNTIME_EXPORT -#endif - - #include "opencv2/ocl/cl_runtime/cl_runtime.hpp" #if defined(__APPLE__) diff --git a/modules/ocl/src/match_template.cpp b/modules/ocl/src/match_template.cpp index cbcd6b380..9720c7421 100644 --- a/modules/ocl/src/match_template.cpp +++ b/modules/ocl/src/match_template.cpp @@ -91,7 +91,7 @@ namespace cv static bool useNaive(int method, int depth, Size size) { #ifdef HAVE_CLAMDFFT - if (method == TM_SQDIFF && (depth == CV_32F || !Context::getContext()->supportsFeature(Context::CL_DOUBLE))) + if (method == TM_SQDIFF && (depth == CV_32F || !Context::getContext()->supportsFeature(FEATURE_CL_DOUBLE))) { return true; } diff --git a/modules/ocl/src/precomp.hpp b/modules/ocl/src/precomp.hpp index 140dcdb9d..b7ef58b1f 100644 --- a/modules/ocl/src/precomp.hpp +++ b/modules/ocl/src/precomp.hpp @@ -58,8 +58,14 @@ #include "cvconfig.h" -#if defined(BUILD_SHARED_LIBS) && (defined WIN32 || defined _WIN32 || defined WINCE) +#if defined(BUILD_SHARED_LIBS) +#if defined WIN32 || defined _WIN32 || defined WINCE #define CL_RUNTIME_EXPORT __declspec(dllexport) +#elif defined __GNUC__ && __GNUC__ >= 4 +#define CL_RUNTIME_EXPORT __attribute__ ((visibility ("default"))) +#else +#define CL_RUNTIME_EXPORT +#endif #else #define CL_RUNTIME_EXPORT #endif