|
|
我对syslink进行交叉编译到arm,但是出现如下错误:
# H/ R, k0 E( g: k0 [2 p) a0 J/home/tl/Projects/Xdl-build-arm/../../qt/Qt4.7/include/QtCore/qtconcurrentrunbase.h:65: error: two or more data types in declaration of 'parameter'( P1 e, @% j) t6 X3 i
* G0 d5 i M/ O. s( }* z. _/ S# U4 U
这个头文件内容如下: j+ a- x# }/ \
#ifndef QTCONCURRENT_RUNBASE_H
- W* o- g$ A+ E#define QTCONCURRENT_RUNBASE_H1 n2 U! B* N: h) `* r
! h3 O N3 p6 Y" b8 m$ [2 i7 F#include <QtCore/qglobal.h>
) b! A) u0 R* Y$ t
3 O) u: l+ {9 {& B/ o; `#ifndef QT_NO_CONCURRENT
2 o; _& m- Z) b+ F4 ]9 l& C1 J! r7 ^; R' _
#include <QtCore/qfuture.h>
1 u. ~: ?& \; d, h; f* g1 C#include <QtCore/qrunnable.h>
. l2 N7 u& Q, Q* R6 s- i- J4 K#include <QtCore/qthreadpool.h>
: \* n7 x' _* ]$ P+ J" c# s, G# q" N" |4 W% B. R
QT_BEGIN_HEADER
6 {) X% @' Y4 f8 n8 `QT_BEGIN_NAMESPACE" Y5 y. R7 ]5 b
& {8 d8 Z* g4 A8 _, cQT_MODULE(Core)
- F& I( V Y8 q4 Z" j: D* q& {0 ^! e8 a/ V
#ifndef qdoc
2 o2 ]) |1 N1 j$ v' H3 o4 s% m, N( g2 e( E$ K1 Z1 n: ~: Y
namespace QtConcurrent {* g! }, @6 G) ?1 i5 O9 g
3 K5 b7 u/ ^0 u. M, q6 z
template <typename T>
- e0 |5 h d& N* r8 C9 Wstruct SelectSpecialization* { P- w/ e8 s/ M; @0 e+ m Y
{5 \' G3 {1 R# T9 J. c+ Q1 U
template <class Normal, class Void>
6 d+ J2 `+ a1 D struct Type { typedef Normal type; };9 H4 q3 e% @& u" b
};' p* n* B& P" ?! k! J0 g; s8 H
( ~0 G @+ b1 F$ [1 a+ ^template <>3 R- p8 t& ^9 y2 @' Z# f. W
struct SelectSpecialization<void>6 u3 n- P, {2 L& {% Z: g7 k
{
5 ?6 A% I, f# M) a0 j template <class Normal, class Void>7 k+ y' c- J5 z& B+ r
struct Type { typedef Void type; };! P$ s0 l# Z0 n% n# }, F( J
};1 q" \. W8 s9 s! @$ Z* g
! O) v& b9 |2 O' u( @! L" stemplate <typename T>2 @7 J' e y- f2 ]5 ]
class RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable
' J9 z( c5 V; b" _& T{9 l' D$ M: ]4 C' u! _) m
public:
' h' ^4 @# G; L. M) g QFuture<T> start()
3 i1 `/ _8 I5 l, v {
+ c# c/ U2 T# q" G* u* C this->setRunnable(this);
0 V/ `4 Q, I( I7 E1 I this->reportStarted();
+ a# K' P% ?' w! Y2 U8 e) x QFuture<T> future = this->future();
2 ~+ F; k, P2 X0 y2 s4 A QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);8 F+ p6 Y8 y- q, i; m
return future;
% j$ |6 U4 S% J7 ~3 l/ D }
1 E% f5 w8 u. X# w G
% j! B- l# b1 H0 ]* ` void run() {}
# P" L) l0 }, ~6 V; S$ X virtual void runFunctor() = 0;
- q% E3 a1 ?1 ?3 x, \6 \- r; t* U};
7 X4 A3 b' O& v" O8 d* Y& L) z N- j6 j2 u% v
template <typename T>4 \' P; Z% F/ b2 c) g
class RunFunctionTask : public RunFunctionTaskBase<T>) M) X) o7 w) K/ g* o
{- \* \% F2 r1 S
public:3 @! _! B' `+ q) w3 ?" ^
void run()
}* a7 U4 }+ J; w {
+ w/ Y9 K& s) @& B8 q if (this->isCanceled()) {
/ ~8 l# G5 b" W* B* [ this->reportFinished();
4 S1 w7 m0 K2 u return;$ @- C2 l3 f) K8 ?
}
" F% P k% Z# p- x this->runFunctor();
, u+ y! z& C Y% R: t this->reportResult(result);( ^, V, N. K$ b4 z* G# X$ ~
this->reportFinished();
, `4 Y% W B2 @7 m7 i! T3 D" x. ]- [ }# p0 Q0 g! Z9 a, R5 L% H: U9 Q+ I4 w: ~
T result;
3 W, F/ ^5 ]- X9 K7 Z7 ?};
5 F$ Z- k V! d% |: V7 }: y3 M; L, X. d- ?, P% J0 t
template <>( m, v- s+ i' p0 N8 s" I) H
class RunFunctionTask<void> : public RunFunctionTaskBase<void>& \: ^7 l% P. z, e+ a; i/ i& l8 r
{
8 ~; s0 E' @) S8 ^' Spublic:0 B% j+ B+ e( t& \
void run()
9 l7 n2 G1 I- e, P9 x {9 N5 F8 ^1 x6 v, N" D
if (this->isCanceled()) {1 K# |5 a! _* k5 P$ x3 j% t8 q0 U' Y
this->reportFinished();+ S% a- u& [! Y2 [ y1 P$ r
return;+ l7 W% b# i$ K+ H! B% g
}1 N9 A: @ E) T8 W6 V' I, H
this->runFunctor();9 m9 V+ f% `& i/ B
this->reportFinished();
2 T- [$ A* q1 `: f1 L! P }2 C4 r2 l: g2 R4 e9 W
};/ X u! ?3 T3 o9 `& \; D
; W- s1 u+ m( E8 R} //namespace QtConcurrent. o, _2 }# Q6 v$ p5 c( q
* U7 c% y/ c6 R- l5 N( V* `8 O$ r* c
#endif //qdoc z3 I; ]! ]. n6 U
( h& r# i9 r( q! W0 w% P$ g
QT_END_NAMESPACE
% i( O- R" o( a) A9 q9 sQT_END_HEADER0 l3 A. [! R( F+ W
9 z3 x7 L* z1 Z#endif // QT_NO_CONCURRENT
% t' J0 n! S) z3 `1 ]
& j( M9 M7 S% y* N#endif
' V9 U6 l) Q5 r8 q" H
9 r! F* `8 ]6 V( X o- L5 T |
|