|
|
我对syslink进行交叉编译到arm,但是出现如下错误:0 s3 C9 B- y0 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 _. T6 l, u# W
/ l: R. U9 d7 A: a
这个头文件内容如下:- v% L. Q j A7 m4 l7 Q# n! m
#ifndef QTCONCURRENT_RUNBASE_H
" i) ?! P: H& v1 O+ r#define QTCONCURRENT_RUNBASE_H" k# n0 N! s* @" L. e( ^
' P! E+ ^: t# P#include <QtCore/qglobal.h>% r3 p# a! t/ V0 [1 M8 G1 [
$ ?6 v8 J8 j5 @
#ifndef QT_NO_CONCURRENT4 X) o! ^% L' \" u w, S' Y+ g$ }
8 E1 A E" R0 [5 ]/ g- s#include <QtCore/qfuture.h>* b J- H1 ~" M
#include <QtCore/qrunnable.h>
( ]! I( @- s8 U9 ]#include <QtCore/qthreadpool.h>" u w) c7 g$ Z0 I
& n, y4 s Z0 b, G7 B4 vQT_BEGIN_HEADER+ U! L1 U5 Z- H) a' B# [" u
QT_BEGIN_NAMESPACE" U0 t0 X) }0 t6 c) b+ E/ I
( B8 L0 [9 F: q: ^, x( j, t9 m
QT_MODULE(Core)3 S |7 r/ t9 s! Z* }0 f
7 d& w2 w) M5 W3 o- n/ ^#ifndef qdoc
1 r" C4 W9 T) `+ C5 K4 f* s# e! c+ }6 ~4 ~' `
namespace QtConcurrent {+ ^. c' e- [5 N0 Y4 g) ]7 \
! ^7 E: X1 P2 ~! u' M- ^+ Z; z% @& L; Dtemplate <typename T>
- _9 w+ |, P( {! D4 K1 E" |struct SelectSpecialization0 u M0 C" t3 u9 i3 L
{* `0 Y9 i% u; r) v9 L: _* t
template <class Normal, class Void>4 C- r% Q. M* l0 e& }& _5 P
struct Type { typedef Normal type; }; Q& G7 N8 `9 Q/ T8 x
};
6 A1 j5 L) J5 p( E& z! k" D/ G C8 j: L- J
template <>4 N A+ P- O5 |! l4 [# w
struct SelectSpecialization<void>
; R3 o: M1 o1 G+ o4 m6 m; _{
6 B0 j6 T0 s# y, D template <class Normal, class Void>
: n- K1 S4 \6 ^9 O$ b7 [ struct Type { typedef Void type; };
; ^7 Y5 _' v, |" S4 @- G; _8 L};8 d- P" C. M7 k; [6 ]7 j: }. z
z6 L$ C# H6 ~" T4 v5 U9 Wtemplate <typename T>
! c! F v6 E: p& i" r) Z4 Aclass RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable9 N. X6 H3 o- d' T
{- f6 m; ^. j3 e
public:2 N `& |9 L- b
QFuture<T> start()
7 T) |* Q R& d {
0 V. s- t8 v# ^, d0 L this->setRunnable(this);
1 e6 B$ Z" ]+ Y' U+ `# @ this->reportStarted();- W/ d( E" O4 l4 r6 \3 A
QFuture<T> future = this->future();& @. o$ D; T9 _3 f) c
QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);
8 R3 }! o9 h$ t return future;
0 y f- L! k1 g ~5 b }
6 S( j R# r6 S" E: i7 {! F K! r8 F" {$ T, ]" a
void run() {}
% ^: H h4 b2 C! ` \# ?9 V O4 o virtual void runFunctor() = 0;* }, P' W7 A9 Z2 v6 r% F" M9 @
};
) P, n7 T, D+ w1 P# p9 ~
$ T" g/ ?) x8 v! ftemplate <typename T> W8 O/ s6 _3 N" V5 A _
class RunFunctionTask : public RunFunctionTaskBase<T>( ^' E) e. O! V4 \' E8 @1 v! ?) ]: G1 E
{
( E' B: A+ ~0 F% g. z9 W2 T: ypublic:4 a4 \5 T9 T- @" f/ ?" ?
void run()
* }. T5 e" x+ u {' ]/ K6 {! i1 p; \% s' q. c# F5 ^' u
if (this->isCanceled()) {8 D9 J* N: N0 \" j/ E% H
this->reportFinished();6 [$ [) a+ t) p% n$ I3 t
return;
0 c7 [2 H1 Z/ z! r4 t+ I4 ?1 v }
+ x/ Z# b. ^+ l4 x) t3 G, V this->runFunctor();5 |. S% j! M& r7 R6 V. v @8 c
this->reportResult(result);
+ K5 Y& u5 j3 x' b9 p this->reportFinished();
/ a0 r9 x, ?7 L3 t6 Z( j" t }
' ~5 O4 p: w) v: m- S T result;8 K: K+ Z- ]7 c/ L
};2 m; O! b4 g$ F( J5 \5 j( Y
V! r# e1 y+ g' M3 r
template <>6 W9 j3 w. [* l! M/ L0 H- {! a
class RunFunctionTask<void> : public RunFunctionTaskBase<void>
~* p7 k6 U2 w% \7 {" Z! w# X$ V{
5 I. W+ O; M$ X3 J* Y" Qpublic:
. E9 I* v/ m$ H: k" ? void run()( C8 G% K$ U$ h, W0 P1 {
{, j% L; `' A) f
if (this->isCanceled()) {$ g/ ^' x) P" q8 D
this->reportFinished();
! s( n6 _+ ?! w( z4 F( e9 v- p return;
6 g, ~8 J3 l9 Y- A2 i" K- w }
* B2 {/ Y7 ?- \# {4 C8 G" r' j this->runFunctor();
; @3 d& m- m0 [$ y. `( Z1 [; w this->reportFinished();' \3 n, p8 ~6 _ I3 b+ E# z4 m# y
}
5 \( v: [7 }! u9 J( X4 J& b$ g};2 Q3 ?% s$ }9 H y
! R4 t, Y4 z. m0 E. `} //namespace QtConcurrent" y! @ ~) U' c! K' Z* o/ m5 f6 Y
- g* D4 |$ I) h2 @9 u#endif //qdoc
& @. l9 X& f" J- w2 M) y1 X& T# B- C* `4 V
QT_END_NAMESPACE
- ~9 k: H6 t: E8 fQT_END_HEADER8 x+ B3 t6 ~/ W+ p! d% n2 m
2 R$ x& ]0 @/ p" x h4 k. b8 @
#endif // QT_NO_CONCURRENT9 r% \( f4 ~5 }3 S
4 J1 B" F. C6 E1 p8 u/ B#endif1 d4 Z# P# v- M! W+ i5 M3 m$ P
) O3 ?' }% H4 Z: c. N |
|