diff --git a/package/archlinux/PKGBUILD-gcc47 b/package/archlinux/PKGBUILD-gcc47 index 2101e11db..acda7ac47 100644 --- a/package/archlinux/PKGBUILD-gcc47 +++ b/package/archlinux/PKGBUILD-gcc47 @@ -14,6 +14,10 @@ provides=('magnum-git') _rootdir=$startdir/../../ build() { + # Disable flags unknown to GCC 4.7 + newcxxflags=$(echo $CXXFLAGS | sed s/-fstack-protector-strong.//g) + export CXXFLAGS="$newcxxflags" + if [ ! -d "$_rootdir/build-gcc47" ] ; then mkdir "$_rootdir/build-gcc47" cd "$_rootdir/build-gcc47" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b38322828..3810d9c9f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -39,7 +39,7 @@ endif() # # Disable it also for GCC 4.4, as it breaks non-const Matrix[34]::up() # etc. accessors (and I have no better solution for that yet) -if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.8.0") OR CORRADE_GCC44_COMPATIBILITY) +if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.0") OR CORRADE_GCC44_COMPATIBILITY) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") # For GCC 4.5 disable just the strict-aliasing warnings. They are mostly diff --git a/src/Magnum/Framebuffer.cpp b/src/Magnum/Framebuffer.cpp index 9ae189db6..34eceddfa 100644 --- a/src/Magnum/Framebuffer.cpp +++ b/src/Magnum/Framebuffer.cpp @@ -250,6 +250,10 @@ Framebuffer& Framebuffer::attachTextureLayer(Framebuffer::BufferAttachment attac #endif #ifdef MAGNUM_BUILD_DEPRECATED +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4996) /* deprecated warning */ +#endif Framebuffer& Framebuffer::attachTexture2D(BufferAttachment attachment, Texture2D& texture, Int mipLevel) { #if defined(__GNUC__) && !defined(CORRADE_GCC45_COMPATIBILITY) #pragma GCC diagnostic push @@ -261,6 +265,9 @@ Framebuffer& Framebuffer::attachTexture2D(BufferAttachment attachment, Texture2D #endif return *this; } +#ifdef _MSC_VER +#pragma warning(pop) +#endif #endif void Framebuffer::renderbufferImplementationDefault(BufferAttachment attachment, Renderbuffer& renderbuffer) { diff --git a/src/Magnum/Implementation/TransformFeedbackState.h b/src/Magnum/Implementation/TransformFeedbackState.h index d7b6504ed..29cc5c643 100644 --- a/src/Magnum/Implementation/TransformFeedbackState.h +++ b/src/Magnum/Implementation/TransformFeedbackState.h @@ -47,7 +47,7 @@ struct TransformFeedbackState { GLint maxBuffers; #endif - GLuint binding; + GLuint binding; void(TransformFeedback::*createImplementation)(); void(TransformFeedback::*attachRangeImplementation)(GLuint, Buffer&, GLintptr, GLsizeiptr); diff --git a/src/Magnum/Implementation/setupDriverWorkarounds.cpp b/src/Magnum/Implementation/setupDriverWorkarounds.cpp index 6f8af7739..fe1e2c805 100644 --- a/src/Magnum/Implementation/setupDriverWorkarounds.cpp +++ b/src/Magnum/Implementation/setupDriverWorkarounds.cpp @@ -41,7 +41,7 @@ void Context::setupDriverWorkarounds() { #ifdef CORRADE_TARGET_WINDOWS /* On Windows Intel drivers ARB_shading_language_420pack is exposed in GLSL even that the extension (e.g. binding keyword) is not supported */ - if((detectedDriver() & DetectedDriver::IntelWindows) && !Context::current()->isExtensionSupported()) + if((detectedDriver() & DetectedDriver::IntelWindows) && !isExtensionSupported()) _setRequiredVersion(GL::ARB::shading_language_420pack, None); #endif diff --git a/src/Magnum/MeshView.h b/src/Magnum/MeshView.h index c172b1c65..466182a1f 100644 --- a/src/Magnum/MeshView.h +++ b/src/Magnum/MeshView.h @@ -168,7 +168,8 @@ class MAGNUM_EXPORT MeshView { * available there. * @see @ref setCount() */ - MeshView& setIndexRange(Int first, UnsignedInt start, UnsignedInt end); + /* MinGW/MSVC needs inline also here to avoid linkage conflicts */ + inline MeshView& setIndexRange(Int first, UnsignedInt start, UnsignedInt end); #ifdef MAGNUM_BUILD_DEPRECATED /** diff --git a/src/Magnum/ResourceManager.hpp b/src/Magnum/ResourceManager.hpp index 44ffc3d02..16b7f2127 100644 --- a/src/Magnum/ResourceManager.hpp +++ b/src/Magnum/ResourceManager.hpp @@ -38,7 +38,11 @@ namespace Magnum { namespace Implementation { -template CORRADE_VISIBILITY_EXPORT ResourceManager*& ResourceManagerLocalInstanceImplementation::internalInstance() { +template +#ifndef _MSC_VER +CORRADE_VISIBILITY_EXPORT +#endif +ResourceManager*& ResourceManagerLocalInstanceImplementation::internalInstance() { static ResourceManager* _instance(nullptr); return _instance; } diff --git a/src/Magnum/SceneGraph/AbstractTranslationRotation2D.h b/src/Magnum/SceneGraph/AbstractTranslationRotation2D.h index d6d77145d..75bb81682 100644 --- a/src/Magnum/SceneGraph/AbstractTranslationRotation2D.h +++ b/src/Magnum/SceneGraph/AbstractTranslationRotation2D.h @@ -78,7 +78,7 @@ template class AbstractBasicTranslationRotation2D: public AbstractTrans * instead. */ CORRADE_DEPRECATED("use rotate() or rotateLocal() instead") AbstractBasicTranslationRotation2D& rotate(Math::Rad angle, TransformationType type) { - return type == TransformationType::Global ? rotate(angle, type) : rotateLocal(angle, type); + return type == TransformationType::Global ? rotate(angle) : rotateLocal(angle); } #endif diff --git a/src/Magnum/SceneGraph/AbstractTranslationRotation3D.h b/src/Magnum/SceneGraph/AbstractTranslationRotation3D.h index 93fd650e6..f9e90cbf5 100644 --- a/src/Magnum/SceneGraph/AbstractTranslationRotation3D.h +++ b/src/Magnum/SceneGraph/AbstractTranslationRotation3D.h @@ -202,7 +202,7 @@ template class AbstractBasicTranslationRotation3D: public AbstractTrans * instead. */ CORRADE_DEPRECATED("use rotateZ() or rotateZLocal() instead") AbstractBasicTranslationRotation3D& rotateZ(Math::Rad angle, TransformationType type) { - return type == TransformationType::Global ? rotateZ(angle) : rotateZLocal(); + return type == TransformationType::Global ? rotateZ(angle) : rotateZLocal(angle); } #endif @@ -221,7 +221,7 @@ template class AbstractBasicTranslationRotation3D: public AbstractTrans return *this; } #ifdef MAGNUM_BUILD_DEPRECATED - CORRADE_DEPRECATED("use translate() or translateLocal() instead") AbstractBasicTranslationRotation3D& translate(const Math::Vector2& vector, TransformationType type) { + CORRADE_DEPRECATED("use translate() or translateLocal() instead") AbstractBasicTranslationRotation3D& translate(const Math::Vector3& vector, TransformationType type) { AbstractTranslation<3, T>::translate(vector, type); return *this; } diff --git a/src/Magnum/Shaders/Flat.h b/src/Magnum/Shaders/Flat.h index 407f99920..c79fedd2c 100644 --- a/src/Magnum/Shaders/Flat.h +++ b/src/Magnum/Shaders/Flat.h @@ -200,7 +200,8 @@ template class MAGNUM_SHADERS_EXPORT Flat: public Abstra * multiplied with texture if @ref Flag::Textured is set. * @see @ref setTexture() */ - Flat& setColor(const Color4& color); + /* MSVC needs inline also here to avoid linkage conflicts */ + inline Flat& setColor(const Color4& color); /** * @brief Set texture diff --git a/src/MagnumExternal/OpenGL/GL/CMakeLists.txt b/src/MagnumExternal/OpenGL/GL/CMakeLists.txt index 9a2fed073..0009c0fb1 100644 --- a/src/MagnumExternal/OpenGL/GL/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GL/CMakeLists.txt @@ -26,7 +26,7 @@ # flextGLPlatform.cpp is compiled as part of Magnum*Context libraries in Platform add_library(MagnumFlextGLObjects OBJECT flextGL.cpp) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang") +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Clang") set_target_properties(MagnumFlextGLObjects PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -DFlextGL_EXPORTS") else() set_target_properties(MagnumFlextGLObjects PROPERTIES COMPILE_FLAGS "-DFlextGL_EXPORTS")