Skip to content

Commit

Permalink
Fixed build issue when using GLEW with MSVC
Browse files Browse the repository at this point in the history
MSVC does not support the #warning precompiler command and
is considered an error when used. This change checks for
GCC before issuing the warning.

Change-Id: Iee1e27841fe77b0289e88b7b4ccaa176ab56a39d
Reviewed-by: Samuel Rødal <[email protected]>
  • Loading branch information
nezticle authored and Qt by Nokia committed Apr 10, 2012
1 parent 673ce6c commit 2756101
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gui/kernel/qopenglcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@
#include <QtGui/QSurfaceFormat>

#ifdef __GLEW_H__
#if defined(Q_CC_GNU)
#warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined
#warning To use GLEW with Qt, do not include <qopengl.h> or <QOpenGLFunctions> after glew.h
#endif
#endif

#include <QtGui/qopengl.h>

Expand Down
2 changes: 2 additions & 0 deletions src/gui/opengl/qopenglfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@
#ifndef QT_NO_OPENGL

#ifdef __GLEW_H__
#if defined(Q_CC_GNU)
#warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined
#warning To use GLEW with Qt, do not include <qopengl.h> or <QOpenGLFunctions> after glew.h
#endif
#endif

#include <QtGui/qopengl.h>
#include <QtGui/qopenglcontext.h>
Expand Down
2 changes: 2 additions & 0 deletions src/opengl/qglfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@
#define QGLFUNCTIONS_H

#ifdef __GLEW_H__
#if defined(Q_CC_GNU)
#warning qglfunctions.h is not compatible with GLEW, GLEW defines will be undefined
#warning To use GLEW with Qt, do not include <QtOpenGL> or <QGLFunctions> after glew.h
#endif
#endif

#include <QtOpenGL/qgl.h>
#include <QtGui/qopenglcontext.h>
Expand Down

0 comments on commit 2756101

Please sign in to comment.