|
|
我对syslink进行交叉编译到arm,但是出现如下错误:) }7 i6 Z: ^' n; r' ~. ~! @2 M$ w
/home/tl/Projects/Xdl-build-arm/../../qt/Qt4.7/include/QtCore/qtconcurrentrunbase.h:65: error: two or more data types in declaration of 'parameter'
7 N7 I1 ^+ C" S- {8 V' Q
3 C. K. f- f w! o这个头文件内容如下:2 w( @7 F; D) r1 Y5 p& v
#ifndef QTCONCURRENT_RUNBASE_H
/ S$ N) Z# J" k- f#define QTCONCURRENT_RUNBASE_H8 A4 Z9 e3 c0 Q: m& p; f; P, d
9 E+ ^. |: q& {9 [$ Y* i
#include <QtCore/qglobal.h>
; u8 _7 U# Q! H9 |
0 l: E0 m- I, i% {6 N6 o6 G" {. k; |#ifndef QT_NO_CONCURRENT
! d* u4 E/ q! k1 N h! Q0 G7 g
. X8 w. q; i4 l#include <QtCore/qfuture.h>
5 x& e2 N& B" D9 a1 P& F3 p, q+ |! x#include <QtCore/qrunnable.h>' l& \9 Q0 D% V) y J
#include <QtCore/qthreadpool.h>' S* X1 J# B! ^7 Y
- s2 A% Y: B/ F# o# S1 |
QT_BEGIN_HEADER8 ]. ^1 h5 u* t
QT_BEGIN_NAMESPACE
- |$ ~# c4 q |( G
i* K9 C1 s, r/ w3 O; bQT_MODULE(Core)
! |- R5 M4 j/ f y7 s" T* d s7 C6 n" D: u3 C6 W7 G
#ifndef qdoc! W# R# T! Z; e: l, M( d
0 S }* Z/ z/ Mnamespace QtConcurrent {
8 J2 Y! c, V* ?5 Y# I( M, q' H9 b$ }. u% O
template <typename T># e7 ?3 b/ n5 k% f+ G% n
struct SelectSpecialization
: U# ?$ G% _7 E1 C{
8 ^: x* f# `) b) s template <class Normal, class Void>+ Q, U8 D% T/ f; m8 }2 h; V' W
struct Type { typedef Normal type; };
1 z o, d* U2 z# q};
8 F0 K! \! w6 I. N: g! {* F' a& w5 B$ A5 ?4 J
template <> v5 y! U ]/ I! D- D% W1 L# ]. g! E. v
struct SelectSpecialization<void>
6 ^, x j8 _; f7 S: Z{
: m g; s5 W. t, ?( y8 w template <class Normal, class Void>
" T+ @& l u0 S! @ struct Type { typedef Void type; };3 A# p7 R4 n4 Q( d
};" Z/ Y$ [4 [. A1 Q8 J3 L
: O3 l9 J+ Z5 O- F
template <typename T>3 s$ M/ u- I7 ~9 T/ ^4 P; v
class RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable
3 x! S7 {/ Q5 }4 T0 J8 i! J{' U( T& m' ~2 d9 d
public:
9 u- ]8 D3 R+ M) ~ QFuture<T> start()
# x5 T5 |" r3 p {9 E6 B I* Z# R
this->setRunnable(this);9 J/ ]3 m7 G. B c+ h
this->reportStarted();
' z7 C; N% c' F( O: C' ` QFuture<T> future = this->future();0 G# Y3 D! L: F
QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);
5 x" w$ K& ^0 D. D return future;0 A6 ~ p' C/ Y$ F
}% L$ o4 t7 a' H' e
0 t. t+ A2 q/ v* e& F- Z void run() {}
7 w5 b- Z& \' }5 \3 N virtual void runFunctor() = 0;* g3 V8 k+ `3 w8 e9 r0 E
};
# K6 r7 l' W- B' D( g+ {# |4 ]
9 j* l+ O% P! e& Htemplate <typename T>5 y* {4 C/ h8 ^
class RunFunctionTask : public RunFunctionTaskBase<T>
5 w6 p7 m8 I' y m% L{+ G, X l$ v2 @9 T
public:
6 `! P; q* M7 B void run()* S+ B. e0 @# n3 s6 ?" Y, ~
{
4 M- g( [$ a# o( `3 v# U1 | if (this->isCanceled()) {. x5 l2 Z* s1 ^% P8 x+ ^9 l
this->reportFinished(); ?* {! B. s8 j/ L. A, z! P
return;
2 r3 @, f" L7 [: U$ d, v& X* b }/ k0 }/ P, |6 a
this->runFunctor();
* \7 y/ [* n/ u! O+ J2 f this->reportResult(result);
- D' j/ Q5 t6 Z* S) y6 ~1 G this->reportFinished();
) `6 M8 f- Z) r, @ } p6 _" ~* x6 E+ l7 F! ?) N
T result;
7 e4 Q, W V* b3 E};6 v* f1 x @3 B8 H7 j2 k' O; q
* X. L7 D; d( p! {template <>
* b" p. G, [; u' Fclass RunFunctionTask<void> : public RunFunctionTaskBase<void>" X4 e/ g3 ^ t7 Q8 n
{
2 ]+ Z- a" }) Zpublic:" D! p3 Z8 m: Y" d/ i$ I( {7 a
void run()0 c/ D0 U+ r8 i9 P! z, j
{, o, \$ M( T: d1 |. O) O* A! b9 N7 @
if (this->isCanceled()) {0 X5 M& t0 w. Q
this->reportFinished();6 J- d, X' H1 S
return;. S- U% B& K! d6 ~5 O
}
1 ?0 ~' ^# K V this->runFunctor();
3 m5 M9 G! Y! E4 H' i; I this->reportFinished();1 q6 Q) s* m0 w" P& G5 ?
}
$ J0 H& b3 s" k; x9 {" w};
: o* }: N4 c4 T0 q
* s8 X+ L) i- U! l; H f; A} //namespace QtConcurrent% l& E( Z8 D+ e: g$ S4 g5 E; R
" P0 G3 @) C% u) q% K#endif //qdoc1 @! V" H/ a, V/ T6 {/ y
8 j& P! O' ~7 t& c9 J, V' ?7 `
QT_END_NAMESPACE
i+ X/ |6 ?' ]% b% T- RQT_END_HEADER8 x% X5 y5 D9 O% F1 {2 _
1 P5 g5 b5 E" `6 [7 H+ N#endif // QT_NO_CONCURRENT! N- G3 ~$ Q- o" J% r
& z2 q8 |% X' m- G5 ]6 d' o
#endif
1 e2 d* c$ S3 s; Q& M4 Z# a' @3 n' a" a$ T4 F/ x9 G. ~
|
|