|
|
我对syslink进行交叉编译到arm,但是出现如下错误:$ C+ H# Q( Y1 P% ]
/home/tl/Projects/Xdl-build-arm/../../qt/Qt4.7/include/QtCore/qtconcurrentrunbase.h:65: error: two or more data types in declaration of 'parameter'
" Z+ \ n$ p: h$ d- [4 G
9 n+ L: d% ?! _; P这个头文件内容如下:
3 W& T6 m( m& W1 p" V+ X( ]2 X9 C#ifndef QTCONCURRENT_RUNBASE_H7 K4 R0 a8 `' }' O# T! t
#define QTCONCURRENT_RUNBASE_H
7 X6 ^# L& L# d0 c% ~' U8 M
4 d+ s$ \% T* L- L# ~1 k: i#include <QtCore/qglobal.h>
6 T% O1 S4 |$ v" ^
9 m) a" W/ a: {7 a#ifndef QT_NO_CONCURRENT: K! i) \! T7 r5 ^
. s" h. @" H0 t( q( `" A i1 e
#include <QtCore/qfuture.h>
! P/ T% |+ w3 M2 F#include <QtCore/qrunnable.h>+ q/ L3 o' v! ?
#include <QtCore/qthreadpool.h>0 U6 Z" n' P7 ~% @4 X$ R
2 b, r2 m: Y7 mQT_BEGIN_HEADER5 E8 E* i" J) i$ A2 v: d! g
QT_BEGIN_NAMESPACE, v5 j/ s, `" F! O% m" P6 s) u
% m) r' f" A" r0 h( WQT_MODULE(Core). c+ k" Z* }5 Y, l6 M G
# j: ?. H( X0 S8 {
#ifndef qdoc
% ?( I% K K6 A, o H K3 ]
( K/ B" g' V% U9 X% ]) q6 a8 ynamespace QtConcurrent {( U* v( z9 t; O! f: x7 z* F. A: q
$ V7 T' J+ ~$ e5 @
template <typename T>
1 Y! D6 j/ M* r% A/ v% n8 s& Cstruct SelectSpecialization
7 r% i7 W) [0 R [) A( X8 s{
% u; l/ T. p4 C1 N; k template <class Normal, class Void>" C" e. y- ]3 Q
struct Type { typedef Normal type; };# r3 ^( f, e4 {8 d
};
% w2 {: \% H" {
& ^! O" x c) @7 E7 l. Q& F2 w2 r% H; ntemplate <>
8 ?" X. `$ I+ {2 `7 {8 vstruct SelectSpecialization<void>
$ y* c9 Z2 p7 w7 z% u& f% G- V" I; ?. O{
- u" k8 g7 N# F template <class Normal, class Void>
' x- }5 P) R ]0 c. l$ I+ q5 y- s0 Y T struct Type { typedef Void type; };
* w9 T- D$ {/ `};
# |5 U) I7 @2 ?" A0 G: B) U6 |% W# ~$ c
template <typename T>
# z& V% ~ p6 e1 ]! t" S) D: n) Kclass RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable
' U9 ]1 e; m/ m9 K \) q% R{
+ l5 B+ f, S$ s( ]8 [: {0 lpublic:
q- |, W- u D" c# f3 D! H QFuture<T> start()
/ w9 K& y( x6 L2 R, K# B {- B( S* S9 x7 Q5 H1 p. o
this->setRunnable(this);
& T1 L' ?2 l2 ]0 w0 f this->reportStarted();
. Q7 H- \+ b. r ?3 O( z" E QFuture<T> future = this->future();; I# o' ?- B0 M' O1 [
QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);0 ^8 W5 x3 ^) W' t6 [( T
return future;
. ?8 o7 e9 E. w }
/ e$ t# _9 m; K) c- V2 y; n1 q: H: ~0 A$ A2 H$ H
void run() {}
5 A2 _& Q7 h: u$ F* {9 g0 ] virtual void runFunctor() = 0;# G& Q7 u8 B7 f9 a* A1 r3 m2 I
};
9 s3 m: A) O% _- H4 ]* p6 R" l9 Q2 S; w7 |
template <typename T>. F0 f$ T- |0 l3 q2 V9 a- O, N
class RunFunctionTask : public RunFunctionTaskBase<T>
( Q/ |& w u! |2 C{
4 s8 J2 [: C3 ppublic:
% U( A* l! l: s w# i' D void run() Y2 d f7 x+ x
{
4 }2 M5 \2 @" |3 C/ m$ n if (this->isCanceled()) {
2 d$ C8 Z3 f4 [% |4 u9 u this->reportFinished();. z5 ~/ I, T" B7 t) F( W7 I
return;
- T4 a: W6 N6 e4 J. R, n' M }4 q& `/ n1 F( f% {' H3 h
this->runFunctor();
$ a9 ?' a3 g }& O6 F1 {5 N7 r this->reportResult(result);( |# Y u! E$ f- }
this->reportFinished();
0 F0 z( j" { f; T" c/ G; X }
5 C2 o7 X4 |: H, x* |1 W T result;+ z* d1 Y; A0 p" c8 F
};
6 Y! b9 b7 D5 ]6 T5 W7 @8 y2 h* l9 M' ]) N
template <>
9 T. T. C8 F& Y8 ?" G/ A/ Jclass RunFunctionTask<void> : public RunFunctionTaskBase<void>
) `: m0 G) d) M{
! E$ Q' S1 O$ g$ q5 Dpublic:
' z& _+ Q9 B0 S6 a; u void run()
: F7 L' l- p6 T {; `; B7 L+ v9 f9 P) E# {
if (this->isCanceled()) {$ \3 w( C5 ?5 S$ _
this->reportFinished();
$ p$ o; J- d* c9 f1 r return;
" l; d6 w7 L% o6 B }
3 H- ?/ I4 U/ p; J! L6 s: S this->runFunctor();
1 {) o% `$ ^) n7 b x this->reportFinished();
4 i% D- n# G. |- Z8 Y2 Y; k }2 o, L' y+ F' G: s4 ~! s( s
};# |, T3 W( v1 ?/ e/ C
/ J' e' x8 O6 N
} //namespace QtConcurrent0 X( }/ K. K8 L
, V( u# A/ \ h, R5 ? y#endif //qdoc; H5 Z( }( m3 w& G( z
& N7 f% r. N% n- V, e u, CQT_END_NAMESPACE- s) E9 x) q+ l; p, O! L
QT_END_HEADER% k4 g3 ~% h! s
3 [) G+ P! m: g+ Y' M6 q8 I
#endif // QT_NO_CONCURRENT3 B& m" P9 Y: s/ t; M& j3 u3 i
. X' V6 [8 r8 h4 R# o1 f( A
#endif, P* V; }8 q3 g) q+ M
3 s# z: E4 B c& L3 W# \
|
|