|
|
我对syslink进行交叉编译到arm,但是出现如下错误:$ ^ V O3 H. O
/home/tl/Projects/Xdl-build-arm/../../qt/Qt4.7/include/QtCore/qtconcurrentrunbase.h:65: error: two or more data types in declaration of 'parameter'
) {' @1 {8 Z. U& T- q8 L4 h
) s* F+ Z9 |/ X# V# O2 T! k7 D这个头文件内容如下:
, B- Y, W- Z; |3 ?; o#ifndef QTCONCURRENT_RUNBASE_H
2 |: d* y. ?' @3 w+ F9 _( T; o#define QTCONCURRENT_RUNBASE_H; C' H- _' x4 e1 C' M
% s+ Y1 Y; a/ ]' D/ @
#include <QtCore/qglobal.h>4 M$ I4 m5 P3 L' F
! Y6 d2 q/ @4 l3 d* L! u$ H3 h
#ifndef QT_NO_CONCURRENT
, B" S- I6 f: \2 U/ j8 x; o% D, q$ j
#include <QtCore/qfuture.h>
' E+ W/ w% y# C#include <QtCore/qrunnable.h>
V! c9 h7 @* X+ F( y#include <QtCore/qthreadpool.h>2 i/ N3 \) {8 e: F. L+ M. z
i3 ~2 z4 U$ |, }5 W4 U
QT_BEGIN_HEADER ]3 U. h$ X# D0 g+ l! C3 r
QT_BEGIN_NAMESPACE
+ H# o8 I3 q/ W0 c* M; m* h& I( _$ }. [- V9 a
QT_MODULE(Core)4 X3 r9 l% v* j2 P
. z$ H, N# s( r Q
#ifndef qdoc
* }2 b8 L0 C2 G) x7 J Z' n3 v' Z0 {: V3 J+ }9 `4 M
namespace QtConcurrent {
; a7 N: Z; g% F0 B5 y" V
0 z0 F3 S3 L- `6 btemplate <typename T>
" j; M% W6 ^* w+ O6 Astruct SelectSpecialization# C* j% m- h/ g+ a3 e# z
{
# G3 B/ c5 |4 U3 N9 w# W" Q n; M7 R template <class Normal, class Void>0 H( s, e1 U; C# ?2 w, J2 d
struct Type { typedef Normal type; };% r/ K& s" V& h7 b x1 }6 @( w
};
. Z4 z. O- _9 e0 b
5 |9 |; `, A9 J) U! }2 utemplate <>6 Y: |9 E8 _/ f1 Z h+ w5 z* ]
struct SelectSpecialization<void>
4 O2 u9 R# J0 `' D! s{) [0 \" ^; N& G5 u& }
template <class Normal, class Void>
% v* ^+ O' J8 h: z struct Type { typedef Void type; };
1 y8 i) A% a/ L" \7 s};; Y/ x9 n" D% G, V0 R
4 P6 y. }$ S" p4 h0 n# v- ztemplate <typename T>
3 P7 x( \0 d- E4 H5 r& Zclass RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable
2 Y$ q& L$ w, r9 C+ z, f+ P{
! j% b. k/ L6 hpublic:
( g# J, B! O! B- T/ q0 S QFuture<T> start()" N& r' q8 k! J
{3 z; K" Y6 N" F* e
this->setRunnable(this);
& B" j5 j: r% y this->reportStarted();
' C! D: f: i7 l$ s5 Z" [ QFuture<T> future = this->future();
/ J" d" h' Z+ Q QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);! {& ^3 h! \, q. x6 ~
return future;0 @: }5 s! @* J- w3 R
}
& k7 V( x8 q" }2 ^: \/ g0 b1 w
" Q5 n: E! g* Y* E+ `- `' \ void run() {}
* G# t6 J3 D' y" M virtual void runFunctor() = 0;: E0 c% c7 h8 t. I4 m5 h+ c0 P* F1 k9 {
};
9 H) p0 X. n5 u" Z( y: }9 S* Z8 S, s5 q7 X
template <typename T>
- n5 w7 N4 P& M3 Fclass RunFunctionTask : public RunFunctionTaskBase<T>
( q! \0 M8 E& C& I0 }2 p4 l{
% U% v$ `: B0 e9 {1 Qpublic:
4 v _/ V4 ^& d7 ? void run()
H | g# n7 C, B4 v# K, [ {
' I* ^* n6 W1 w$ s0 R7 F if (this->isCanceled()) {& D& K- l$ S3 F3 {5 E/ N
this->reportFinished();
! x* Z" S3 P" X: U6 N" j return;
8 Z2 ~- i& ]: U! I9 u5 c0 D }3 S8 u) J# e- y- q4 q
this->runFunctor();6 x6 w. E! G' \5 D* x! H1 ]
this->reportResult(result);
Y \: ~3 K S# B* @- P this->reportFinished();
x$ X5 e5 r; t& s. N* f }# J( H l* L( L+ o" Z
T result;
1 W- X: [1 n) S+ G$ g9 ?8 G};+ k2 v; j0 X. T
3 v. g" ~' A$ n& i
template <>3 v# G9 Z: \+ L2 ]
class RunFunctionTask<void> : public RunFunctionTaskBase<void>! H) l3 L4 J% y, S9 `
{
+ Q9 s! Q& }" r- \9 G8 vpublic:1 U& Q' e# O# z& `" p1 H
void run()
2 p' `7 k- `- Y k {
/ h: t4 N& ^ H! O1 r+ }$ Z$ } if (this->isCanceled()) {
( J% h0 G$ f5 X- l# l( C* U this->reportFinished();# x# P1 _3 f0 Q; G
return;( x1 V1 O* Z6 N& W' c
}3 O5 I1 c# n1 W) T4 y* N* q
this->runFunctor();
1 E, O" C( v. D% r) r( Y/ _ this->reportFinished();
, B$ a* k$ b0 {* k, [ }: Q- d/ i( q K; [; p7 \7 `
};
! t# s5 i; C. Y- ?
! R& g- Y6 r, u% Q} //namespace QtConcurrent
% Y! o h( t8 j: c0 U
! t( t& q/ n* v9 u! m" U#endif //qdoc! O( C* I0 u4 @) w& Z) y
' |. w4 K% N& w( u0 g, q4 D
QT_END_NAMESPACE5 |9 f, R; v6 R) Y
QT_END_HEADER0 O7 r2 ^' m+ v, @6 H. H0 e: ]0 Z9 |
6 s* E1 P, c5 S' ?2 j5 |8 k; ^ u
#endif // QT_NO_CONCURRENT
- v- z( Y: L: s, X3 c
! h/ d- r/ d5 |: {' O, j' X#endif0 e4 \+ p+ G4 C4 D
9 i+ \/ |* P3 y6 F: _! e# P |
|