Merge pull request #15207 from vicroms:fix-uwp-build

Fix build for UWP (#15207)

* Guard non-WinRT calls to fix UWP build

* Remove unnecessary guard for WinRT
pull/15217/head
Victor Romero 6 years ago committed by Alexander Alekhin
parent f9cefc84a3
commit f18cbd036a
  1. 2
      cmake/OpenCVModule.cmake
  2. 4
      modules/core/src/utils/datafile.cpp
  3. 2
      modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp

@ -852,7 +852,7 @@ macro(ocv_create_module)
set(the_module_target ${the_module})
endif()
if(WINRT)
if(WINRT AND BUILD_TESTS)
# removing APPCONTAINER from modules to run from console
# in case of usual starting of WinRT test apps output is missing
# so starting of console version w/o APPCONTAINER is required to get test results

@ -108,7 +108,7 @@ static cv::String getModuleLocation(const void* addr)
CV_UNUSED(addr);
#ifdef _WIN32
HMODULE m = 0;
#if _WIN32_WINNT >= 0x0501
#if _WIN32_WINNT >= 0x0501 && (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast<LPCTSTR>(addr),
&m);
@ -155,7 +155,7 @@ bool getBinLocation(std::wstring& dst)
{
void* addr = (void*)getModuleLocation; // using code address, doesn't work with static linkage!
HMODULE m = 0;
#if _WIN32_WINNT >= 0x0501
#if _WIN32_WINNT >= 0x0501 && (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast<LPCTSTR>(addr),
&m);

@ -94,7 +94,7 @@ Media::CaptureFrameGrabber::~CaptureFrameGrabber()
void Media::CaptureFrameGrabber::ShowCameraSettings()
{
#if WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP
#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY != WINAPI_FAMILY_PC_APP)
if (_state == State::Started)
{
CameraOptionsUI::Show(_capture.Get());

Loading…
Cancel
Save