Fix compilation with ICC: failure to parse placement of Q_DECL_OVERRIDE

This is the right way:
  void (*getProcAddress(const QByteArray &procName)) () Q_DECL_OVERRIDE;

However, ICC and GCC do not get it. They expect it in the form:
  void (*getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE) ();

ICC complains with an error, so this needs a workaround. GCC ignores the
incorrectly-placed "override", so it just looks to GCC like no "override"
was added.

See also: https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/IjVB8CWiS5A
Change-Id: I1a800c709d3543699131ffff13c2ffc9cee46245
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Thiago Macieira 2015-02-14 22:27:54 -08:00
parent 1d2efe1f27
commit aa855afa44
3 changed files with 3 additions and 3 deletions

View File

@ -64,7 +64,7 @@ public:
bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
void doneCurrent() Q_DECL_OVERRIDE;
void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
void (*getProcAddress(const QByteArray &procName)) () Q_DECL_OVERRIDE;
QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE;
QSurfaceFormat format() const Q_DECL_OVERRIDE;
bool isSharing() const Q_DECL_OVERRIDE { return m_shareContext != EGL_NO_CONTEXT; }

View File

@ -85,7 +85,7 @@ public:
bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
void doneCurrent() Q_DECL_OVERRIDE;
void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
void (*getProcAddress(const QByteArray &procName)) () Q_DECL_OVERRIDE;
QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE;
QSurfaceFormat format() const Q_DECL_OVERRIDE;
bool isSharing() const Q_DECL_OVERRIDE;

View File

@ -57,7 +57,7 @@ public:
bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
void doneCurrent() Q_DECL_OVERRIDE;
void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
void (*getProcAddress(const QByteArray &procName)) () Q_DECL_OVERRIDE;
QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE;
QSurfaceFormat format() const Q_DECL_OVERRIDE;
bool isSharing() const Q_DECL_OVERRIDE;