[core] Added MBGL_CONSTEXPR to satisfy GCC 4.9
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/util/traits.hpp>
|
||||
#include <mbgl/util/util.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -11,15 +12,15 @@ enum class Update {
|
||||
AnnotationData = 1 << 7
|
||||
};
|
||||
|
||||
constexpr Update operator|(Update lhs, Update rhs) {
|
||||
MBGL_CONSTEXPR Update operator|(Update lhs, Update rhs) {
|
||||
return Update(mbgl::underlying_type(lhs) | mbgl::underlying_type(rhs));
|
||||
}
|
||||
|
||||
constexpr Update& operator|=(Update& lhs, const Update& rhs) {
|
||||
MBGL_CONSTEXPR Update& operator|=(Update& lhs, const Update& rhs) {
|
||||
return (lhs = lhs | rhs);
|
||||
}
|
||||
|
||||
constexpr bool operator& (Update lhs, Update rhs) {
|
||||
MBGL_CONSTEXPR bool operator& (Update lhs, Update rhs) {
|
||||
return mbgl::underlying_type(lhs) & mbgl::underlying_type(rhs);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/util/traits.hpp>
|
||||
#include <mbgl/util/util.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
@@ -12,15 +13,15 @@ enum class RenderPass : uint8_t {
|
||||
Translucent = 1 << 1,
|
||||
};
|
||||
|
||||
constexpr RenderPass operator|(RenderPass a, RenderPass b) {
|
||||
MBGL_CONSTEXPR RenderPass operator|(RenderPass a, RenderPass b) {
|
||||
return RenderPass(mbgl::underlying_type(a) | mbgl::underlying_type(b));
|
||||
}
|
||||
|
||||
constexpr RenderPass& operator|=(RenderPass& a, RenderPass b) {
|
||||
MBGL_CONSTEXPR RenderPass& operator|=(RenderPass& a, RenderPass b) {
|
||||
return (a = a | b);
|
||||
}
|
||||
|
||||
constexpr RenderPass operator&(RenderPass a, RenderPass b) {
|
||||
MBGL_CONSTEXPR RenderPass operator&(RenderPass a, RenderPass b) {
|
||||
return RenderPass(mbgl::underlying_type(a) & mbgl::underlying_type(b));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <mbgl/util/optional.hpp>
|
||||
#include <mbgl/util/immutable.hpp>
|
||||
#include <mbgl/util/image.hpp>
|
||||
#include <mbgl/util/util.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
@@ -89,23 +90,23 @@ enum class WritingModeType : uint8_t {
|
||||
Vertical = 1 << 1,
|
||||
};
|
||||
|
||||
constexpr WritingModeType operator|(WritingModeType a, WritingModeType b) {
|
||||
MBGL_CONSTEXPR WritingModeType operator|(WritingModeType a, WritingModeType b) {
|
||||
return WritingModeType(mbgl::underlying_type(a) | mbgl::underlying_type(b));
|
||||
}
|
||||
|
||||
constexpr WritingModeType& operator|=(WritingModeType& a, WritingModeType b) {
|
||||
MBGL_CONSTEXPR WritingModeType& operator|=(WritingModeType& a, WritingModeType b) {
|
||||
return (a = a | b);
|
||||
}
|
||||
|
||||
constexpr bool operator&(WritingModeType lhs, WritingModeType rhs) {
|
||||
MBGL_CONSTEXPR bool operator&(WritingModeType lhs, WritingModeType rhs) {
|
||||
return mbgl::underlying_type(lhs) & mbgl::underlying_type(rhs);
|
||||
}
|
||||
|
||||
constexpr WritingModeType& operator&=(WritingModeType& lhs, WritingModeType rhs) {
|
||||
MBGL_CONSTEXPR WritingModeType& operator&=(WritingModeType& lhs, WritingModeType rhs) {
|
||||
return (lhs = WritingModeType(mbgl::underlying_type(lhs) & mbgl::underlying_type(rhs)));
|
||||
}
|
||||
|
||||
constexpr WritingModeType operator~(WritingModeType value) {
|
||||
MBGL_CONSTEXPR WritingModeType operator~(WritingModeType value) {
|
||||
return WritingModeType(~mbgl::underlying_type(value));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user