1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2019-08-05 18:11:43 +00:00
41 changed files with 423 additions and 302 deletions
+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__)