Skip to content

Commit 4e8f892

Browse files
committed
Merge pull request opencv#7170 from alalek:fix_build
2 parents da0e07b + 5383a62 commit 4e8f892

File tree

5 files changed

+8
-28
lines changed

5 files changed

+8
-28
lines changed

modules/core/src/parallel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ int cv::getNumberOfCPUs(void)
521521
{
522522
#if defined WIN32 || defined _WIN32
523523
SYSTEM_INFO sysinfo;
524-
#if defined(_M_ARM) || defined(_M_X64) || defined(WINRT)
524+
#if (defined(_M_ARM) || defined(_M_X64) || defined(WINRT)) && _WIN32_WINNT >= 0x501
525525
GetNativeSystemInfo( &sysinfo );
526526
#else
527527
GetSystemInfo( &sysinfo );

modules/highgui/src/precomp.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@
6363
#include <assert.h>
6464

6565
#if defined WIN32 || defined WINCE
66-
#if !defined _WIN32_WINNT
67-
#ifdef HAVE_MSMF
68-
#define _WIN32_WINNT 0x0600 // Windows Vista
69-
#else
70-
#define _WIN32_WINNT 0x0500 // Windows 2000
71-
#endif
72-
#endif
73-
7466
#include <windows.h>
7567
#undef small
7668
#undef min

modules/imgcodecs/src/precomp.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@
5959
#include <assert.h>
6060

6161
#if defined WIN32 || defined WINCE
62-
#if !defined _WIN32_WINNT
63-
#ifdef HAVE_MSMF
64-
#define _WIN32_WINNT 0x0600 // Windows Vista
65-
#else
66-
#define _WIN32_WINNT 0x0500 // Windows 2000
67-
#endif
68-
#endif
69-
7062
#include <windows.h>
7163
#undef small
7264
#undef min

modules/videoio/src/cap_ffmpeg.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ static cv::Mutex _icvInitFFMPEG_mutex;
6565
static const HMODULE cv_GetCurrentModule()
6666
{
6767
HMODULE h = 0;
68+
#if _WIN32_WINNT >= 0x0501
6869
::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
6970
reinterpret_cast<LPCTSTR>(cv_GetCurrentModule),
7071
&h);
72+
#endif
7173
return h;
7274
}
7375
#endif
@@ -98,22 +100,16 @@ class icvInitFFMPEG
98100
icvInitFFMPEG()
99101
{
100102
#if defined WIN32 || defined _WIN32
101-
# ifdef WINRT
102-
const wchar_t* module_name = L"opencv_ffmpeg"
103+
const wchar_t* module_name_ = L"opencv_ffmpeg"
103104
CVAUX_STRW(CV_MAJOR_VERSION) CVAUX_STRW(CV_MINOR_VERSION) CVAUX_STRW(CV_SUBMINOR_VERSION)
104105
#if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__)
105106
L"_64"
106107
#endif
107108
L".dll";
108-
109-
icvFFOpenCV = LoadPackagedLibrary( module_name, 0 );
109+
# ifdef WINRT
110+
icvFFOpenCV = LoadPackagedLibrary( module_name_, 0 );
110111
# else
111-
const std::wstring module_name = L"opencv_ffmpeg"
112-
CVAUX_STRW(CV_MAJOR_VERSION) CVAUX_STRW(CV_MINOR_VERSION) CVAUX_STRW(CV_SUBMINOR_VERSION)
113-
#if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__)
114-
L"_64"
115-
#endif
116-
L".dll";
112+
const std::wstring module_name(module_name_);
117113

118114
const wchar_t* ffmpeg_env_path = _wgetenv(L"OPENCV_FFMPEG_DLL_DIR");
119115
std::wstring module_path =

modules/videoio/src/precomp.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
#ifdef HAVE_MSMF
6767
#define _WIN32_WINNT 0x0600 // Windows Vista
6868
#else
69-
#define _WIN32_WINNT 0x0500 // Windows 2000
69+
#define _WIN32_WINNT 0x0501 // Windows XP
7070
#endif
7171
#endif
7272

0 commit comments

Comments
 (0)