Skip to content

Commit

Permalink
WinRT API Certification fixes for core and contrib.
Browse files Browse the repository at this point in the history
  • Loading branch information
asmorkalov committed Jul 31, 2013
1 parent 62b85a4 commit e03ffde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
17 changes: 9 additions & 8 deletions modules/contrib/src/inputoutput.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

#include "opencv2/contrib/contrib.hpp"
#include <cvconfig.h>

#if defined(WIN32) || defined(_WIN32)
#include <windows.h>
Expand All @@ -16,7 +17,7 @@ namespace cv
list.clear();
std::string path_f = path + "/" + exten;
#ifdef WIN32
#if HAVE_WINRT
#ifdef HAVE_WINRT
WIN32_FIND_DATAW FindFileData;
#else
WIN32_FIND_DATA FindFileData;
Expand All @@ -28,7 +29,7 @@ namespace cv
wchar_t* wpath = (wchar_t*)malloc((size+1)*sizeof(wchar_t));
wpath[size] = 0;
mbstowcs(wpath, path_f.c_str(), path_f.size());
hFind = FindFirstFileW(wpath, &FindFileData);
hFind = FindFirstFileExW(wpath, FindExInfoStandard, &FindFileData, FindExSearchNameMatch, NULL, 0);
free(wpath);
#else
hFind = FindFirstFileA((LPCSTR)path_f.c_str(), &FindFileData);
Expand All @@ -50,7 +51,7 @@ namespace cv
char* fname;
#ifdef HAVE_WINRT
size_t asize = wcstombs(NULL, FindFileData.cFileName, 0);
char* fname = (char*)malloc((asize+1)*sizeof(char));
fname = (char*)malloc((asize+1)*sizeof(char));
fname[asize] = 0;
wcstombs(fname, FindFileData.cFileName, asize);
#else
Expand Down Expand Up @@ -104,7 +105,7 @@ namespace cv
std::string path_f = path + "/" + exten;
list.clear();
#ifdef WIN32
#if HAVE_WINRT
#ifdef HAVE_WINRT
WIN32_FIND_DATAW FindFileData;
#else
WIN32_FIND_DATA FindFileData;
Expand All @@ -116,7 +117,7 @@ namespace cv
wchar_t* wpath = (wchar_t*)malloc((size+1)*sizeof(wchar_t));
wpath[size] = 0;
mbstowcs(wpath, path_f.c_str(), path_f.size());
hFind = FindFirstFileW(wpath, &FindFileData);
hFind = FindFirstFileExW(wpath, FindExInfoStandard, &FindFileData, FindExSearchNameMatch, NULL, 0);
free(wpath);
#else
hFind = FindFirstFileA((LPCSTR)path_f.c_str(), &FindFileData);
Expand All @@ -130,13 +131,13 @@ namespace cv
do
{
if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY &&
strcmp(FindFileData.cFileName, ".") != 0 &&
strcmp(FindFileData.cFileName, "..") != 0)
wcscmp(FindFileData.cFileName, L".") != 0 &&
wcscmp(FindFileData.cFileName, L"..") != 0)
{
char* fname;
#ifdef HAVE_WINRT
size_t asize = wcstombs(NULL, FindFileData.cFileName, 0);
char* fname = (char*)malloc((asize+1)*sizeof(char));
fname = (char*)malloc((asize+1)*sizeof(char));
fname[asize] = 0;
wcstombs(fname, FindFileData.cFileName, asize);
#else
Expand Down
1 change: 0 additions & 1 deletion modules/core/src/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@

#ifdef HAVE_WINRT
#include <wrl/client.h>
#pragma comment(lib, "MinCore_Downlevel")

std::wstring GetTempPathWinRT()
{
Expand Down

0 comments on commit e03ffde

Please sign in to comment.