summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-02-29 18:23:24 +0100
committerKonstantin Käfer <mail@kkaefer.com>2016-04-04 16:20:04 -0700
commit65acf35dcfa3784de7e522926469083068599550 (patch)
treeaff3e7b1bb20d61bc29015de09d3e8e2f2e0ea06
parent001d24dc338cd11ecfc5d5d1a37436b05be8c5f7 (diff)
downloadqtlocation-mapboxgl-65acf35dcfa3784de7e522926469083068599550.tar.gz
[core] fix various compilation issues
-rw-r--r--gyp/platform-linux.gypi1
-rw-r--r--platform/default/http_request_curl.cpp4
-rw-r--r--platform/default/png_reader.cpp4
-rw-r--r--scripts/main.mk6
-rw-r--r--src/mbgl/util/thread.hpp10
5 files changed, 15 insertions, 10 deletions
diff --git a/gyp/platform-linux.gypi b/gyp/platform-linux.gypi
index 172e7349fa..3d2c042996 100644
--- a/gyp/platform-linux.gypi
+++ b/gyp/platform-linux.gypi
@@ -32,6 +32,7 @@
'variables': {
'cflags_cc': [
+ '<@(opengl_cflags)',
'<@(libpng_cflags)',
'<@(libjpeg-turbo_cflags)',
'<@(nunicode_cflags)',
diff --git a/platform/default/http_request_curl.cpp b/platform/default/http_request_curl.cpp
index 58c574fee1..fc57e4c137 100644
--- a/platform/default/http_request_curl.cpp
+++ b/platform/default/http_request_curl.cpp
@@ -525,11 +525,11 @@ void HTTPCURLRequest::handleResult(CURLcode code) {
} else if (responseCode >= 500 && responseCode < 600) {
response->error =
std::make_unique<Error>(Error::Reason::Server, std::string{ "HTTP status code " } +
- std::to_string(responseCode));
+ util::toString(responseCode));
} else {
response->error =
std::make_unique<Error>(Error::Reason::Other, std::string{ "HTTP status code " } +
- std::to_string(responseCode));
+ util::toString(responseCode));
}
}
diff --git a/platform/default/png_reader.cpp b/platform/default/png_reader.cpp
index 2b9bbbeb46..096596ee2e 100644
--- a/platform/default/png_reader.cpp
+++ b/platform/default/png_reader.cpp
@@ -83,8 +83,8 @@ PremultipliedImage decodePNG(const uint8_t* data, size_t size) {
png_set_sig_bytes(png_ptr, 8);
png_read_info(png_ptr, info_ptr);
- unsigned width = 0;
- unsigned height = 0;
+ png_uint_32 width = 0;
+ png_uint_32 height = 0;
int bit_depth = 0;
int color_type = 0;
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0);
diff --git a/scripts/main.mk b/scripts/main.mk
index 889222719e..d10fa39d52 100644
--- a/scripts/main.mk
+++ b/scripts/main.mk
@@ -147,20 +147,20 @@ Xcode/%: Xcode/__project__
Ninja/%: Ninja/__project__
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Building target $*...$(FORMAT_END)\n"
- $(QUIET)$(ENV) deps/ninja/ninja-$(HOST) -C build/$(HOST_SLUG)/$(BUILDTYPE) $*
+ $(QUIET)$(ENV) deps/ninja/ninja-$(BUILD) -C build/$(HOST_SLUG)/$(BUILDTYPE) $*
Ninja/compdb: OUTPUT=build/$(HOST_SLUG)/$(BUILDTYPE)/compile_commands.json
Ninja/compdb: Ninja/__project__
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Writing to $(OUTPUT)$(FORMAT_END)\n"
- $(QUIET)$(ENV) deps/ninja/ninja-$(HOST) -C build/$(HOST_SLUG)/$(BUILDTYPE) \
+ $(QUIET)$(ENV) deps/ninja/ninja-$(BUILD) -C build/$(HOST_SLUG)/$(BUILDTYPE) \
-t compdb cc cc_s cxx objc objcxx > $(OUTPUT)
#### Tidy ######################################################################
tidy: Ninja/compdb
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Generating header files...$(FORMAT_END)\n"
- $(QUIET)$(ENV) deps/ninja/ninja-$(HOST) -C build/$(HOST_SLUG)/$(BUILDTYPE) version shaders
+ $(QUIET)$(ENV) deps/ninja/ninja-$(BUILD) -C build/$(HOST_SLUG)/$(BUILDTYPE) version shaders
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Running tidy...$(FORMAT_END)\n"
@./scripts/clang-tidy.sh
diff --git a/src/mbgl/util/thread.hpp b/src/mbgl/util/thread.hpp
index 33ca5aba6b..dc388c922c 100644
--- a/src/mbgl/util/thread.hpp
+++ b/src/mbgl/util/thread.hpp
@@ -11,6 +11,8 @@
#include <mbgl/util/thread_context.hpp>
#include <mbgl/platform/platform.hpp>
+#include <pthread.h>
+
namespace mbgl {
namespace util {
@@ -93,11 +95,13 @@ Thread<Object>::Thread(const ThreadContext& context, Args&&... args) {
std::tuple<Args...> params = std::forward_as_tuple(::std::forward<Args>(args)...);
thread = std::thread([&] {
- #if defined( __APPLE__)
+#if defined(__APPLE__)
pthread_setname_np(context.name.c_str());
- #elif defined(__linux__)
+#elif defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+#if __GLIBC_PREREQ(2, 12)
pthread_setname_np(pthread_self(), context.name.c_str());
- #endif
+#endif
+#endif
if (context.priority == ThreadPriority::Low) {
platform::makeThreadLowPriority();