1+ diff --git a/modules/dnn/src/caffe/caffe_importer.cpp b/modules/dnn/src/caffe/caffe_importer.cpp
2+ index 6606fc301..a2e3cb2d6 100644
3+ --- a/modules/dnn/src/caffe/caffe_importer.cpp
4+ +++ b/modules/dnn/src/caffe/caffe_importer.cpp
5+ @@ -51,6 +51,7 @@
6+ #include <google/protobuf/io/zero_copy_stream_impl.h>
7+ #include <google/protobuf/reflection.h>
8+ #include "caffe_io.hpp"
9+ + #include <google/protobuf/port_def.inc>
10+ #endif
11+
12+ #include <opencv2/core/utils/fp_control_utils.hpp>
13+ @@ -595,6 +596,7 @@ Net readNetFromCaffe(const std::vector<uchar>& bufferProto, const std::vector<uc
14+ bufferModelPtr, bufferModel.size());
15+ }
16+
17+ + #include <google/protobuf/port_undef.inc>
18+ #else // HAVE_PROTOBUF
19+
20+ #define DNN_PROTOBUF_UNSUPPORTED() CV_Error(Error::StsError, "DNN/Caffe: Build OpenCV with Protobuf to import Caffe models")
21+ diff --git a/modules/gapi/include/opencv2/gapi/util/variant.hpp b/modules/gapi/include/opencv2/gapi/util/variant.hpp
22+ index 48b55646c..9b20a12b3 100644
23+ --- a/modules/gapi/include/opencv2/gapi/util/variant.hpp
24+ +++ b/modules/gapi/include/opencv2/gapi/util/variant.hpp
25+ @@ -132,7 +132,7 @@ namespace util
26+ static bool help(const Memory lhs, const Memory rhs) {
27+ const T& t_lhs = *reinterpret_cast<const T*>(lhs);
28+ const T& t_rhs = *reinterpret_cast<const T*>(rhs);
29+ - return t_lhs == t_rhs;
30+ + return static_cast<bool>(t_lhs == t_rhs);
31+ }
32+ };
33+
34+ diff --git a/modules/gapi/src/backends/fluid/gfluidcore.cpp b/modules/gapi/src/backends/fluid/gfluidcore.cpp
35+ index 50615b265..c19a19b46 100644
36+ --- a/modules/gapi/src/backends/fluid/gfluidcore.cpp
37+ +++ b/modules/gapi/src/backends/fluid/gfluidcore.cpp
38+ @@ -32,6 +32,15 @@
39+ #include <cassert>
40+ #include <cstdlib>
41+
42+ + // Windows declares several inconvenient macro names. We #undef them and then
43+ + // restore them after
44+ + #ifdef _MSC_VER
45+ + #pragma push_macro("MM_MIN")
46+ + #undef MM_MIN
47+ + #pragma push_macro("MM_MAX")
48+ + #undef MM_MAX
49+ + #endif // _MSC_VER
50+ +
51+ namespace cv {
52+ namespace gapi {
53+ namespace fluid {
54+ @@ -2582,6 +2591,12 @@ GAPI_FLUID_KERNEL(GFluidSqrt, cv::gapi::core::GSqrt, false)
55+ } // namespace gapi
56+ } // namespace cv
57+
58+ + // Restore macro that may have been #undef'd.
59+ + #ifdef _MSC_VER
60+ + #pragma pop_macro("MM_MIN")
61+ + #pragma pop_macro("MM_MAX")
62+ + #endif
63+ +
64+ cv::GKernelPackage cv::gapi::core::fluid::kernels()
65+ {
66+ using namespace cv::gapi::fluid;
67+ diff --git a/modules/highgui/src/window_w32.cpp b/modules/highgui/src/window_w32.cpp
68+ index a3a71a6cc..07e455337 100644
69+ --- a/modules/highgui/src/window_w32.cpp
70+ +++ b/modules/highgui/src/window_w32.cpp
71+ @@ -654,11 +654,11 @@ double cvGetPropTopmost_W32(const char* name)
72+
73+ static double getPropTopmost_(CvWindow& window)
74+ {
75+ - LONG style = GetWindowLongA(window.frame, GWL_EXSTYLE); // -20
76+ + LONG style = GetWindowLong(window.frame, GWL_EXSTYLE); // -20
77+ if (!style)
78+ {
79+ std::ostringstream errorMsg;
80+ - errorMsg << "window(" << window.name << "): failed to retrieve extended window style using GetWindowLongA(); error code: " << GetLastError();
81+ + errorMsg << "window(" << window.name << "): failed to retrieve extended window style using GetWindowLong(); error code: " << GetLastError();
82+ CV_Error(Error::StsError, errorMsg.str());
83+ }
84+
185diff --git a/modules/python/src2/hdr_parser.py b/modules/python/src2/hdr_parser.py
2- index 710c79217..6e0062ece 100755
86+ index 0dc5dd148..132dbcecb 100755
387--- a/modules/python/src2/hdr_parser.py
488+++ b/modules/python/src2/hdr_parser.py
589@@ -70,6 +70,29 @@ class CppHeaderParser(object):
@@ -67,7 +151,7 @@ index 710c79217..6e0062ece 100755
67151 func_modlist.append("="+arg)
68152 decl_str = decl_str[:npos] + decl_str[npos3+1:]
69153 npos = decl_str.find("CV_WRAP_PHANTOM")
70- @@ -645 ,10 +682 ,13 @@ class CppHeaderParser(object):
154+ @@ -654 ,10 +691 ,13 @@ class CppHeaderParser(object):
71155
72156 the function will convert "A" to "cv.A" and "f" to "cv.A.f".
73157 """
@@ -84,7 +168,7 @@ index 710c79217..6e0062ece 100755
84168 qualified_name = (("." in name) or ("::" in name))
85169 n = ""
86170 for b in self.block_stack:
87- @@ -740 ,7 +780 ,10 @@ class CppHeaderParser(object):
171+ @@ -749 ,7 +789 ,10 @@ class CppHeaderParser(object):
88172
89173 if stmt.startswith("enum") or stmt.startswith("namespace"):
90174 # NB: Drop inheritance syntax for enum
@@ -96,7 +180,7 @@ index 710c79217..6e0062ece 100755
96180 stmt_list = stmt.rsplit(" ", 1)
97181 if len(stmt_list) < 2:
98182 stmt_list.append("<unnamed>")
99- @@ -776 ,8 +819 ,18 @@ class CppHeaderParser(object):
183+ @@ -785 ,8 +828 ,18 @@ class CppHeaderParser(object):
100184 var_modlist = []
101185 if "CV_PROP_RW" in stmt:
102186 var_modlist.append("/RW")
0 commit comments