Support building shared libraries on WINCE.

This commit is contained in:
Hugo Lindström
2019-08-01 15:28:04 +02:00
parent 4dadf17bd9
commit 03fe1cb7fc
5 changed files with 32 additions and 11 deletions
+2 -2
View File
@@ -139,7 +139,7 @@ const char dir_separators[] = "/";
static bool isDir(const cv::String& path, DIR* dir)
{
#if defined _WIN32 || defined WINCE
#if defined _WIN32 || defined _WIN32_WCE
DWORD attributes;
BOOL status = TRUE;
if (dir)
@@ -147,7 +147,7 @@ static bool isDir(const cv::String& path, DIR* dir)
else
{
WIN32_FILE_ATTRIBUTE_DATA all_attrs;
#ifdef WINRT
#if defined WINRT || defined _WIN32_WCE
wchar_t wpath[MAX_PATH];
size_t copied = mbstowcs(wpath, path.c_str(), MAX_PATH);
CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1));
+11 -4
View File
@@ -115,13 +115,20 @@ static cv::String getModuleLocation(const void* addr)
#endif
if (m)
{
char path[MAX_PATH];
const size_t path_size = sizeof(path)/sizeof(*path);
size_t sz = GetModuleFileNameA(m, path, path_size); // no unicode support
TCHAR path[MAX_PATH];
const size_t path_size = sizeof(path) / sizeof(*path);
size_t sz = GetModuleFileName(m, path, path_size);
if (sz > 0 && sz < path_size)
{
path[sz] = '\0';
path[sz] = TCHAR('\0');
#ifdef _UNICODE
char char_path[MAX_PATH];
size_t copied = wcstombs(char_path, path, MAX_PATH);
CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1));
return cv::String(char_path);
#else
return cv::String(path);
#endif
}
}
#elif defined(__linux__)