diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-12-20 15:01:13 -0200 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2017-01-24 11:36:59 +0200 |
commit | 9833ca8b76e9608ba9c3a8928de93b1fb9be3a45 (patch) | |
tree | d68c2d91b80a91870356e0d54039bd98a111740b /src/mbgl/gl | |
parent | 4dd6b704223e14762fb68b23f29ad9d644bfcc93 (diff) | |
download | qtlocation-mapboxgl-9833ca8b76e9608ba9c3a8928de93b1fb9be3a45.tar.gz |
[gcc4.9] Make constexpr usage compatible with GCC 4.9
Diffstat (limited to 'src/mbgl/gl')
-rw-r--r-- | src/mbgl/gl/attribute.hpp | 7 | ||||
-rw-r--r-- | src/mbgl/gl/gl.cpp | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/mbgl/gl/attribute.hpp b/src/mbgl/gl/attribute.hpp index e45014127b..95945bca64 100644 --- a/src/mbgl/gl/attribute.hpp +++ b/src/mbgl/gl/attribute.hpp @@ -148,11 +148,8 @@ public: using State = IndexedTuple<TypeList<As...>, TypeList<typename As::State...>>; using Vertex = detail::Vertex<As...>; - template <class A> - static constexpr std::size_t Index = TypeIndex<A, As...>::value; - static State state(const ProgramID& id) { - return State { typename As::State(bindAttributeLocation(id, Index<As>, As::name))... }; + return State { typename As::State(bindAttributeLocation(id, TypeIndex<As, As...>::value, As::name))... }; } static std::function<void (std::size_t)> binder(const State& state) { @@ -162,7 +159,7 @@ public: state.template get<As>().type, sizeof(Vertex), vertexOffset, - Vertex::attributeOffsets[Index<As>]), 0)... }); + Vertex::attributeOffsets[TypeIndex<As, As...>::value]), 0)... }); }; } }; diff --git a/src/mbgl/gl/gl.cpp b/src/mbgl/gl/gl.cpp index 8999468dbd..bd6d7b192d 100644 --- a/src/mbgl/gl/gl.cpp +++ b/src/mbgl/gl/gl.cpp @@ -1,12 +1,13 @@ #include <mbgl/gl/gl.hpp> #include <mbgl/util/string.hpp> +#include <mbgl/util/util.hpp> namespace mbgl { namespace gl { namespace { -constexpr const char* stringFromError(GLenum err) { +MBGL_CONSTEXPR const char* stringFromError(GLenum err) { switch (err) { case GL_INVALID_ENUM: return "GL_INVALID_ENUM"; |