|
|
我对syslink进行交叉编译到arm,但是出现如下错误:& u' a5 j' A6 t) ~, r3 e$ X
/home/tl/Projects/Xdl-build-arm/../../qt/Qt4.7/include/QtCore/qtconcurrentrunbase.h:65: error: two or more data types in declaration of 'parameter'
8 z* I: ~: c, F5 V& i4 M( W+ w" h( K% E2 ]! ^- ?$ r! ~
这个头文件内容如下:
8 a5 c) W: y o9 j( x#ifndef QTCONCURRENT_RUNBASE_H) M& {+ A( d% ?
#define QTCONCURRENT_RUNBASE_H" U8 j1 |0 @* j+ g Y
& }, U/ l- F& C1 g8 V4 H: {% Y#include <QtCore/qglobal.h>
5 p; y/ x6 t: \1 c$ d7 `4 k! G, o$ u& b; M& P
#ifndef QT_NO_CONCURRENT* `0 P+ D$ k, t- _+ p! ?' T# R
+ Q7 i7 X6 t9 r7 b# s( z#include <QtCore/qfuture.h>
' N; O. Q9 A% K6 Y) X( U' K4 p* Z#include <QtCore/qrunnable.h># d# v) z9 j8 f3 r1 ?
#include <QtCore/qthreadpool.h>
3 m# z3 W0 ~2 s8 A0 Z
% e+ c* A2 l: A$ e+ YQT_BEGIN_HEADER8 V1 L; N/ a# X
QT_BEGIN_NAMESPACE, c$ w/ a* V" C# g
' m/ w3 D9 R$ ~2 b2 H7 ]
QT_MODULE(Core)& B- q+ A4 D3 a" |) M
) p- p: M, J6 ^4 s' w( D
#ifndef qdoc
3 _# x% h2 ]2 [+ \$ X+ k' r$ B% ^. m _2 W, y( R* d
namespace QtConcurrent {
: X3 j/ V# Q# Z, A7 R/ n4 U9 Y; E; @( q, N; P' f) {3 I
template <typename T>
8 ?% {. O/ U/ C6 L- j) ystruct SelectSpecialization
& n8 v# T- V n) n0 Z9 u{5 J! [0 Y4 ^$ e" R
template <class Normal, class Void>
$ l9 J) S7 e5 @: x1 k7 x struct Type { typedef Normal type; };0 v8 S5 H- Z. y7 _
};
6 k, P# H+ n- m& d; { j+ Z! c( |& r# J7 r5 s0 G1 @
template <>4 a$ F2 W- d4 D
struct SelectSpecialization<void>
' L \! j- U. k1 e* Q{
; E& g5 P7 F1 v, L) G% \3 T6 s5 o template <class Normal, class Void>
8 H' o3 b; s' T& _, {% Q struct Type { typedef Void type; };2 B @9 E w. H8 {# H) l4 \
};$ C7 Y2 D5 f& S) u
) @+ [: m' R7 p, H( ~1 K: utemplate <typename T>4 a0 f7 E* Z! f1 U9 v$ J
class RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable
1 [5 {9 R9 g5 Y- I# v, B+ `{, s' h1 X8 s* ]4 }! }
public:
/ `0 P, b5 |$ X0 p) e, T QFuture<T> start()
% X& g# Z3 V! k+ p- n7 n {0 {8 l; U" N, n; y h4 X
this->setRunnable(this);( K; }4 J) x, y8 C1 C0 d2 D. w
this->reportStarted();
/ N3 {$ B3 Q+ g QFuture<T> future = this->future();
! H! M7 q5 @9 F# A3 f$ u/ w QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);
v* t5 i6 b- n: U$ |3 j- P return future;- o9 x0 q" [5 E* G2 \
}
- {1 z# K, {- q- k- y6 v+ D2 J8 x4 J' f% y) R) m
void run() {}
! o9 V s0 \0 r+ k% e virtual void runFunctor() = 0;6 k s' ]/ \2 `
};. a- h1 F" @3 U5 d
6 M4 ~$ P% v- \template <typename T>9 x$ e6 M3 |' M1 F
class RunFunctionTask : public RunFunctionTaskBase<T>
4 e" g6 J5 E1 b: D" f% y{3 s5 n1 s1 ~: t6 h! Y3 U7 f* n
public: y3 W# o% D) }$ G4 B8 U2 _
void run()6 Y% P/ e! S8 a+ P: m7 d1 @# K
{
) L3 |" i5 k: I. _ if (this->isCanceled()) {; m i. `; q1 |, R( |
this->reportFinished();& _+ x' M( F, i7 P: X0 ^
return;
# g3 `7 h7 e% |3 s8 d/ h, Z; L }0 v4 n6 i r8 j4 H* O
this->runFunctor();4 I L- c$ ?* [2 O7 B5 O7 W- c
this->reportResult(result);
( p3 G, O; l% k this->reportFinished();, b; \& G6 ^% _! w5 }9 @3 {0 k
}
; y2 W( \) y& X7 Y+ ?: k T result;$ G! M9 E& I2 [' b# D
};
- a" j" c1 b* x. ` u7 N
. {( B: O: `+ O; w% l0 wtemplate <>& ]& m( b X/ |
class RunFunctionTask<void> : public RunFunctionTaskBase<void>
6 C$ a% g: H' U, p0 c( |' `{
; Q' a9 I1 N) p! A& F) lpublic:
% D: q0 G2 V/ H* [6 n1 b4 w. ` void run()9 Y! @1 c: N3 t; z9 @
{
: q* ?+ o5 u1 v" @$ j if (this->isCanceled()) {
, ^1 Q. G2 y! Y% T. K9 Z. K7 R% P/ N8 c this->reportFinished();/ i; W/ Q* s1 @
return;
o2 t' Q/ R4 _4 R |' S( P* V }
5 M' g3 |4 |# U5 T0 C0 ~/ @ this->runFunctor();
6 N* V5 j+ s$ v this->reportFinished();
1 y" a5 G3 e) U5 O# T* F5 B; V! @ }2 D' L8 u g/ c* o/ u7 C; Q P
};
0 e3 ~. b) Z: y% N* e8 I4 ?( ~& K/ h' F1 R8 U$ ]! C
} //namespace QtConcurrent
* v3 H6 t5 d2 X0 X4 G: \
: ~/ r _! L9 P$ s7 h$ I#endif //qdoc* f& J+ r8 R! s% x% d; v4 K
0 U; E- L# }9 o* P: @7 L8 A
QT_END_NAMESPACE
8 o" e/ P, @: T7 U. e( l6 v' jQT_END_HEADER
6 y% Y2 W$ W6 o# W3 a
( _% H. L6 g9 f% r4 z. V& s#endif // QT_NO_CONCURRENT
8 w, g$ ~ l! N6 c G* c$ U- d0 w3 W) W- G$ u8 ^
#endif7 F' d. B; n9 q3 b! @
: s& {1 }, Z6 C0 J9 `& k6 i |
|