|
|
我对syslink进行交叉编译到arm,但是出现如下错误:' A' |: F: u' k
/home/tl/Projects/Xdl-build-arm/../../qt/Qt4.7/include/QtCore/qtconcurrentrunbase.h:65: error: two or more data types in declaration of 'parameter'
. j: Q1 V9 Q G c4 H: Q: l$ N* {! i# p( i$ A1 V) h2 D6 \ O
这个头文件内容如下: D! \, A) k% T$ ~! e+ J& S, R
#ifndef QTCONCURRENT_RUNBASE_H
1 H, k1 q$ R1 T, t- s#define QTCONCURRENT_RUNBASE_H* e6 r5 h7 t" `! ~* a& y; d
" N- o" b- U2 _: T( t8 x#include <QtCore/qglobal.h>
2 z4 I- }7 }1 N& `7 q* l( \2 k" f _- I4 n& a
#ifndef QT_NO_CONCURRENT+ Z S9 ^" W( w: T
, W5 D( u1 x1 S& h' Y
#include <QtCore/qfuture.h>0 t, \! r u: f, Z/ N% C
#include <QtCore/qrunnable.h>
! V0 ^7 ]7 P: e#include <QtCore/qthreadpool.h>( L9 `9 H5 z4 J C: I. {2 f! @- ]7 Q
) o' R9 o6 P7 J6 ^QT_BEGIN_HEADER
$ u) J ~ z5 l7 R* y8 W, LQT_BEGIN_NAMESPACE
8 i& g+ H; e0 R# M# E: r: U
: L' K! g& G' B- D4 IQT_MODULE(Core)+ j0 U9 _) m9 u% g; G$ _5 O
9 r! G% h6 p. b4 H#ifndef qdoc
$ C; @9 i- d8 D- ^' W, y8 x; C- G2 B, S6 d1 y
namespace QtConcurrent {3 J4 O* X7 b( n& Y; q2 n' n0 I
. B. D/ u1 t6 p* X# [7 g" M
template <typename T>
: p) O. \3 ?1 B- w, W3 y8 Ostruct SelectSpecialization0 b! X3 M* l# ~
{
, _/ p3 r( i. V' @3 w1 U+ _( h template <class Normal, class Void>
7 {7 s5 I* `9 O1 c N- H* s4 V- Q struct Type { typedef Normal type; };
V% a3 [0 Z+ Z; U};
( _9 R# ]2 A) F" ]% l6 _; w4 B3 }! W% n& v
template <>1 o1 ?3 \+ E; K9 z$ ^8 x
struct SelectSpecialization<void>
o% R. k0 @# D5 }) K{( v$ R3 W t. [
template <class Normal, class Void>8 `; H7 o! U& u/ ^7 m: u# V
struct Type { typedef Void type; };
' C" C* h, D& ^: F- N: s) B" Y; i" L};% e, P) c/ d: R% k( z: g4 l X' g
l H: p' n3 s- c& N
template <typename T>
4 w2 |- h7 E7 v( @ {' f0 Lclass RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable
) P6 | A4 N% W( u' [{/ B J4 U- C. v3 d" @1 C
public:
. i6 V+ u- _0 y9 B& Q5 l# Q QFuture<T> start()( y7 o( f5 ]$ K' M( z/ P
{* W$ m ?1 R! v$ P7 D$ i
this->setRunnable(this);
8 I, [7 Q3 j @ y" ^! q# w this->reportStarted();
$ h9 k: @- j3 c5 \! R" F QFuture<T> future = this->future();
' a6 q% B+ w7 m, l% f u9 v QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);
' L2 F8 o3 e0 p) U U& \ return future;
1 p% ^9 k, l, q2 W5 [ }" g9 O/ b- F4 h d3 n( o
/ m2 L! w4 W) ?0 x, m4 p
void run() {}5 h& z3 W" i) H
virtual void runFunctor() = 0;
4 y, O u% `# E3 Z |};4 s2 C0 D' H( g' s4 |
- w6 G# B* |" m* h/ h2 w, `' Mtemplate <typename T>4 R& w* }& W- A' N
class RunFunctionTask : public RunFunctionTaskBase<T>
* ^: i4 f9 m5 d9 N{7 h+ k9 s3 j6 q5 I, Y
public:
: N1 L3 p+ B* | void run()8 D) E+ Y( V+ J& |
{, u$ u k- L& S8 ^5 V
if (this->isCanceled()) {" _$ `) a( c4 n/ T, Z
this->reportFinished();
: O4 ]) M+ e1 I5 l return;
% r# ]9 V, A# E3 Y6 {; L+ X }
, S E9 \+ O o9 G* k this->runFunctor();$ ^, v) E0 N: @/ C H3 T
this->reportResult(result);
/ B8 x' @' z9 o this->reportFinished();
& L& l& Q+ q9 s' f) B; `# U }
" c) C5 ?" @2 Q0 x T result;8 J4 c1 ^5 X7 G
};- k; Q/ o% r% i+ r8 g
1 j! P+ F8 _# N( F7 _3 E+ C* _template <>9 ]* e: b8 Q$ Q8 j
class RunFunctionTask<void> : public RunFunctionTaskBase<void>1 Y* {. Y3 c: D* t G
{' I- M- {1 ]. c
public:
! G [2 Q' f; F* @3 F( P void run()6 }7 u p% s$ ?; S
{7 L5 a8 h4 v. o: c% q8 y& u( S
if (this->isCanceled()) {) s( ^' L2 F n- c7 e8 Y( P& G5 P
this->reportFinished();
# e; ~1 G7 l2 l2 ?8 m return;
- o; F9 {9 z! T6 b" y7 I }& c( j$ ^# h$ T o( i+ K* ~
this->runFunctor();
& Q8 F f1 {4 P9 M! d this->reportFinished();7 u' n5 U# b$ R( J7 J# q* a; X
}6 T1 z& ]. X( f' n2 L
};# D9 r% ^% d+ B- A Y
' R/ ~! A }: q7 r7 F} //namespace QtConcurrent
: E) F$ M0 U9 ?3 C3 p& |8 C" N8 s4 x- s
#endif //qdoc" T( D+ k/ S. q& _0 B
4 N4 Q! o- D8 x S! t0 W3 c: b$ x8 j* I
QT_END_NAMESPACE( M) _: u1 ~! e7 [* P! e6 n
QT_END_HEADER6 m; x, Z! Y/ m( m0 m% _ D
( N9 M8 h" p9 }; \' }#endif // QT_NO_CONCURRENT
2 L' K. T7 P; F1 n4 N% ~( Y- B
9 x2 P& K* S. l* e# P4 b#endif
( h4 |2 \! o4 X: |* O% J/ H9 m
( {. ^' a- X' e7 `! R( x$ z# w |
|