|
|
我对syslink进行交叉编译到arm,但是出现如下错误:( W! N. x0 [, g* i; b# k1 a0 n, e
/home/tl/Projects/Xdl-build-arm/../../qt/Qt4.7/include/QtCore/qtconcurrentrunbase.h:65: error: two or more data types in declaration of 'parameter'
6 H0 Y5 S0 U( }4 ?/ V% Y9 j6 |" [% S$ C- j6 @
这个头文件内容如下:7 C) l8 k& ]0 G
#ifndef QTCONCURRENT_RUNBASE_H6 z" e. [( u7 b( D
#define QTCONCURRENT_RUNBASE_H
( K+ s. G" m1 `+ H
1 v2 f/ X/ Q0 H( z+ Q2 v#include <QtCore/qglobal.h>' M8 C% k" h f% p6 L% p; {
% }; S* H+ Q6 O5 q
#ifndef QT_NO_CONCURRENT
: x9 v" w0 P! r0 U$ `; Q! N6 ?5 D
& s# m# c8 i4 m. n#include <QtCore/qfuture.h>% r5 s. d0 w9 v, L
#include <QtCore/qrunnable.h>" G; D' u* N, j5 V0 D4 ?2 k
#include <QtCore/qthreadpool.h>
5 T8 S2 L4 R4 H: r8 G
1 b: q, {& q T$ b, pQT_BEGIN_HEADER
8 P$ `# b7 X" [6 r5 Y( ZQT_BEGIN_NAMESPACE
5 b4 L; B9 q, X6 i9 h8 a8 A
, x4 |+ z7 N' gQT_MODULE(Core)* {2 X# `" v( a4 I3 h$ P
, H/ t5 z& _3 ^) D* t' w( F1 n2 B3 r
#ifndef qdoc( W- i7 K& B" U
6 s2 b# E# N: G! I0 ?3 F9 fnamespace QtConcurrent {
& d \7 D$ v& _0 [- b0 j% |5 e* n
template <typename T>- k0 \2 H! C7 {- k
struct SelectSpecialization7 z! ? x8 R- c5 G) c
{2 @! y. h1 {3 d0 e4 N- K5 p% ?
template <class Normal, class Void>! Z# v' r. B+ n2 D; ^" F
struct Type { typedef Normal type; };5 g, W1 O. e2 J1 j5 [1 V) X8 l
};
9 E" c$ h/ W; J8 w6 s
- _% ^+ ^ ]- d- r9 |0 x" x( Ztemplate <>* o9 R, g+ d: k& N0 N
struct SelectSpecialization<void># P8 c4 T- P2 o% d# d4 y
{3 S8 A; k1 z" U, l
template <class Normal, class Void>
+ Z5 E* c4 Z v: j* r% | struct Type { typedef Void type; };
2 ? t" q" L9 D8 z7 M};
2 |4 C# {+ Y# j& {' ?; `' i% ~- b" O& I7 g
template <typename T>
" t0 l$ p# }6 c0 c/ } Iclass RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable
* {" X. y% J; T. U4 l: _, Z# H{3 U! U' z) O/ D# s2 x7 w. z/ v' B- ~
public:
( Q1 I2 B* r8 u( y QFuture<T> start(). ]6 j. Y( P% Q2 b/ B
{
2 X0 m7 f; k9 s. H this->setRunnable(this);3 V3 k6 J6 {4 A/ g. A0 R
this->reportStarted();
6 [. l. g7 E. E' p QFuture<T> future = this->future();( g# j0 E8 T$ g
QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);9 ?% ?/ q0 d! B" N5 r( n
return future;& T* a% G1 E& h/ i
}
! C, ?, T' M# G# q% C5 P" ]5 l6 ~" F4 N0 T4 i
void run() {}3 i& S( h* W: y, [( m
virtual void runFunctor() = 0;
]. k6 b" L2 G4 Y) z: l2 v! Q};3 A+ |" {. @% E# v2 x
0 l( ^. P, p7 ]8 v. c: c& r; H( Utemplate <typename T>
: ^ y4 i& U5 o; B# J0 mclass RunFunctionTask : public RunFunctionTaskBase<T>0 b# V; ^6 A- v* _ M& h
{
& F2 V6 \0 z% E% Hpublic:
3 s- C8 S; K( \* b' T2 }" P0 \ void run()7 r0 i$ [2 B& H7 w
{) _# P# |, q2 y$ s3 C
if (this->isCanceled()) {
4 D7 c# H- \) G! V- Q+ Y( U2 Q this->reportFinished();5 r3 P4 \1 u* _" R& ]4 r( V
return;/ S* u7 G$ \* E& ~
}# V$ r9 P7 _/ @! D% Q2 j
this->runFunctor();" D+ @' C6 x+ P
this->reportResult(result);
( C9 p0 ~% n; J( C) @( j; o this->reportFinished();6 ]: u8 q8 p G, N$ U# \
}0 ^+ a2 k% L3 P0 Z
T result;
% Q# h+ s" t* w `+ z& @ S) K};
) \- E: \" h. [# B' V: m5 c' i8 z
template <>& f' E, b, l* J0 v. W2 t! A+ P0 h
class RunFunctionTask<void> : public RunFunctionTaskBase<void>/ `! e; w6 ]) _! W9 k
{
% D( U2 C) R5 U4 Zpublic:
9 Q0 b2 D1 Z* n* G. l void run()
& N8 J8 p) N0 J. Y! d- M- x* C {' O, X! \5 w& f I
if (this->isCanceled()) {
) X# n, ?7 b( P# V. [! J; A' e this->reportFinished();! T! o+ e6 [, x c, W! n
return;
% K. ]; D6 j1 W! o }
' u& u* `0 y* X' {( s. o; Q this->runFunctor();
* ?" n* f# q* q8 @ this->reportFinished();
) Z! ~- u9 [; D- V } ]# {2 d3 g4 O2 U3 o
};/ S6 d3 M) x7 o# F/ N5 \
! e4 R3 J% z5 S; ~} //namespace QtConcurrent2 d7 k2 s% d" u* w2 @; f
+ y0 ]( ?- r Y. x& s% r
#endif //qdoc
6 B% X- B, ^3 E$ b: A! z
# L' H: e" N& x. u, `, yQT_END_NAMESPACE
( `0 Y8 i3 i- `: ~6 Q: z3 fQT_END_HEADER
6 N( Y+ G9 l# B4 u
" D0 M) M1 x( F u7 `6 T' n#endif // QT_NO_CONCURRENT
' g+ g' B( v, F7 A5 X* @% h4 g: j, k. n! \/ }
#endif
+ _: Y1 M+ _9 v% y* M" n4 ]! s) ]" ~0 M
|
|