|
|
我对syslink进行交叉编译到arm,但是出现如下错误:6 U6 e5 h) k: L, X1 O0 b0 d' y
/home/tl/Projects/Xdl-build-arm/../../qt/Qt4.7/include/QtCore/qtconcurrentrunbase.h:65: error: two or more data types in declaration of 'parameter'
% l% e9 M. [' I; I
1 M" N: P* V* i" r7 o& |这个头文件内容如下:
( f/ Z5 { Q6 J. X% G4 d#ifndef QTCONCURRENT_RUNBASE_H+ b+ M( H; v. C$ e* W* F% |
#define QTCONCURRENT_RUNBASE_H# O$ O0 x+ T6 P
7 H7 \+ ~. o3 d3 c i#include <QtCore/qglobal.h>
5 Q2 w7 t0 P( Z1 ?4 q: I! T! z* K/ `, K3 R+ M( V$ Z" c
#ifndef QT_NO_CONCURRENT: {4 B! z/ q9 S! b) R
9 ~ Z+ e. ]' P' @
#include <QtCore/qfuture.h>
" C$ z* N# n( U; z: n#include <QtCore/qrunnable.h>& L+ D; k9 T1 ~! f
#include <QtCore/qthreadpool.h>) N, X; c8 Y$ k r
8 n# {# X7 P1 B* l) _$ h$ w
QT_BEGIN_HEADER
1 R F5 z" |" A* t% AQT_BEGIN_NAMESPACE
: j2 n, D: c# f/ d0 |8 ?* {0 i+ W9 F8 Y8 h7 N
QT_MODULE(Core)
+ t- h1 r+ o/ a x+ |+ O) l6 X- U8 G# ^& D% `/ ~% }
#ifndef qdoc9 X1 G+ {7 O: @" Z% s! Y
, j3 B1 a. Z( Q2 A5 t
namespace QtConcurrent {6 ~+ d+ _ b$ R' c* |
' m8 I9 a1 A# Y
template <typename T>
& q2 h7 O( g. R! E+ A# R$ Ystruct SelectSpecialization+ g( D" v M8 c7 u: Y- u, X) C
{8 ]* Q" L0 Z! G) ?. E
template <class Normal, class Void>, c) \1 f3 p9 O9 @
struct Type { typedef Normal type; };5 A( Z( y$ |- |6 \/ i* `0 x5 p* H
};( B2 n' S2 ?3 I& N
; j P" E0 [; ~0 Atemplate <># E( D( K# r" b" z
struct SelectSpecialization<void>
$ C8 a/ [& o ], U0 d: M+ f{' P) `7 o" \& |# b1 |- ^: m
template <class Normal, class Void>% ?* m( @' G) ?
struct Type { typedef Void type; };' e7 q) M3 I+ n/ D- ^* Y3 l+ [
};
2 q! X( ^) V( E' O5 ?
( C# C3 J7 ^' @template <typename T>
& n" v" N" P4 y& p6 uclass RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable
+ s4 } H1 A- {; n ^% O8 ~1 R% c{8 E% D: m# G7 P# M# J
public:+ Y7 @& `4 Q% o7 i$ `+ [/ g+ P! S
QFuture<T> start()- M0 A& C; d+ G& i
{% [" }3 O% J' Z A2 ~
this->setRunnable(this);
7 T- D! j9 R0 C- a; O4 H; H8 Z this->reportStarted();
0 t0 H( K( l$ @: H& O QFuture<T> future = this->future();
: R% l( Z# X0 F" H QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);
1 X; e1 t# \3 o2 S. g2 S* l3 P return future;' F' l7 X' C b9 ?# x+ s
}
. Z- }' z @( ^- b) D
6 j0 I1 Y/ q3 a: e" K void run() {}
6 M3 n' [) Q$ ~( Z& P virtual void runFunctor() = 0;
2 [6 R4 l# x+ [};# j' V+ ^) K, R& s* u
: \" R9 m8 V4 a$ [! j+ ?8 j J. ]
template <typename T>
; {4 l4 j+ n5 I% p6 a' Aclass RunFunctionTask : public RunFunctionTaskBase<T># M2 q7 M O' Z2 c+ Q/ D
{
a0 |# K0 V$ ]3 p+ |public:* r4 x. _ ~" O; r
void run()* ?/ ]$ I ?1 j- N; Y
{4 d( ?# V' a0 c- Z4 m! ]* F& f
if (this->isCanceled()) {1 Y) R* }" U2 j; p2 }" ~
this->reportFinished();8 u4 S: w) v( f+ {" A0 b5 `
return;& V9 w& n0 s# \8 S
}
$ t4 j8 O, U, W/ Z4 j, L- `1 @' o this->runFunctor();" `1 n# O, t% v& G2 x# |6 m
this->reportResult(result);
; W+ Z0 f" ]: M- R ?! A this->reportFinished();
8 d: R9 {& y2 P& p2 i; T }
7 x4 B, [# h: ~! E Y T result;9 e' }$ k; X Y7 x/ c Y3 l4 U
};4 x* b- Z* h* i1 f% U
4 w0 I' Q6 M! N! ] C/ |template <>
" I0 X# u. p9 S1 [+ C: y- jclass RunFunctionTask<void> : public RunFunctionTaskBase<void>
2 {2 g. F# ?. L* i K" r{ r* ^( c, _; N( Y
public:
7 h4 c9 D: n6 W3 @3 A void run()3 e( m* U! X: \9 N2 u1 u& L
{
5 R9 y0 J6 H$ `0 x. e e( W6 ^ if (this->isCanceled()) {
2 g+ @! u, y* }/ o( O4 c8 f this->reportFinished();( p4 ^* C; n9 q- M4 F3 k& n
return;1 N- A( m+ X1 d
}
) x0 X& _6 D7 x6 n' B$ ^! F9 n this->runFunctor();
7 z+ S, ]0 o7 t1 H# m this->reportFinished();
8 C6 G d4 R( _5 I, v }+ F* J2 ?; {% n5 x
};
) x" Q) \7 q2 p) U6 ]
0 t, X6 m3 p7 w, Z} //namespace QtConcurrent
8 i9 p7 x- r/ k% K0 M( n
: ~- w& r# x" q1 d1 W5 O#endif //qdoc
9 @0 u) M6 G9 ]6 |! s U6 I( e7 y4 o
9 ~0 s0 { H4 ~& vQT_END_NAMESPACE
: `+ f, F- } @* X/ R5 J4 _QT_END_HEADER7 T! Z& k: u8 D$ b0 |
- \3 A7 z6 ]6 ]1 X( U
#endif // QT_NO_CONCURRENT# e7 \9 {" l+ F/ h6 Z' R: U2 _
. K5 Z9 `1 I5 G+ l- q8 I a7 t#endif
' [) Z$ r3 i" c" F
# C3 ?: ]- s8 k! g% q9 ? |
|