Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cxx17 compatability fixes #3103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/mbgl/gfx/shader_group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ class ShaderGroup {
using PropertyHashType = std::uint64_t;

std::string getShaderName(const std::string_view& name, const PropertyHashType key) {
return (std::ostringstream() << name << '#' << std::hex << key).str();
std::ostringstream oss;
oss << name << '#' << std::hex << key;
return oss.str();
}

/// Generate a map key for the specified combination of properties
Expand Down
12 changes: 5 additions & 7 deletions src/mbgl/layout/symbol_instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include <mbgl/style/layers/symbol_layer_properties.hpp>
#include <mbgl/util/bitmask_operations.hpp>

#ifdef __cpp_lib_source_location
#include <source_location>
#endif

#if !defined(MLN_SYMBOL_GUARDS)
#define MLN_SYMBOL_GUARDS 1
Expand All @@ -20,8 +22,9 @@

// A temporary shim for partial C++20 support
#if MLN_SYMBOL_GUARDS
#if defined(__clang__)
#if __cplusplus <= 201703L || !__has_builtin(__builtin_source_location)
#if __cpp_lib_source_location
#define SYM_GUARD_LOC std::source_location::current()
#else
namespace std {
struct source_location {
const char* fileName_;
Expand All @@ -38,11 +41,6 @@ struct source_location {
std::source_location { \
__FILE__, __FUNCTION__, __LINE__ \
}
#else
#define SYM_GUARD_LOC std::source_location::current()
#endif
#else
#define SYM_GUARD_LOC std::source_location::current()
#endif
#else
#define SYM_GUARD_LOC \
Expand Down
4 changes: 3 additions & 1 deletion src/mbgl/util/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ std::string toString(uint64_t t) {
}

std::string toString(const std::thread::id& t) {
return ((std::stringstream{}) << t).str();
std::stringstream ss;
ss << t;
return ss.str();
}

std::string toString(double t, bool decimal) {
Expand Down