|
|
我对syslink进行交叉编译到arm,但是出现如下错误:
5 U% ]; t4 h' j7 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'2 K# P ~9 |: C6 H: s
& _$ ^- [ p* K3 o ?
这个头文件内容如下:
- b" Y4 u: z& B: V/ s a#ifndef QTCONCURRENT_RUNBASE_H
6 }2 X4 [! l/ \' F; ]#define QTCONCURRENT_RUNBASE_H7 j% h' F- W: _" m( }4 Z, a
5 q6 v6 A5 G% q* w
#include <QtCore/qglobal.h>( x, J/ J. o( ^- F
; b6 t. @. [" a9 f. X#ifndef QT_NO_CONCURRENT/ w& ~$ \) [! Y
# m: }0 O; l0 g% C7 A% C, ~. V* S#include <QtCore/qfuture.h>( g9 }9 |2 Q! j4 B1 o0 i; Y4 X# e. @
#include <QtCore/qrunnable.h>
$ l# b. _$ [1 |! \$ ]#include <QtCore/qthreadpool.h>
( v; Q! C+ g3 p9 E8 B( d
+ |/ F8 V. x# j7 p' b5 _QT_BEGIN_HEADER g# I: Z- G [9 A4 e: |
QT_BEGIN_NAMESPACE# J5 ], k# I3 c. s) R
+ c; }9 S( p- L* q" DQT_MODULE(Core)& G5 T. s( w; M, o3 u |
* ?) e2 a- O' K( f( \, `#ifndef qdoc$ f4 n( C4 o' e
1 G9 n0 F3 p7 v( E6 S
namespace QtConcurrent {
2 e: ?1 l. a8 x# t
6 I: F* [% l1 h' N+ w4 Btemplate <typename T>
9 p& b! S9 Y5 Z1 X$ W: E! Z4 v# Z1 @struct SelectSpecialization5 w( |1 n; j" Z: ?5 x' ?
{7 Q3 z3 o. @0 J6 w6 N
template <class Normal, class Void>) V0 e# g6 r! U0 n |% \
struct Type { typedef Normal type; };3 @2 R! q$ Z5 i" G9 o8 i
};
2 R2 k5 O, S; w$ W1 J
5 K- v; f& s2 F1 h/ |template <>
3 B* }+ _$ u; |, ~* X! {struct SelectSpecialization<void>3 k6 `$ f/ L+ n* p+ w! c% Z, @
{! m$ Y( u, \' P6 Y4 k+ r
template <class Normal, class Void>
) h; Z* O3 p0 J' W) P struct Type { typedef Void type; };/ t# y% O7 j- j9 b) v6 r- ^0 U
};
9 D) h2 s5 `8 p' ^
' o' x" ]4 Y2 [$ Gtemplate <typename T>
! F, Z d2 P) x+ J* s# i) X2 w+ wclass RunFunctionTaskBase : public QFutureInterface<T> , public QRunnable; t9 o! X: @, {) S J# `! _+ `9 b( {
{5 z; i4 S6 \6 o! D1 @
public:
8 {/ z. N! J/ ?+ U QFuture<T> start()
6 P) K2 d7 D- U/ z7 H {* a: s: W; T- Q( G
this->setRunnable(this);
6 O3 G X* N; @! a& D this->reportStarted();
6 B+ T4 C. N& b9 S QFuture<T> future = this->future();5 ~4 `- _, F1 n
QThreadPool::globalInstance()->start(this, /*m_priority*/ 0);2 A6 f, O/ Z! O! b) F2 ?( o2 `9 N
return future;3 j3 p+ z1 ^' D$ _8 q
}
+ S, z5 {$ i# s6 @+ s
- |" X( c+ a' J- q/ V2 c) Z void run() {}6 _- h, j; u- W; c1 _
virtual void runFunctor() = 0;! D/ {- U R* y; Z1 j3 n; J( j
};
7 Z- ~. ~2 |1 s$ ?5 g: p' y9 k+ e
1 i$ u" y0 Q* |1 b+ Vtemplate <typename T>% |- R9 i7 x% m. [
class RunFunctionTask : public RunFunctionTaskBase<T>4 c& n' S9 [3 Z ~- W7 V
{& g' k1 g4 W' \
public:
7 A& F9 d1 K9 t# [% B6 ?: N$ m( G: n void run()
* ?; k) Q1 X# t6 A, c+ G }' [ {
0 Y/ k7 u8 B9 P0 r6 x. W if (this->isCanceled()) {
) \/ e* K2 U- m9 A0 T' W this->reportFinished();
" [/ o( H& N; O( v3 E* ] return;# S: \$ h, s3 G2 q5 m/ y8 F7 @5 K
}
% ^% |: X) @8 \9 X$ e4 E$ l* M I this->runFunctor();( N* Q2 |& h' O* t8 G X6 D
this->reportResult(result); \6 A6 q: X O5 j
this->reportFinished();
4 E; V3 z, P7 n7 I8 } y }+ c8 g: ?. p1 q% D- M
T result;
7 j- P: G8 y* b+ v. g}; ?* q# d' ~5 M3 c" X @) j
/ g: l: `% o0 y9 Mtemplate <>
; @ Z f: L1 Oclass RunFunctionTask<void> : public RunFunctionTaskBase<void>
P6 y! j, ~; s+ ]{$ }4 k8 u5 Y# R* z
public:+ o( b! {! J5 i3 q- r4 B
void run()
t! j. B$ l7 m7 j; C+ A {
) i4 A' c0 C" y* i if (this->isCanceled()) {6 Z% w9 K. F- z; f7 L
this->reportFinished();
7 }, L/ y3 `% [7 c1 A return;4 g, R0 {$ m1 m0 K* z/ o* f
}# h0 C3 z0 c$ V3 ]1 {! a
this->runFunctor();
. s9 S+ m! o0 D& _: V* t- H this->reportFinished();- O' _. j8 P+ t3 C$ V
}5 d* i$ H) u' E2 Z2 e7 b
};/ | K- O& [4 W6 @7 b* p
' D1 R$ Q/ \* K# r9 \5 `" [" K} //namespace QtConcurrent) i1 ?/ w6 `: x( E, w
: O A* @* Y% {
#endif //qdoc
6 v+ V8 [/ ?6 x# [, k$ h, u+ S, l
QT_END_NAMESPACE& f1 {+ Z0 {9 X' ?
QT_END_HEADER- m" J6 |+ o% _, J/ R. A7 U
! `$ X7 w+ ]2 ^4 v8 C) A#endif // QT_NO_CONCURRENT$ [7 x! z, D; p* L( U
0 T* ^/ K9 o. z! H#endif8 i( `, G. {6 N; d$ t
1 N- M3 L2 U8 [( u; \ |
|