|
|
我对syslink进行交叉编译到arm,但是出现如下错误:; W' X3 R! ?( c2 o' g7 v
/home/tl/Projects/Xdl-build-arm/../../qt/Qt4.7/include/QtCore/qtconcurrentrunbase.h:65: error: two or more data types in declaration of 'parameter'" e5 x7 B, q0 R& t. g0 u
2 w$ g/ [* Z) f0 l% {( a1 J) ]
这个头文件内容如下:" t) M$ p; B9 b* |/ H
#ifndef QTCONCURRENT_RUNBASE_H3 b* r( |! R1 |, u
#define QTCONCURRENT_RUNBASE_H* I6 X% D M7 D% G4 C9 k
' e# e' E$ L# w! y6 v- r
#include <QtCore/qglobal.h>
& W4 U- u% d5 P0 x6 [ W0 w& t; a
#ifndef QT_NO_CONCURRENT
0 @) P% A: }& \) \6 U2 d' S$ e
+ E# B: ~8 r. s# _#include <QtCore/qfuture.h> n c% u' j2 y- ?- @
#include <QtCore/qrunnable.h>
L- y1 n# f6 u; c#include <QtCore/qthreadpool.h>
* k) Z! C+ e1 d3 b- x4 S
% Y( L4 b, P( x# j; g$ ^QT_BEGIN_HEADER- G! J. Z6 B& `' Q! R8 J1 O
QT_BEGIN_NAMESPACE
+ t1 Y! p q( \$ j: G7 g
1 e5 \; X9 j# s7 S' a* f" [QT_MODULE(Core)& K* t' G! ~# t3 p7 R
% V. v# v" _! M" \#ifndef qdoc8 e; p. V! T4 Q O3 ~, Q
6 U8 f" t0 L' [ |% V2 [0 ~
namespace QtConcurrent {
& X# Q, h- K0 e& w
9 D( ` A: l8 q/ G4 xtemplate <typename T>
2 I p0 [# N( Z5 i/ s9 Ystruct SelectSpecialization4 r; k2 F1 m7 [! k# |6 _) v
{
8 D7 ~" T" R/ V, v) U* B7 l, ~ template <class Normal, class Void>
: k7 \+ b# w W' W! c3 M5 S struct Type { typedef Normal type; };6 M/ T, U- l) I, _, n6 J
};
9 {% Y9 P) T6 `1 W3 V% _& n4 H3 {5 C2 a# U+ @- Z' y
template <>
% m U$ [1 g, hstruct SelectSpecialization<void>+ [. V: Q- L3 n9 @* ^! I) Z
{: K; v# ]' S! K
template <class Normal, class Void>; e/ }; k. P# t: M1 k% N2 g
struct Type { typedef Void type; };6 g* p2 b0 h6 ]. E" c* ~& V i4 F
};7 g2 p7 ? ?( s
& c: C# K% k s' Y& r/ Z- Qtemplate <typename T>
5 E! Y' U/ |5 ^1 c! {+ c' x3 oclass RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable' r d5 p1 S. S4 d. M/ E( V! I
{
+ q8 U5 w: H% l8 m) E+ ?! Mpublic:; i4 {; _, {; q3 r" m; Y# n+ [! T/ {& c
QFuture<T> start()" t0 }7 {9 R) l+ u. N) ]* C4 a8 Z
{( o/ J( N( f4 ~& f+ w
this->setRunnable(this);" w7 U! d& p% ~# e; V) X$ h
this->reportStarted();
: {" @7 x% y- ?; d QFuture<T> future = this->future();% }/ d0 f6 N% r
QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);& N; k* h7 \! l0 B4 x% [. f5 F: g
return future;
~% I& v+ i7 j: t' r, e }& h" P+ x+ g, q5 i# y' A
5 f" t: a1 w& K# p; a void run() {}
/ G- H2 A4 x# U virtual void runFunctor() = 0;4 m3 h7 L7 [# h* N
};% }7 C6 b, C8 f, r% X* B
( w3 `5 Y; W6 i5 i
template <typename T>
' h$ i6 ?" r9 v) ~0 jclass RunFunctionTask : public RunFunctionTaskBase<T>
* R% j- ~ p0 V% n7 G{1 u2 s6 \6 m0 ?/ ~% E3 R
public:, x! ~2 J$ K& W
void run()5 K7 H; W+ p" j5 _
{0 w1 G- q/ A1 t9 e& X
if (this->isCanceled()) {; G' j d8 o1 M5 U* ]* t: N
this->reportFinished();
/ [+ [3 _' H3 l- { return;3 h8 D9 {) n$ B
}* C) l" w4 W6 c" x/ a! C
this->runFunctor();! ^. M5 Y# T7 Y# Q1 E
this->reportResult(result);
# u7 |. d: w) p B8 i* I this->reportFinished();
4 n# R7 b. O9 R }2 ~) x! C0 Y! [9 _
T result;
1 Z; `2 @$ V" |' t! h& E* x};
! E6 s+ ? F6 G& ~% L
9 N$ G/ k- ^7 W7 |+ \( I" wtemplate <>5 a. N$ D9 w+ X- B
class RunFunctionTask<void> : public RunFunctionTaskBase<void># {6 ^+ T3 x$ E, f8 h
{6 a( h) N+ M. K, l4 c( J# U
public:
% D# K" H! p$ {7 A8 d. y* ? void run()
4 Q {& ~$ e/ y/ A0 U3 C# e {
! x, Z- v+ z( A# A2 i& G, q. } if (this->isCanceled()) {
. Z. p1 h; h, h; ?, q this->reportFinished();
S$ H! `, ]' d" I# i! o; [ return;9 B0 @3 C0 U1 `) H |- U
}- u7 Z( G: F5 H$ H3 V e
this->runFunctor();+ t0 @4 G \" R/ J& ~
this->reportFinished();/ p0 T- r$ h k& |! M5 O" Q) b. a
}
/ T; C4 o4 i/ D$ ~) K};
6 B& Y; R8 D* w
% d2 ? G) \3 L* h3 D S} //namespace QtConcurrent; a+ c) J1 X( a8 e7 O9 w, B3 j
) v* }& R; ?, b/ Z& r9 W3 K4 B#endif //qdoc1 F+ V. V( u8 k+ y3 e
9 i, e0 S( y( K/ MQT_END_NAMESPACE
; j# r8 b4 Q+ C* a; E. n& cQT_END_HEADER/ K1 f# d4 v' Z3 K0 R: m7 V
+ |9 {; v3 N( R) y/ r2 v, @
#endif // QT_NO_CONCURRENT
% Q( w% ?- r! G* K I7 f2 f& J X9 B. j% E1 U3 p
#endif# a5 F4 S; P( b, |7 i$ U
2 y6 `8 {1 x- f( c4 S( L5 z |
|