Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
62b85a41
O
Opencv
项目概览
Greenplum
/
Opencv
12 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
62b85a41
编写于
7月 23, 2013
作者:
A
Alexander Smorkalov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TLS calls on WinRT replaced on variables with C++11 "thread" attribute.
上级
6257df1c
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
102 addition
and
25 deletion
+102
-25
modules/contrib/src/inputoutput.cpp
modules/contrib/src/inputoutput.cpp
+66
-10
modules/core/src/alloc.cpp
modules/core/src/alloc.cpp
+4
-4
modules/core/src/rand.cpp
modules/core/src/rand.cpp
+30
-9
modules/core/src/system.cpp
modules/core/src/system.cpp
+2
-2
未找到文件。
modules/contrib/src/inputoutput.cpp
浏览文件 @
62b85a41
...
...
@@ -16,10 +16,23 @@ namespace cv
list
.
clear
();
std
::
string
path_f
=
path
+
"/"
+
exten
;
#ifdef WIN32
#if HAVE_WINRT
WIN32_FIND_DATAW
FindFileData
;
#else
WIN32_FIND_DATA
FindFileData
;
#endif
HANDLE
hFind
;
hFind
=
FindFirstFile
((
LPCSTR
)
path_f
.
c_str
(),
&
FindFileData
);
#ifdef HAVE_WINRT
size_t
size
=
mbstowcs
(
NULL
,
path_f
.
c_str
(),
path_f
.
size
());
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
);
free
(
wpath
);
#else
hFind
=
FindFirstFileA
((
LPCSTR
)
path_f
.
c_str
(),
&
FindFileData
);
#endif
if
(
hFind
==
INVALID_HANDLE_VALUE
)
{
return
list
;
...
...
@@ -34,13 +47,29 @@ namespace cv
FindFileData
.
dwFileAttributes
==
FILE_ATTRIBUTE_SYSTEM
||
FindFileData
.
dwFileAttributes
==
FILE_ATTRIBUTE_READONLY
)
{
char
*
fname
;
#ifdef HAVE_WINRT
size_t
asize
=
wcstombs
(
NULL
,
FindFileData
.
cFileName
,
0
);
char
*
fname
=
(
char
*
)
malloc
((
asize
+
1
)
*
sizeof
(
char
));
fname
[
asize
]
=
0
;
wcstombs
(
fname
,
FindFileData
.
cFileName
,
asize
);
#else
fname
=
FindFileData
.
cFileName
;
#endif
if
(
addPath
)
list
.
push_back
(
path
+
"/"
+
FindFileData
.
cFileN
ame
);
list
.
push_back
(
path
+
"/"
+
fn
ame
);
else
list
.
push_back
(
FindFileData
.
cFileName
);
list
.
push_back
(
fname
);
#ifdef HAVE_WINRT
free
(
fname
);
#endif
}
}
while
(
FindNextFile
(
hFind
,
&
FindFileData
));
#ifdef HAVE_WINRT
while
(
FindNextFileW
(
hFind
,
&
FindFileData
));
#else
while
(
FindNextFileA
(
hFind
,
&
FindFileData
));
#endif
FindClose
(
hFind
);
}
#else
...
...
@@ -75,10 +104,23 @@ namespace cv
std
::
string
path_f
=
path
+
"/"
+
exten
;
list
.
clear
();
#ifdef WIN32
#if HAVE_WINRT
WIN32_FIND_DATAW
FindFileData
;
#else
WIN32_FIND_DATA
FindFileData
;
#endif
HANDLE
hFind
;
hFind
=
FindFirstFile
((
LPCSTR
)
path_f
.
c_str
(),
&
FindFileData
);
#ifdef HAVE_WINRT
size_t
size
=
mbstowcs
(
NULL
,
path_f
.
c_str
(),
path_f
.
size
());
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
);
free
(
wpath
);
#else
hFind
=
FindFirstFileA
((
LPCSTR
)
path_f
.
c_str
(),
&
FindFileData
);
#endif
if
(
hFind
==
INVALID_HANDLE_VALUE
)
{
return
list
;
...
...
@@ -91,13 +133,27 @@ namespace cv
strcmp
(
FindFileData
.
cFileName
,
"."
)
!=
0
&&
strcmp
(
FindFileData
.
cFileName
,
".."
)
!=
0
)
{
char
*
fname
;
#ifdef HAVE_WINRT
size_t
asize
=
wcstombs
(
NULL
,
FindFileData
.
cFileName
,
0
);
char
*
fname
=
(
char
*
)
malloc
((
asize
+
1
)
*
sizeof
(
char
));
fname
[
asize
]
=
0
;
wcstombs
(
fname
,
FindFileData
.
cFileName
,
asize
);
#else
fname
=
FindFileData
.
cFileName
;
#endif
if
(
addPath
)
list
.
push_back
(
path
+
"/"
+
FindFileData
.
cFileN
ame
);
list
.
push_back
(
path
+
"/"
+
fn
ame
);
else
list
.
push_back
(
FindFileData
.
cFileN
ame
);
list
.
push_back
(
fn
ame
);
}
}
while
(
FindNextFile
(
hFind
,
&
FindFileData
));
#ifdef HAVE_WINRT
while
(
FindNextFileW
(
hFind
,
&
FindFileData
));
#else
while
(
FindNextFileA
(
hFind
,
&
FindFileData
));
#endif
FindClose
(
hFind
);
}
...
...
modules/core/src/alloc.cpp
浏览文件 @
62b85a41
...
...
@@ -42,10 +42,6 @@
#include "precomp.hpp"
#if (_WIN32_WINNT >= 0x0602)
#include <synchapi.h>
#endif
#define CV_USE_SYSTEM_MALLOC 1
namespace
cv
...
...
@@ -98,6 +94,10 @@ void fastFree(void* ptr)
#define STAT(stmt)
#ifdef WIN32
#if (_WIN32_WINNT >= 0x0602)
#include <synchapi.h>
#endif
struct
CriticalSection
{
CriticalSection
()
...
...
modules/core/src/rand.cpp
浏览文件 @
62b85a41
...
...
@@ -726,13 +726,34 @@ void RNG::fill( InputOutputArray _mat, int disttype,
}
#ifdef WIN32
#ifdef HAVE_WINRT
// using C++11 thread attribute for local thread data
__declspec
(
thread
)
RNG
*
rng
=
NULL
;
void
deleteThreadRNGData
()
{
if
(
rng
)
delete
rng
;
}
RNG
&
theRNG
()
{
if
(
!
rng
)
{
rng
=
new
RNG
;
}
return
*
rng
;
}
#else
#ifdef WINCE
# define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
#endif
static
DWORD
tlsRNGKey
=
TLS_OUT_OF_INDEXES
;
void
deleteThreadRNGData
()
{
void
deleteThreadRNGData
()
{
if
(
tlsRNGKey
!=
TLS_OUT_OF_INDEXES
)
delete
(
RNG
*
)
TlsGetValue
(
tlsRNGKey
);
}
...
...
@@ -752,7 +773,7 @@ RNG& theRNG()
}
return
*
rng
;
}
#endif //HAVE_WINRT
#else
static
pthread_key_t
tlsRNGKey
=
0
;
...
...
modules/core/src/system.cpp
浏览文件 @
62b85a41
...
...
@@ -48,7 +48,7 @@
#endif
#include <windows.h>
#if (_WIN32_WINNT >= 0x0602)
#include <synchapi.h>
#include <synchapi.h>
#endif
#undef small
#undef min
...
...
@@ -80,8 +80,8 @@
#endif
#ifdef HAVE_WINRT
#pragma comment(lib, "MinCore_Downlevel")
#include <wrl/client.h>
#pragma comment(lib, "MinCore_Downlevel")
std
::
wstring
GetTempPathWinRT
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录