|
|
我对syslink进行交叉编译到arm,但是出现如下错误:. l& y( T6 w' ?, i5 d" 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'
6 P& H/ g9 Q% {8 l
: S$ |$ h; y! T H2 j- r ~这个头文件内容如下:3 N/ W5 U; x+ y
#ifndef QTCONCURRENT_RUNBASE_H0 m% m" Z2 V6 e0 Q. Z0 H
#define QTCONCURRENT_RUNBASE_H
( t: l8 Q+ q1 x1 q2 ^* K" x) J
( H: ?' }2 Y( Q2 ^#include <QtCore/qglobal.h>7 G' ~$ t/ t2 E3 K! e9 C+ |& s) U
$ w& v& A; V' ~, \#ifndef QT_NO_CONCURRENT
- `6 h' h8 ^- _; k
: g* V) o( w5 o& O# S9 c#include <QtCore/qfuture.h>
`" \ d* l: r. y7 s3 \- {#include <QtCore/qrunnable.h># x0 C6 Z9 M& i8 M" Q9 i9 h5 Q. g- I
#include <QtCore/qthreadpool.h>8 n- W% C5 e$ Q* ^; ?. X: I' M
* }/ F/ l: J( p2 g. f6 Y
QT_BEGIN_HEADER
2 h7 W# ]; {" d8 EQT_BEGIN_NAMESPACE
5 ?; j' g8 { A" @ C5 Y3 w5 H' y* L# s7 U1 S2 v1 ]! B
QT_MODULE(Core)
|: h) [+ ^. M/ m+ @0 p2 `9 x& s9 D5 G+ B6 o4 @
#ifndef qdoc! b7 x( v# G) c8 {
( S& S& G- T, W5 x4 S+ P& ~9 anamespace QtConcurrent {9 c! [& l& P1 D, O: m% l8 Y
0 b g* |1 d& i5 |
template <typename T>% {9 W/ X& h' D* h
struct SelectSpecialization
! E" A: U( w2 g5 Z' `* u/ d% t% z3 u{
8 `! r9 n1 `6 s template <class Normal, class Void>
3 ?6 v2 u7 i) m* [ struct Type { typedef Normal type; };: x6 u5 X1 {( X7 j/ g7 t: S* w- K
};
% Z) S8 i" }) M7 p' ]: @& v; Q' Y" }2 h p2 A6 C$ Q' ]
template <># ~3 w7 N5 D- \8 ~$ }, `
struct SelectSpecialization<void>
$ i6 V/ c* G1 X! ~% }3 D; X{
9 u! D. `' r# O4 r! J( \ template <class Normal, class Void>
. U+ c) Z$ e$ i/ e% Z7 } struct Type { typedef Void type; };7 b P8 e6 j' q! a8 R5 J" `6 I" w
};
2 X E+ h m1 l( D3 ?
: m5 f4 A! [- p! H' ]* s: Vtemplate <typename T>
7 K! `& E. G( g& oclass RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable
& i0 h1 X& a+ a x9 B/ m{
$ x+ g( A- ~0 X: l# f( o% wpublic:/ J: w$ e% f. B9 H7 X% d
QFuture<T> start()
4 O9 o ` {, a, } {
/ m0 t* h- J9 V# v+ C! t this->setRunnable(this);
& n* O& U* M+ K6 Q this->reportStarted();6 [: v5 c1 h2 v+ i s$ m- v7 e1 J
QFuture<T> future = this->future();
/ o. e; S3 j$ k$ y QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);
8 E9 @4 [( c! x return future;9 g% [9 j# H- x2 I& q7 r
}
9 v% l5 R3 A; p. U5 J6 u* Q5 T) ~9 g# s9 B# X+ w
void run() {}) f0 x) h: y$ V6 z
virtual void runFunctor() = 0;" ~, M R7 P6 z% c
};
" h. n0 ~) @! P. ~
7 F( z( W6 f6 H. q gtemplate <typename T>$ }9 ?2 |5 R. g @3 R3 [: |: a- x
class RunFunctionTask : public RunFunctionTaskBase<T>
" q; f/ B1 P( S{3 w" H0 O: R+ Q) \1 a2 M7 b+ @
public:
, N | s4 [" O$ U* W9 ^ void run()8 k S% j& ]3 B" C
{, h2 l8 M5 p; r y6 H7 ^
if (this->isCanceled()) {( x8 j, J! F ?4 X4 B
this->reportFinished();
+ R7 L3 |0 r {9 x return;
- ]( a- w( z$ Q }
& }- E' d$ s6 C this->runFunctor();# i y3 g1 j* X9 y# u
this->reportResult(result);0 M4 N/ q+ L- I7 \7 O5 }
this->reportFinished();- X& H8 ^. \8 E" b, n" d; g( P- f
}- ?, ]# h' r/ ^( L1 C8 G5 e
T result;
7 f9 N2 i& p, M P8 F};
. p. U) j J5 R6 o1 e% t% N1 F- g9 }3 W( s# ~, E3 P; X
template <>
$ R5 _( M0 E5 r' Yclass RunFunctionTask<void> : public RunFunctionTaskBase<void>
1 U# l- X9 C) U" m3 w9 y{
+ _& q* M P2 M" Gpublic:
q. E; ]7 K- e8 { void run()5 E, M+ X2 s; F( w
{
4 @( J, C- [$ H" y6 ~, x3 n if (this->isCanceled()) {% g" l, V3 ^$ i5 ~
this->reportFinished();2 P, e- _$ G s$ Z# [
return;
2 M4 h- h5 M v+ X7 j; V5 ~( s }
; s9 E! ^2 V% R/ g. N this->runFunctor();
+ T0 L7 f# b# Z. T: S6 J this->reportFinished();4 Z: E) g5 y4 R' }& j- L
}
) b3 Y9 y' u$ h& S: ?};
/ g/ R# {5 k! Y4 w$ ?. u: @: m1 ~% I5 w. Z
} //namespace QtConcurrent& q: c; D9 d; S( Q3 k
) W( O& _* ~# Q; I* u1 q- y. K$ ]. k
#endif //qdoc
( `. d. o) a* ?* v4 \. F! m' R/ h' ?$ ~+ p
QT_END_NAMESPACE( G& P. X/ a$ }' I3 M6 L+ `" ]
QT_END_HEADER' V) X! o% k0 R' c |
! p+ a& t( K9 W) [
#endif // QT_NO_CONCURRENT
. H$ Y" x4 A8 T) p: ?) h3 O! C
6 Q; y* `* h4 F2 G5 E#endif
& G1 d# B0 x- ^* J7 l9 y8 Q: D4 W# J9 O0 f: H9 M, J- L6 J: v/ `
|
|