|
|
我对syslink进行交叉编译到arm,但是出现如下错误:# o- c' B: W8 W1 q, ]: x! X1 Z
/home/tl/Projects/Xdl-build-arm/../../qt/Qt4.7/include/QtCore/qtconcurrentrunbase.h:65: error: two or more data types in declaration of 'parameter'6 R" X0 {+ w8 y7 X
( K, A0 r0 S$ S: f8 Y/ [这个头文件内容如下:
+ T. e% L9 T4 v" m1 P#ifndef QTCONCURRENT_RUNBASE_H
9 N6 Q" W$ V# D* _#define QTCONCURRENT_RUNBASE_H
, j$ v+ P: ?4 C$ M3 M2 l8 |; o3 k$ e" b G/ s2 V
#include <QtCore/qglobal.h>
- H0 _8 X) X1 J- B
$ T1 R% K! z' o0 e#ifndef QT_NO_CONCURRENT
( Q% i, L+ h' v/ p( e7 \" P7 e; @% ?% Z9 A
#include <QtCore/qfuture.h>
+ x8 ^6 v9 r# H0 |" Q. g. M0 f# n#include <QtCore/qrunnable.h>
% O) ?7 u4 |( k( I1 d& x#include <QtCore/qthreadpool.h>% e% s0 V' g( ~; r F
3 o1 V) g) X4 U N! G! o; C
QT_BEGIN_HEADER
% ^1 G7 ^( Y% M+ t% X. aQT_BEGIN_NAMESPACE8 a7 [# I+ @& q9 R
. ~9 A1 G, P$ U
QT_MODULE(Core)& Y9 L' m+ _% u2 f4 C0 a
/ E, i) k/ R* x" B
#ifndef qdoc
& E# I* c9 N, Z/ Z3 R% @" A& Z/ x6 h
namespace QtConcurrent {
0 p" N6 K3 j% k: s1 P: E
& A" W* G* d2 d* T: [8 ^template <typename T>
% J2 V8 J, @' @4 o: n. y, Ustruct SelectSpecialization
|) k! E0 h2 j9 N3 W+ ~* l{9 ^6 @! s# G9 ~! \# H
template <class Normal, class Void>
! M7 L/ u+ y! V struct Type { typedef Normal type; };6 Z- L3 C4 d& G" L8 `, i
};$ ~1 j) w$ G9 V0 r5 @: f/ d& U& }
0 i- }8 M' q+ \" v$ P! _template <>
4 y' z( D6 l" R. |- E! l+ i6 b3 y ystruct SelectSpecialization<void>7 e6 j, _( I' f3 {( a
{* s; x* b* G( `* I4 k& Z
template <class Normal, class Void>
8 Z# {1 R2 |( `2 l struct Type { typedef Void type; };% }' s3 F" S5 M, H! d
};- r( e( E0 L/ d7 C1 S9 A
( g/ q2 U9 P# Itemplate <typename T>
/ X0 q9 B- I; qclass RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable. E, }2 O; O' ^$ l9 l3 B
{
2 ?8 e, t5 z' z! f3 S2 rpublic:. S- T' V9 m7 w* l
QFuture<T> start()
/ h8 k* O. C$ V: e( @ {* L; z+ a5 ?' j5 Y$ u4 Z
this->setRunnable(this);
- d; G/ l2 C& q- m! @$ t9 m7 E _ this->reportStarted(); P5 ?$ ~. L$ i+ H2 v3 v
QFuture<T> future = this->future();5 C- @# c. n) S
QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);. a* x, Q; L; v' t" ~3 K% O9 y
return future;8 [+ ~7 z+ D' c
}
$ v2 S2 h$ [+ h* \$ N, m2 b4 G& @5 a" W
void run() {}2 O* U# t& ?: ~9 n5 r* r. I+ N
virtual void runFunctor() = 0;" H6 [# X ?9 P" C, I5 v# ?. e$ N
};
8 T0 F9 i% B3 w0 T. F& a/ u+ `" p+ n1 g1 a
template <typename T>
, e5 t# H* L1 X: y+ jclass RunFunctionTask : public RunFunctionTaskBase<T>7 B, r. e1 j$ ~+ e% R9 L+ J: e
{
2 B: {: @( A" i. c- Upublic:
/ j0 E7 Q9 `1 G2 c void run()
& I* D: s- p+ N( N {
* N a; r( Z3 ~ if (this->isCanceled()) {, i: t7 |; F+ c
this->reportFinished();2 [6 P! A/ h7 z A* g- a7 {
return;1 Z2 @1 {* g; p9 ]9 x
}
+ c0 |7 A3 R1 q! \4 @( j! z0 b7 \ this->runFunctor();
0 I/ { V- b, s this->reportResult(result);2 l% {/ k3 C" O, t+ A: k8 v
this->reportFinished();* G6 }& r: b! N* ~# q9 J4 R0 l0 d
}% L) ?, b2 x+ Z1 `7 [
T result;) J5 t6 ?$ _6 }# J* ?$ Q# T
};, V$ {7 O. K. P3 C1 K& |' G& z) K
* U( H" y: t) ]: r( p! Y! _3 b% dtemplate <>0 g$ S% _( K/ }$ E" X; Q8 X
class RunFunctionTask<void> : public RunFunctionTaskBase<void>2 ]9 C5 V- S( d8 G; U9 L
{# V' `: Z% Q3 R( `/ U
public:5 o- G- T6 }1 _! X6 a! K
void run()9 u8 ^' J9 [2 \. e$ ?- ]
{% A0 \8 c. H, {9 C' E+ W
if (this->isCanceled()) {
' W0 c% x R) b+ l5 l2 N6 I this->reportFinished();( }# ]7 G0 t; t7 j5 {$ m
return;
; U) {4 p; C0 b }, O& }: _* A" h' |5 K4 u
this->runFunctor();, q2 x( V3 J* h6 l
this->reportFinished();+ D2 r5 Z% K5 N* s
}
2 }% z% c! v- Z" p2 g/ n};
, E& X1 n% C# q' [$ L7 ^
" e5 U# { o2 D. @" U} //namespace QtConcurrent
" O+ \, L) ?8 {6 V+ n& X. e& h( Y; [, g, z8 G+ D
#endif //qdoc8 x, ^- x2 e& n1 b7 }& k$ m, @
& D& ~( [& b7 U; p, ^QT_END_NAMESPACE( }( W2 e- c' I- m
QT_END_HEADER
$ |: D& v% L, P$ V0 i# E0 Z1 U
+ t# I6 I6 ~' i6 A# r& u- H( ]5 A% E#endif // QT_NO_CONCURRENT4 R/ w4 H0 {" s0 e* b) u
+ Q6 S( P$ w& d- g y0 o#endif
$ |* f+ o( x% ?. u
1 _3 j( S% O6 h; d: V7 \3 O |
|