Commit bf0765fc authored by Andrey Golubev's avatar Andrey Golubev Committed by Alexander Alekhin

Merge pull request #15282 from andrey-golubev:rename_argkind_opaque

* G-API: rename ArgKind OPAQUE to GOPAQUE

Rename ArgKind value to GOPAQUE to fix conflict in the
user code when wingdi.h is included: it defines OPAQUE
macro that (for some reason) is chosen instead of ArgKind
value

* Add compatibility with existing API

* Renamed GOPAQUE to OPAQUE_VAL
parent 183fc43a
...@@ -76,7 +76,7 @@ public: ...@@ -76,7 +76,7 @@ public:
return util::unsafe_any_cast<typename std::remove_reference<T>::type>(value); return util::unsafe_any_cast<typename std::remove_reference<T>::type>(value);
} }
detail::ArgKind kind = detail::ArgKind::OPAQUE; detail::ArgKind kind = detail::ArgKind::OPAQUE_VAL;
protected: protected:
util::any value; util::any value;
......
...@@ -26,7 +26,11 @@ namespace detail ...@@ -26,7 +26,11 @@ namespace detail
// a double dispatch // a double dispatch
enum class ArgKind: int enum class ArgKind: int
{ {
OPAQUE, // Unknown, generic, opaque-to-GAPI data type - STATIC OPAQUE_VAL, // Unknown, generic, opaque-to-GAPI data type - STATIC
// Note: OPAQUE is sometimes defined in Win sys headers
#if !defined(OPAQUE) && !defined(CV_DOXYGEN)
OPAQUE = OPAQUE_VAL, // deprecated value used for compatibility, use OPAQUE_VAL instead
#endif
GOBJREF, // <internal> reference to object GOBJREF, // <internal> reference to object
GMAT, // a cv::GMat GMAT, // a cv::GMat
GMATP, // a cv::GMatP GMATP, // a cv::GMatP
...@@ -41,7 +45,7 @@ namespace detail ...@@ -41,7 +45,7 @@ namespace detail
template<typename T> struct GTypeTraits; template<typename T> struct GTypeTraits;
template<typename T> struct GTypeTraits template<typename T> struct GTypeTraits
{ {
static constexpr const ArgKind kind = ArgKind::OPAQUE; static constexpr const ArgKind kind = ArgKind::OPAQUE_VAL;
}; };
template<> struct GTypeTraits<cv::GMat> template<> struct GTypeTraits<cv::GMat>
{ {
......
...@@ -39,14 +39,14 @@ using GArg_Test_Types = ::testing::Types ...@@ -39,14 +39,14 @@ using GArg_Test_Types = ::testing::Types
, Expected<cv::GArray<cv::Rect>, cv::detail::ArgKind::GARRAY> , Expected<cv::GArray<cv::Rect>, cv::detail::ArgKind::GARRAY>
// Built-in types // Built-in types
, Expected<int, cv::detail::ArgKind::OPAQUE> , Expected<int, cv::detail::ArgKind::OPAQUE_VAL>
, Expected<float, cv::detail::ArgKind::OPAQUE> , Expected<float, cv::detail::ArgKind::OPAQUE_VAL>
, Expected<int*, cv::detail::ArgKind::OPAQUE> , Expected<int*, cv::detail::ArgKind::OPAQUE_VAL>
, Expected<cv::Point, cv::detail::ArgKind::OPAQUE> , Expected<cv::Point, cv::detail::ArgKind::OPAQUE_VAL>
, Expected<std::string, cv::detail::ArgKind::OPAQUE> , Expected<std::string, cv::detail::ArgKind::OPAQUE_VAL>
, Expected<cv::Mat, cv::detail::ArgKind::OPAQUE> , Expected<cv::Mat, cv::detail::ArgKind::OPAQUE_VAL>
, Expected<std::vector<int>, cv::detail::ArgKind::OPAQUE> , Expected<std::vector<int>, cv::detail::ArgKind::OPAQUE_VAL>
, Expected<std::vector<cv::Point>, cv::detail::ArgKind::OPAQUE> , Expected<std::vector<cv::Point>, cv::detail::ArgKind::OPAQUE_VAL>
>; >;
TYPED_TEST_CASE(GArgKind, GArg_Test_Types); TYPED_TEST_CASE(GArgKind, GArg_Test_Types);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment