From 2756101d0e3b2a044e3e13a53421512c86dc5ba5 Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Sun, 8 Apr 2012 15:50:02 +0200 Subject: [PATCH] Fixed build issue when using GLEW with MSVC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gui/kernel/qopenglcontext.h | 2 ++ src/gui/opengl/qopenglfunctions.h | 2 ++ src/opengl/qglfunctions.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h index 52f94a8a10..2dc4357b00 100644 --- a/src/gui/kernel/qopenglcontext.h +++ b/src/gui/kernel/qopenglcontext.h @@ -51,9 +51,11 @@ #include #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 or after glew.h #endif +#endif #include diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h index 4e778dda66..be366a79c8 100644 --- a/src/gui/opengl/qopenglfunctions.h +++ b/src/gui/opengl/qopenglfunctions.h @@ -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 or after glew.h #endif +#endif #include #include diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h index da3ce7db4d..0cb0b712ba 100644 --- a/src/opengl/qglfunctions.h +++ b/src/opengl/qglfunctions.h @@ -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 or after glew.h #endif +#endif #include #include