|
|
我对syslink进行交叉编译到arm,但是出现如下错误:5 `- |6 ]( V/ i+ h: f0 I
/home/tl/Projects/Xdl-build-arm/../../qt/Qt4.7/include/QtCore/qtconcurrentrunbase.h:65: error: two or more data types in declaration of 'parameter'* b/ }' D' ?" W+ A4 r$ I
( s2 z G3 Q2 S
这个头文件内容如下:
4 f( M" @! l5 A) N4 D% C#ifndef QTCONCURRENT_RUNBASE_H1 G* J3 @( w7 x# q. l1 Y2 H
#define QTCONCURRENT_RUNBASE_H
# B) g7 A! ]$ C, G2 O, y: G: }1 K( |4 k R% o
#include <QtCore/qglobal.h>/ J1 | O& J6 A4 e: S5 a9 P
8 q8 a1 `! ~* p' ^0 z#ifndef QT_NO_CONCURRENT
1 z2 @" l2 ?. H6 L' }) \# Y
5 |3 I* U! O- O% Q- O! e" J7 ]#include <QtCore/qfuture.h>
2 Z! ?4 L- A; O- S, c. A( P# P#include <QtCore/qrunnable.h>' q [8 B+ {7 p2 c3 G
#include <QtCore/qthreadpool.h>
% v! q/ u% D e3 ^# g8 |0 A$ U0 l" @- |8 C
QT_BEGIN_HEADER
3 k( ?/ q X& }' h- R% I$ {QT_BEGIN_NAMESPACE
( p7 ^2 b/ U0 g5 z! k' B$ q! y- h1 _5 L6 ~ G* T
QT_MODULE(Core): w4 w* O! N, m4 R
8 [& \7 u) {5 ]& a9 R
#ifndef qdoc
: s, V, Y: {7 L
. K9 B* T' {& @6 j$ i1 r* ~4 Wnamespace QtConcurrent {
5 F( \5 \" V" I, H0 M) z @- z; e2 V5 t& T3 O. K" F
template <typename T>: O. T3 Z+ ?% {9 a( H) S: M0 _
struct SelectSpecialization! X7 u; i& v0 q9 X
{, L- z+ B3 f' a8 j) Q
template <class Normal, class Void>
/ v1 J; b8 A6 _& S1 [" k& N- e6 H struct Type { typedef Normal type; };" R. A9 ?( p6 q, S7 {
};
/ h2 C9 h( T: t7 H8 `) m
1 D/ h/ P% a! H7 \4 v% z! R! |template <> [# O/ ~+ v7 [* S
struct SelectSpecialization<void>' Q, @' t; X" n7 J0 [& i
{
% y& a: g4 z6 } X" z; G template <class Normal, class Void>6 v5 B: W- o+ E( o' j; H
struct Type { typedef Void type; };0 h }' R) N! d0 @
};
) O' O' S5 e# s9 S9 x1 k* z
# _: _5 u: p/ ]9 s0 E3 R3 Itemplate <typename T>6 v9 L- J% H; H! E& i8 V6 c
class RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable e4 z9 r& g" ]9 M
{5 a; L7 A; a+ f, k
public:2 _ k4 E1 O' [) |
QFuture<T> start()
+ X7 `. B- ^( C9 G {
4 F; ?$ Y$ I/ b! l$ u this->setRunnable(this);0 t- T, V+ A9 r8 X" g# o0 P* Q8 S
this->reportStarted(); X- N% V! B# `7 W6 }4 r3 O
QFuture<T> future = this->future();
$ C& o1 G" \5 Z& e+ A$ N1 m QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);
6 y- x0 `% `8 |, [) F$ J return future;
4 @3 c; ^1 g/ B$ G0 U6 n r7 {4 R }
( N5 t3 n" n+ {0 S% M; d% M5 a, r Z( l
void run() {}
6 h+ s! @8 `; e4 b! t virtual void runFunctor() = 0;+ l# b0 Q0 V; C+ ?
};3 |& s% ~' `& ^# o8 A
# {) A2 B T# O! u8 K! J2 W
template <typename T>* A0 y% |- D9 c& p' \% Y/ E P9 y
class RunFunctionTask : public RunFunctionTaskBase<T>: t& j0 p& u! K
{, r. A# P+ x2 {. ^: V
public:5 _% O; k2 v( \# V. `6 U* o5 a& k" O
void run()
1 F' W' X5 d$ K6 B1 ~9 c% B& _; @9 } { A7 }) f+ T( w+ P$ q. Z( O/ C
if (this->isCanceled()) {/ {% E: M# W) a* U
this->reportFinished();. ]) |+ X$ G* I! Z7 O* E
return;8 y1 S4 v& K$ l5 P& }
} t( s: u5 C4 B+ I P; T* }0 N( J
this->runFunctor();
; H% O! H6 g" ^ this->reportResult(result);# e* U8 b: e& s
this->reportFinished();
I5 X0 c$ l; g9 B1 g9 b4 | }* ^; V6 v2 \ I- B' K
T result;2 W0 \8 }2 [: K( x1 y
};
! P6 E- B8 V M$ x- ~
! O3 \/ T" V. |7 ~template <>
5 N9 X* x1 ?1 b U, {class RunFunctionTask<void> : public RunFunctionTaskBase<void>
! M# i8 D5 H s3 Z! I; J: N{
' u5 M r4 a! V( ]( w% @& ~public:
4 N2 g: s; t) E e, D void run()
4 m- V( v2 y/ f# p+ J' i$ j+ d: @ {* Z! y' e/ ?/ A8 m9 S3 T
if (this->isCanceled()) {
$ R/ i3 B# @8 K! U" L this->reportFinished();- O5 g! w+ P/ b6 i
return;
) o# c8 F/ D G0 U/ k3 l }
/ c- `9 `; b% q) J this->runFunctor();
- l4 w# o; f. X. x: h this->reportFinished();
% J0 I$ l4 n1 R, P7 U }5 U4 r+ X f8 _& ]5 n
};
7 K B# ~- T- H. Z
- f* ~! t+ _& g) _} //namespace QtConcurrent% o( _& k* \4 i
. D! O' C/ L' p8 \8 Y- y#endif //qdoc
) C2 J% H8 |- b
, F. f: v. y. }( H+ D& gQT_END_NAMESPACE
" @, F I3 Z0 N# N1 }; _9 H* ZQT_END_HEADER( o1 s- _. }6 i5 S) e( K
- _/ a- V, ^/ O \9 f' L#endif // QT_NO_CONCURRENT! H6 ~. k6 I: H! u( H( \; R
6 c9 w( } `$ R) c( `6 c* z, W#endif N; v C2 v: B3 Y2 E9 i5 T
5 |7 B# w0 q: L4 l6 H& @
|
|