|
|
我对syslink进行交叉编译到arm,但是出现如下错误:# s/ F* s: f U. k s! F) 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'2 ^! g4 \1 y8 y: y: w6 ^! \
' V' `' N' V& d+ c6 U0 T这个头文件内容如下:
, J$ C, A* y% Y# u7 p3 x#ifndef QTCONCURRENT_RUNBASE_H# N+ k, f( x+ N, D2 w0 y
#define QTCONCURRENT_RUNBASE_H
2 Y9 [) m; i+ I3 `' Q' ~! p- w' m: I( A p+ Z, v2 d% u2 n
#include <QtCore/qglobal.h>6 a2 A4 @3 w3 F ? D4 a1 Y1 c
& b8 ?. w' F( K3 {" X* ]
#ifndef QT_NO_CONCURRENT
- U0 M) q9 W% m3 ]3 J& f; F
/ S( g4 r3 V0 ~6 x) E. }#include <QtCore/qfuture.h>9 z; Y6 g: ]8 Z* I1 ?$ t
#include <QtCore/qrunnable.h>6 R6 M* E# \4 P
#include <QtCore/qthreadpool.h>2 C/ i$ G8 b$ h( R1 j o# j' E
0 T7 u B3 c, \, }# gQT_BEGIN_HEADER. _# s$ t3 N g, t1 J' T2 \0 u1 B
QT_BEGIN_NAMESPACE
4 i, z& I& g6 k* O
' x5 q" P. e$ B3 j3 k: sQT_MODULE(Core)4 L! s* r/ _9 m/ W: u
/ i6 E% x9 f7 c0 P#ifndef qdoc
9 n" r: W2 K, |4 U+ u& P( ~* E6 B" X# R5 Y
namespace QtConcurrent {1 `7 o9 Q3 S2 B$ i
& y: O. J0 C w: X- etemplate <typename T>0 p1 ] Q# A# r( v6 L% [6 R1 X( k
struct SelectSpecialization
& ^) ?' N6 z5 M p, s- j{& K: V0 z; v6 A: x8 `
template <class Normal, class Void>
) q4 O8 E# D8 H/ e; g) Y struct Type { typedef Normal type; };5 \1 e, I5 o8 U8 ~7 s* ]
};
; q3 x( m- x' _: N4 O
- T3 C- M3 M1 Rtemplate <>! Z) d0 K, Y7 O
struct SelectSpecialization<void>4 D$ t+ ~3 g* V% ]2 ]2 A
{; B/ C' q: Y0 c6 [' u5 U! a
template <class Normal, class Void>
& a' Z3 M) u. d) w4 L% B7 c struct Type { typedef Void type; };
$ |& Q$ C& i& S! R* u};9 c2 k# }. ^% O
8 N, Q# X. T) O+ \/ e
template <typename T>$ o0 h/ n4 J. o/ c$ L% f \2 h
class RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable
0 D# P# U/ x ~" g{( D8 v% J: D: W: d) V4 P
public:
) z( x- B0 U/ F6 z' B QFuture<T> start()
& Z" k+ H! M, Z8 d% Q3 u t+ ^ {* _! V& x/ S3 p- s7 N# e
this->setRunnable(this);
4 c" x" |) g( I# q# O) Z [9 w this->reportStarted();
6 \" a. I% `. W# V& O" Q0 c( Q QFuture<T> future = this->future();
& W6 J4 e: u' R$ D- c) ]9 { QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);
% ^4 ^7 F+ l* b; t return future;
( q/ M& j0 [; j6 s }
2 e6 _' Y( N+ b2 U; a7 U; _/ p0 O N+ E) \- Q' v U
void run() {} a0 u9 B5 A$ H7 n
virtual void runFunctor() = 0; @9 a6 m0 m+ v# [
};
/ f. `4 J9 z4 j( C5 W. i3 ~! J; j8 C9 H- ^- Q( _' ^
template <typename T>
Q& Y# ~5 `, r+ B, A4 Eclass RunFunctionTask : public RunFunctionTaskBase<T>
# G/ d& g0 e$ b; K1 E{
* S0 [; O. I0 e' f" u* Bpublic:7 c3 ?' ^2 s& n# }7 k- H R! ?) J
void run()% B1 @# S# \) J2 V. o. e% ?* d
{7 n+ n% q$ j! V
if (this->isCanceled()) {6 B' G ?1 }4 w+ z6 |1 d
this->reportFinished();
+ `" h4 f2 Z; F9 B$ h, a return;
) d! ]. E& b% Q8 W }
( }# o; }5 P' N% a }: z this->runFunctor();
3 V+ X7 E, o2 u( m2 {- Z this->reportResult(result);7 ?& T7 p/ `/ g, r5 O9 X" S
this->reportFinished();( V/ n N2 I* m0 R' O
}
. \% X# {: O% Y. e+ C, F* v T result;& J5 d( i6 Y% q0 O M' B% |5 }
};. W$ ~9 u3 U8 X( K$ K
4 S$ e$ P s1 etemplate <>
2 j0 o) V% M9 ~! Z5 w" gclass RunFunctionTask<void> : public RunFunctionTaskBase<void>- J6 u( N" W. [9 w# D
{" G, G# u& G3 w, {2 S
public:! E9 W8 o: g+ y
void run()) N. k8 \9 |# {' V) l1 b1 Y/ f' J3 w
{7 {( a% w+ n6 Y. l; J- x* c
if (this->isCanceled()) {2 z( Q$ ] J4 Y3 a/ [5 z
this->reportFinished();% V4 I- L2 H3 I; H: Y' T
return;5 X$ Q; p. F8 ^! T0 k5 A
}, l; Z; w3 d5 M7 B2 Y
this->runFunctor();
& L1 Z9 D$ c" p& S E1 i1 m6 t$ y this->reportFinished();# N3 }* z$ a, S# D) {9 H
}
. s8 F) V1 Q) N* q$ S. a};
J f& P6 [* K2 d8 N' _$ v4 {+ y2 y* z. ^8 a% ~0 [
} //namespace QtConcurrent
( ^7 d7 e( C& @) L9 a' D/ B( ?* W3 T+ y
#endif //qdoc
0 {! b( O$ d7 E7 t9 o; n
. L. a: C+ w7 rQT_END_NAMESPACE
! W+ d- N( f) P2 K: D$ m& TQT_END_HEADER F% L5 u3 w* _ M# p, X6 a6 E* h' ?
5 O) E/ i- W) g2 \5 ~
#endif // QT_NO_CONCURRENT! B# b- ?5 `$ m+ j! D8 Q. {/ a
) `& m9 Z* g4 F4 {
#endif
3 f% C* V, Q7 p* C9 o
3 \7 G3 g3 ^$ Y |
|